AI-powered code analysis tool. Paste code, link a GitHub repo, or upload a folder — get instant quality scores, security analysis, and actionable improvement suggestions.
Live: archlabs.vercel.app
- Sign in with GitHub, Google, or email
- Submit code (paste, GitHub URL, or folder upload)
- AI analyzes code quality, security, performance, and documentation
- Get scored results with specific feedback
- Share results via public link
git clone https://github.com/thealxlabs/ARCHITECT.git
cd ARCHITECT
npm installSet up your .env file (see .env.example for required variables):
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
VITE_API_KEY=your_openrouter_api_key
Run the database setup SQL from DATABASE-SETUP.md in your Supabase SQL Editor, then:
npm run dev| Layer | Technology |
|---|---|
| Frontend | React 19, TypeScript, Tailwind CSS |
| Build | Vite |
| Routing | React Router v6 |
| Auth + DB | Supabase (PostgreSQL, OAuth, RLS) |
| AI | OpenRouter API (configurable — default: Mistral 7B) |
| Hosting | Vercel |
| Icons | Lucide React |
ARCHITECT/
├── pages/ # Route pages
│ ├── HomePage.tsx # Public landing
│ ├── Login.tsx # Auth (GitHub, Google, email)
│ ├── Signup.tsx # Registration
│ ├── Dashboard.tsx # Analysis history
│ ├── AnalyzePage.tsx # Code submission
│ ├── ResultsPage.tsx # Scored results display
│ └── Settings.tsx # User settings
├── components/ # Reusable UI
│ ├── Hero.tsx # Landing page hero
│ ├── InputSection.tsx # Code input + secret scanning
│ ├── AnalysisLoader.tsx # Progress animation + timeout
│ └── ProtectedRoute.tsx # Auth guard
├── services/
│ └── universalAIService.ts # OpenRouter client + retry + validation
├── lib/
│ └── supabase.ts # Auth helpers
├── config/
│ ├── api.ts # Model selection, retry & rate limit config
│ └── auth.ts # Auth constants
├── types/
│ ├── analysis.ts # Analysis types
│ └── auth.ts # Auth types
├── api/
│ └── webhook.ts # GitHub App webhook handler (Vercel serverless)
├── docs/ # Setup guides, SQL schemas, progress notes
├── constants.ts # AI system prompt
├── App.tsx # Router + error boundary + 404
└── archive/ # Deprecated files (reference only)
| Path | Access | Description |
|---|---|---|
/ |
Public | Landing page |
/login |
Public | Login |
/signup |
Public | Registration |
/dashboard |
Protected | Analysis history |
/analyze |
Protected | Submit code for analysis |
/results/:id |
Semi-public | View results (owner or shared) |
/share/:token |
Public | Shared analysis link |
ARCHITECT automatically retries failed API calls with exponential backoff (1.5s → 3s → 6s + jitter). This handles rate limits (429), server errors (5xx), and truncated JSON responses without manual intervention. After 3 failed attempts, the error surfaces to the user with a clear message.
To change the AI model, set VITE_AI_MODEL in your .env file (e.g. VITE_AI_MODEL=qwen/qwen-2.5-72b-instruct). See config/api.ts for the full list of available models. The env variable takes priority over the default, so you can run different models per environment without touching code.
ARCHITECT works best with small-to-medium codebases. For large repos, the input is automatically truncated to ~100K characters (roughly 25K tokens) to fit within the model's context window. The AI sees the beginning of your code and a note that it was truncated. For very large projects, consider submitting individual modules or key files rather than the entire codebase.
Do not submit sensitive, proprietary, or secret code. Input is sent to OpenRouter (a third-party API) for analysis. While results are stored in your private Supabase database with row-level security, the code itself passes through OpenRouter's infrastructure during analysis.
Shared links expose only the analysis results (scores, feedback) — not the original code input. Google verification files in public/ are for domain ownership verification during OAuth setup.
No test framework is set up yet. To add frontend tests:
- Install dependencies:
npm install -D vitest @testing-library/react @testing-library/jest-dom jsdom - Add to
vite.config.ts:/// <reference types="vitest" /> export default defineConfig({ test: { environment: 'jsdom', globals: true, setupFiles: './test/setup.ts' } });
- Create
test/setup.ts:import '@testing-library/jest-dom'; - Add script to
package.json:"test": "vitest" - Write tests in
__tests__/or alongside components as*.test.tsx
See SETUP-INSTRUCTIONS.md for CI integration with GitHub Actions.
This project deploys to Vercel. To set up automated deployment:
- Connect your GitHub repo to Vercel
- Add environment variables (
VITE_SUPABASE_URL,VITE_SUPABASE_ANON_KEY,VITE_API_KEY) in Vercel project settings - Every push to
maintriggers a deploy automatically
For automated testing, add a GitHub Actions workflow — see SETUP-INSTRUCTIONS.md for details.
All free tiers: Supabase (50K MAU), Vercel (hobby), OpenRouter (pay-per-use with free models available).
| File | Contents |
|---|---|
SETUP-INSTRUCTIONS.md |
Detailed setup, auth, testing & CI/CD |
docs/DATABASE-SETUP.md |
SQL schema for Supabase |
docs/GITHUB-APP-SETUP.md |
GitHub App integration |
docs/DATABASE-GITHUB-APP.sql |
GitHub App database schema |
The api/webhook.ts file is a Vercel serverless function that handles GitHub App webhook events (push, pull request, installation). It verifies the webhook signature using GITHUB_WEBHOOK_SECRET and routes events to handlers. Currently the push and PR handlers log events but don't trigger analysis yet (marked as TODO). To configure:
- Set
GITHUB_WEBHOOK_SECRETin your Vercel environment variables - Point your GitHub App's webhook URL to
https://your-domain.vercel.app/api/webhook - Subscribe to events:
push,pull_request,installation,repository
See docs/GITHUB-APP-SETUP.md for full GitHub App configuration.
MIT — Alexander Wondwossen (@thealxlabs)
Found a bug? Have a suggestion?
Report a Bug ·
Request a Feature