π€ AI-Powered Repository Analysis
- Paste any public GitHub/GitLab/Bitbucket URL and get instant AI insights
- Analyzes tech stack, code quality, complexity, and skill level
- Powered by Google Gemini
π Share & Compare
- Every scan gets a permanent shareable URL
- No account needed to view results
- Track your scan history with authentication
β‘ Smart & Fast
- Real-time progress updates
- Anonymous users get limited scans, authenticated users get more
- Results include: project description, technologies used, quality score (0-100), and developer skill level assessment
π What You Get
- Tech Stack Detection - Languages, frameworks, tools with confidence scores
- Code Quality Score - 0-100 rating with specific improvement suggestions
- Complexity Analysis - Understand what makes the project advanced
- Skill Level - Beginner, Junior, Mid-level, or Senior classification
- Project Structure - Tests, CI/CD, documentation quality assessment
- SvelteKit - Full-stack Framework
- Svelte 5 - UI Framework with Runes
- Tailwind CSS 4 - Utility-first Styling
- Flowbite Svelte - UI Components
- Lucide Svelte - Icon Library
- TypeScript - Type-safe Programming
- SvelteKit Server - Backend Runtime
- Node.js - JavaScript Runtime
- Zod - Schema Validation & Type Safety
- Firebase Firestore - NoSQL Database (User Data & Scans)
- Firebase Authentication - Email/Password Auth
- Google Gemini - AI Model for Code Analysis
- Docker - Containerization
- Docker Compose - Multi-container Orchestration
- Cloudflare Tunnel (Cloudflared) - Secure Ingress without Open Ports
- Cloudflare CDN/WAF - DDoS Protection & Edge Caching
- GitHub Actions - CI/CD Pipeline
- Ansible - Deployment Automation & Configuration Management
- Grafana Loki - Log Aggregation
- Promtail - Log Collection
- Grafana - Metrics Visualization & Dashboards
flowchart TB
subgraph Internet["Internet"]
Users[Users/Clients]
GitHubActions[GitHub Actions Runner]
end
subgraph Cloudflare["Cloudflare Edge Network"]
CDN[CDN/WAF/DDoS Protection]
TunnelEdge[Cloudflare Tunnel Edge]
end
subgraph CICD["CI/CD Pipeline"]
direction LR
Build[Build Docker Image]
Registry[GitHub Container<br/>Registry GHCR]
Ansible[Ansible Playbook<br/>SSH Deployment]
end
subgraph DockerHost["Production VM Docker"]
subgraph TunnelContainer["Cloudflared Container"]
Tunnel[Cloudflare Tunnel]
end
subgraph AppContainer["App Container"]
App[SvelteKit Application]
end
subgraph Monitoring["Monitoring"]
Grafana[Grafana]
Loki[Loki]
Promtail[Promtail]
Prometheus[Prometheus]
NodeExporter[Node Exporter]
CAdvisor[cAdvisor]
end
Network[Docker Network]
end
subgraph DataLayer["Data Layer"]
Firestore[("Firebase Firestore")]
end
DataLayer ~~~ ExternalServices
subgraph ExternalServices["External Services"]
GitProviders["Git Repository Providers"]
GeminiAI["Google Gemini"]
GitProviders ~~~ GeminiAI
end
%% User Flow - HTTP Traffic
Users -->|HTTPS request| CDN
CDN --> TunnelEdge
TunnelEdge -->|encrypted tunnel| Tunnel
Tunnel --> App
App --> Tunnel
Tunnel -->|encrypted tunnel| TunnelEdge
TunnelEdge --> CDN
CDN -->|HTTPS response| Users
%% CI/CD & Deployment Flow
GitHubActions -->|Build & Push| Build
Build --> Registry
GitHubActions -->|Run Ansible| Ansible
Ansible -->|SSH :22| VMHost
VMHost -->|Pull| Registry
VMHost -->|Deploy| DockerHost
%% Database Flow
App -->|read/write| Firestore
%% External API Flows
App -->|fetch metadata| GitProviders
App -->|AI analysis| GeminiAI
%% Monitoring Flow
App -.->|logs| Promtail
Tunnel -.->|logs| Promtail
Promtail --> Loki
Loki --> Grafana
Prometheus --> Grafana
NodeExporter -.-> Prometheus
CAdvisor -.-> Prometheus
%% Docker Network
AppContainer -.-> Network
TunnelContainer -.-> Network
Monitoring -.-> Network
style Internet fill:#e3f2fd
style Cloudflare fill:#fff3e0
style CICD fill:#ffebee
style DockerHost fill:#c8e6c9
style DataLayer fill:#f3e5f5
style ExternalServices fill:#e8f5e9
git-repository-analysis-system/
βββ .github/
β βββ workflows/
β βββ deploy.yml # CI/CD: Build Docker image, push to GHCR, deploy via Ansible
β
βββ ansible/ # Deployment automation
β βββ deploy.yml # Ansible playbook: install Docker, pull image, docker compose
β βββ inventory.yml # Target VM inventory
β βββ README.md # Deployment setup guide
β
βββ config/ # Monitoring & logging configuration
β βββ grafana-datasources.yml # Grafana data source configuration
β βββ loki-config.yml # Loki log aggregation settings
β βββ promtail-config.yml # Promtail log collection settings
β
βββ firebase/
β βββ firestore.indexes.json # Firestore indexes
β βββ firestore.rules # Firestore security rules
β
βββ scripts/
β βββ scan-repo.ts # CLI tool for testing scans
β
βββ src/
β βββ lib/
β β βββ components/ # Reusable Svelte components
β β β βββ Auth.svelte # Authentication UI
β β β βββ Avatar.svelte # User avatar display
β β β βββ RateLimits.svelte # Quota display
β β β βββ RepoSummary.svelte # Analysis results display
β β β βββ ScanArea.svelte # URL input & submission
β β β βββ ScanProgress.svelte # Real-time progress display
β β β βββ ScanStatus.svelte # Scan status indicator
β β β βββ Sidebar.svelte # Navigation sidebar
β β β βββ Welcome.svelte # Welcome message
β β β
β β βββ firebase/ # Firebase client SDK
β β β βββ index.ts # Firestore & Auth initialization
β β β
β β βββ schema/ # Zod schemas & TypeScript types
β β β βββ repository.ts # Repository & analysis types
β β β βββ scan.ts # Scan status & error types
β β β βββ user.ts # User & quota types
β β β βββ utils.ts # Schema utilities
β β β
β β βββ server/ # Server-side logic
β β β βββ validate/ # Validation logic
β β β β βββ quota.ts # Rate limiting & quotas
β β β β βββ url.ts # URL validation & parsing
β β β β βββ user.ts # User validation
β β β βββ analyzer.ts # Core analysis orchestration
β β β βββ constants.ts # Server constants
β β β βββ dummy.ts # Dummy data for testing
β β β βββ firebase.ts # Firebase Admin SDK setup
β β β βββ git-utils.ts # Git clone & metadata extraction
β β β βββ llm.ts # Gemini AI integration
β β β βββ prompt.ts # AI prompt generation
β β β βββ scan.ts # Scan creation & background jobs
β β β βββ scanInit.ts # Scan initialization
β β β
β β βββ stores/ # Svelte stores (state management)
β β β βββ anonymous.ts # Anonymous user tracking
β β β βββ auth.ts # Auth state & user data
β β β βββ history.ts # Scan history
β β β βββ scan-status.ts # Real-time scan tracking
β β β
β β βββ utils/
β β β βββ date.ts # Date formatting utilities
β β β
β β βββ scan-client.ts # Client-side scan operations
β β
β βββ routes/ # SvelteKit routes & pages
β β βββ api/ # API endpoints
β β β βββ anonymous/
β β β β βββ +server.ts # Anonymous user tracking
β β β βββ auth/ # Authentication endpoints
β β β β βββ signin/
β β β β β βββ +server.ts # Sign in endpoint
β β β β βββ signout/
β β β β βββ +server.ts # Sign out endpoint
β β β βββ scan/
β β β βββ +server.ts # Scan submission endpoint
β β β
β β βββ dashboard/[id]/
β β β βββ +page.server.ts # Dashboard server load
β β β βββ +page.svelte # User dashboard page
β β β
β β βββ scan/[id]/
β β β βββ +page.server.ts # Scan server load
β β β βββ +page.svelte # Scan progress & results page
β β β
β β βββ +layout.svelte # Root layout with navigation
β β βββ +page.svelte # Home page with scan submission
β β
β βββ app.css # Global styles
β βββ app.d.ts # TypeScript declarations
β βββ app.html # HTML template
β βββ hooks.server.ts # SvelteKit server hooks (auth)
β
βββ static/ # Static assets (empty)
β
βββ .env # Environment variables (gitignored)
βββ .env.example # Environment variables template
βββ .gitignore # Git ignore rules
βββ .npmrc # npm configuration
βββ compose.yml # Docker Compose configuration
βββ Dockerfile # Application container image
βββ LICENSE # MIT License
βββ package.json # Dependencies & scripts
βββ pnpm-lock.yaml # Lock file
βββ README.md # This file
βββ service-account-file.example.json # Firebase Admin credentials example
βββ service-account-file.json # Firebase Admin credentials (gitignored)
βββ svelte.config.js # SvelteKit configuration
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite build configuration- Node.js 18+ and pnpm
- Firebase project with Firestore and Authentication enabled
- Google Gemini API key (from Google AI Studio)
git clone https://github.com/ryanlinjui/git-repository-analysis-system
cd git-repository-analysis-system
pnpm i
cp .env.example .env # remember to set variables- Go to Firebase Console to create Firebase Project
- Create a new project
- Enable Firestore Database (start in production mode)
- Enable Authentication β Email/Password sign-in method
- Copy rules from
firebase/firestore.rulesto Firebase Console. - Get
service-account-file.jsonin project root for admin auth.
pnpm devTry scanning a repository:
https://github.com/google-gemini/gemini-cli
Or use dummy data for testing (no actual clone):
https://github.com/dummy/test-repo
This project uses GitHub Actions + Ansible for automated deployment to your VM. Please refer [.env.example](.env.example) for required environment variables and configure GitHub Secrets
docker compose down
docker compose build
docker compose up -d
docker compose build --no-cacheforces rebuild without cache if needed. Changecompose.ymlto includebuild: .underappservice for local builds.
docker compose ps
docker compose logs -f appThis project is licensed under the MIT License - see the LICENSE file for details.
