Turn any codebase into a system design document — in minutes, inside VS Code.
Local static analysis · Interactive dependency graphs · RAG architecture chat · AI reviews
Quick Start · Features · Architecture · Case Study · Benchmarks · Changelog · Contributing
ArchLens is a production-grade VS Code extension that analyzes your repository locally, builds a structural knowledge graph, and surfaces architecture diagrams, dependency graphs, technical debt, and grounded AI chat — without uploading source code to a cloud analyzer.
| Capability | What you get |
|---|---|
| Architecture Discovery | Detects MVC, Layered, Clean, Hexagonal, Microservices, Event-Driven patterns |
| Dependency Graph | Interactive D3 force graph with zoom, pan, search, click-to-open |
| Architecture Chat | RAG Q&A grounded in your analysis — files, paths, confidence scores |
| Technical Debt | God classes, circular deps, layer violations, git hotspots |
| Auth Flow Detection | JWT, Passport, middleware chains → Mermaid sequence diagrams |
| Database ERD | Prisma, TypeORM, Sequelize, Mongoose → Mermaid ER diagrams |
| AI Architecture Review | Structured strengths/weaknesses via OpenAI, Claude, or Gemini |
| Export System | Markdown, JSON, Mermaid, HTML bundle to .archlens/export/ |
Record a live demo GIF: README hero GIF guide
| Architecture Diagram | Technical Debt Report | Database ERD |
|---|---|---|
![]() |
![]() |
![]() |
| Pattern detection with layer flow visualization | Severity-ranked debt issues and hotspot analysis | Auto-generated entity-relationship diagram |
Capture production PNGs/GIFs: docs/demo/recording-guide.md · docs/demo/screenshots/
Ask natural-language questions about your codebase. ArchLens retrieves relevant entities from a knowledge graph built during analysis, then generates answers with referenced files, dependency paths, and confidence scores.
You: Where does authentication happen?
ArchLens: JWT validation occurs in auth.middleware.ts → AuthService.verifyToken()
Referenced: src/middleware/auth.ts, src/services/auth.service.ts
Confidence: 87%
→ RAG pipeline docs · Demo script
A directed force graph built from import relationships and layer inference. Explore coupling visually, search nodes, and jump to source files.
Deterministic detectors surface structural risks before they become production incidents:
- God classes and oversized modules
- Circular dependencies
- Layer violations (e.g. controller → repository)
- Dead code signals
- Git churn hotspots
Identifies JWT, Passport, session middleware, and login endpoints. Produces Mermaid sequence diagrams of the auth lifecycle.
Parses Prisma, TypeORM, Sequelize, and Mongoose schemas. Generates Mermaid ER diagrams from your actual model definitions.
When configured with an API key, ArchLens produces structured reviews: strengths, weaknesses, scalability risks, and actionable recommendations — grounded in deterministic analysis, not raw file dumps.
| Language | Extensions | Parser |
|---|---|---|
| TypeScript | .ts, .tsx |
ts-morph AST |
| JavaScript | .js, .jsx, .mjs, .cjs |
Babel AST |
| Go | .go |
Regex + structural parser |
ORM and framework detection covers Express, NestJS, Next.js, React, Fastify, Prisma, TypeORM, Sequelize, Mongoose, Passport, and more.
| Layer | Technologies |
|---|---|
| Extension Host | TypeScript, VS Code Extension API |
| Dashboard UI | React 18, Vite, D3.js, Mermaid |
| Static Analysis | ts-morph, Babel, custom Go parser |
| Diagrams | @archlens/diagram-engine (Mermaid + graph builder) |
| AI Layer | OpenAI, Claude, Gemini REST APIs |
| RAG | TF-IDF embeddings, knowledge graph, vector store |
| Testing | Vitest, 64 tests, v8 coverage |
| Build | npm workspaces, TypeScript project references |
- Node.js 18+
- npm 9+
- VS Code 1.85+
git clone https://github.com/archlens/archlens.git
cd archlens
npm install
npm run build:extensionPackage and install:
cd apps/vscode-extension
npm run package
# Extensions → Install from VSIX- Open any repository in VS Code (monorepo root recommended for development)
- Click the ArchLens icon in the Activity Bar
- Click Analyze Repository
- Explore the Dashboard — Architecture, Dependencies, Database, Auth, Debt, Review
- Open Architecture Chat for grounded Q&A
- Configure AI (optional):
ArchLens: Configure API Key
{
"archlens.aiProvider": "openai",
"archlens.apiKey": "sk-...",
"archlens.model": "gpt-4o-mini",
"archlens.maxFiles": 10000,
"archlens.useCache": true
}ArchLens is a TypeScript monorepo with strict package boundaries:
archlens/
├── apps/
│ ├── vscode-extension/ # Extension host, commands, webviews
│ └── webview-ui/ # React dashboard (bundled to media/)
└── packages/
├── shared/ # Types, constants, shared contracts
├── analysis-engine/ # Scanner, AST parsers, detectors
├── diagram-engine/ # Dependency graphs, Mermaid generation
├── ai-engine/ # LLM providers, docs, export
└── rag-engine/ # Knowledge graph, embeddings, chat
flowchart TB
subgraph VSCode["VS Code Extension"]
CMD[8 Commands]
SB[Sidebar]
DB[React Dashboard]
CH[Architecture Chat]
end
subgraph Engine["Analysis Engine"]
SCAN[Repository Scanner]
AST[AST Parsers]
DET[Pattern Detectors]
DEBT[Debt Scanner]
end
subgraph Intelligence["AI Layer"]
KG[Knowledge Graph]
RAG[RAG Retriever]
LLM[OpenAI / Claude / Gemini]
end
CMD --> SCAN --> AST --> DET
DET --> DEBT
DET --> DB
DET --> KG --> RAG --> LLM
CH --> RAG
Deep dives: System Architecture · Analysis Pipeline · RAG Pipeline
| Repository size | Files | LOC | Cold analysis | Warm cache | Peak memory |
|---|---|---|---|---|---|
| Small | 50 | 5K | ~0.2s | ~0.01s (31×) | ~79 MB |
| Medium | 500 | 50K | ~0.7s | ~0.05s (63×) | ~189 MB |
| Large | 2,000 | 200K | ~3.2s | ~0.18s (62×) | ~216 MB |
| Enterprise | 10,000 | 1M+ | ~48s (est.) | ~0.9s (est.) | ~650 MB (est.) |
npm run benchmarkFull methodology: docs/benchmarks.md
Sample analyses for popular stacks:
| Stack | Architecture | Graph | Debt | Onboarding | AI Review |
|---|---|---|---|---|---|
| Express | Report | Graph | Debt | Guide | Review |
| NestJS | Report | Graph | Debt | Guide | Review |
| Next.js | Report | Graph | Debt | Guide | Review |
| React | Report | Graph | Debt | Guide | Review |
| Scenario | How ArchLens helps |
|---|---|
| Onboarding | New engineers explore architecture, dependencies, and debt in day one |
| System design interviews | Generate defensible architecture narratives from real code |
| Refactoring planning | Identify god classes, circular deps, and layer violations before a rewrite |
| Security review | Trace authentication flows and database access paths |
| Tech due diligence | Export structured reports for M&A or vendor assessment |
| Documentation drift | Regenerate architecture docs when the codebase changes |
| Path | Purpose |
|---|---|
apps/vscode-extension/ |
VS Code extension entry, commands, webview hosts |
apps/webview-ui/ |
React dashboard (D3 + Mermaid) |
packages/analysis-engine/ |
Scanner, parsers, detectors, cache |
packages/diagram-engine/ |
Graph builder, Mermaid generators |
packages/ai-engine/ |
LLM providers, doc generation, export |
packages/rag-engine/ |
Knowledge graph, embeddings, RAG chat |
packages/shared/ |
Shared types and constants |
examples/ |
Sample outputs for Express, NestJS, Next.js, React |
docs/ |
Architecture, demos, case study, recruiter guide |
scripts/ |
Benchmark, command audit, analysis verification |
| Decision | Rationale |
|---|---|
| Local-first analysis | Source code never leaves the machine for scanning/parsing |
| Structured before generative | Deterministic AnalysisResult grounds all AI output |
| Monorepo packages | Clear dependency direction; each engine is independently testable |
| Hash-based cache | Second analysis run is 30–60× faster on unchanged repos |
| RAG over raw context | Retrieves entities from knowledge graph — reduces hallucination |
| VS Code native | Zero context switch; click graph nodes to open files |
Use these when describing ArchLens on a resume or portfolio:
- Built a VS Code extension with React webviews that analyzes codebases locally and generates architecture documentation, dependency graphs, and technical debt reports
- Designed a TypeScript monorepo with 5 domain packages (analysis, diagram, AI, RAG, shared) and 64 automated tests
- Implemented AST-based static analysis (ts-morph, Babel) with architecture pattern detection across 6+ patterns
- Built an interactive D3.js force-directed dependency graph with search, zoom, and file navigation
- Architected a RAG pipeline with knowledge graph construction, TF-IDF embeddings, and multi-provider LLM integration (OpenAI, Claude, Gemini)
- Achieved sub-second analysis on medium repos (500 files) with hash-based incremental caching
Full ATS-friendly versions: docs/resume-snippets.md
| Command | Description |
|---|---|
ArchLens: Analyze Repository |
Full codebase analysis + RAG index |
ArchLens: Generate Documentation |
Write .archlens/docs/architecture.md |
ArchLens: Show Dependency Graph |
Open interactive graph tab |
ArchLens: Show Architecture |
Open architecture diagram tab |
ArchLens: Architecture Chat |
RAG-powered Q&A panel |
ArchLens: Export Report |
Bundle to .archlens/export/ |
ArchLens: Open Dashboard |
Open analysis dashboard |
ArchLens: Configure API Key |
Set OpenAI / Claude / Gemini key |
| Path | Contents |
|---|---|
.archlens/analysis.json |
Full structured analysis snapshot |
.archlens/cache/ |
Incremental analysis cache |
.archlens/docs/ |
Generated markdown documentation |
.archlens/index/ |
RAG knowledge graph + embeddings |
.archlens/export/ |
Export bundle (MD, JSON, Mermaid, HTML) |
npm install
npm run build:extension # Build all packages + extension
npm test # 64 unit/integration tests
npm run test:coverage # Coverage report
npm run benchmark # Performance benchmarksOpen the monorepo root → Run Extension → F5. See docs/contributing.md.
| Document | Audience |
|---|---|
| docs/architecture/ | Engineers — system design deep dives |
| docs/case-study.md | Engineering leaders — build narrative |
| docs/recruiter-guide.md | Recruiters — non-technical overview |
| docs/resume-snippets.md | Candidates — ATS bullet points |
| docs/project-metrics.md | Contributors — project statistics |
| docs/release-readiness.md | Maintainers — launch checklist |
| CHANGELOG.md | Everyone — version history |
We welcome contributions. See CONTRIBUTING.md and docs/contributing.md.
- Fork the repository
- Create a feature branch
- Run
npm testandnpm run build:extension - Open a pull request
MIT © ArchLens Contributors






