Transform your codebase from a text forest into a navigable landscape.
Quick Start β’ Features β’ Documentation β’ Deployment β’ Contributing
CBCT (CodeBase Cartographic Tool) is a system that helps developers understand and explore large codebases by mapping them the way a cartographer maps terrain.
Instead of treating a codebase as a flat collection of files or a simple dependency graph, CBCT constructs a context-aware, layered map of the codebase. This map captures not just what is connected, but how and why those connections matter within the system.
- π― Identify central and critical components - Find the core modules that your system depends on
- π Understand impact paths before making changes - See what will be affected by modifications
- π§ Navigate unfamiliar codebases with confidence - Explore new projects without getting lost
- πΊοΈ Visualize relationships at multiple levels - From high-level architecture to file-level details
By turning complex codebases into navigable maps, CBCT transforms code exploration from guesswork into guided understanding, helping teams maintain, extend, and reason about software systems more effectively.
| Principle | Description |
|---|---|
| Thinking-First Design | Cognitive clarity over automation |
| Observational | Describes what exists, never prescribes |
| Silent by Default | No alerts, popups, or interruptions |
| Exploration-Driven | Understanding is discovered |
| Adaptive | Same UX regardless of repo size |
- Node.js 18 or higher
- npm 9+ or yarn 1.22+
- Git (for GitHub repository analysis)
# Clone the repository
git clone https://github.com/KD2303/CBCT-Code-Base-Cartographic-Tool.git
cd CBCT-Code-Base-Cartographic-Tool
# Install all dependencies
npm install
# Start development servers (frontend + backend)
npm run dev| Service | URL |
|---|---|
| Frontend | http://localhost:3000 |
| Backend API | http://localhost:5000 |
| Health Check | http://localhost:5000/api/health |
CBCT features an adaptive visualization system that automatically adjusts to your repository's size:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Small Repos (<80 files) β File-based units β
β Medium Repos (80-500 files) β Folder-based units β
β Large Repos (500+ files) β Semantic cluster units β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
4 Progressive Layers:
| Layer | Name | Purpose |
|---|---|---|
| 1 | Orientation | High-level overview |
| 2 | Structural | Connections and relationships |
| 3 | Impact & Risk | Dependency chains, risk indicators |
| 4 | Detail | Full file-level analysis |
- π IDE Sync - Click to jump directly to source in VS Code
- π€οΈ Pathfinding -
Ctrl + Clickto trace shortest dependency chain - π₯ Git Churn Hotspots - Visual heat auras for volatile files
- π§ Architectural Guardrails - Define and visualize forbidden boundaries
Analyze any public GitHub repository by pasting the URL:
https://github.com/facebook/react
https://github.com/vuejs/vue/tree/main/src
cbct/
βββ π client/ # React frontend (Vite + TailwindCSS)
β βββ src/
β β βββ components/ # UI components
β β β βββ GraphCanvas.jsx # Main visualization
β β β βββ Sidebar.jsx # Navigation panel
β β β βββ ErrorBoundary.jsx
β β βββ services/ # API client
β β βββ store/ # Zustand state management
β β βββ public/ # Public API exports
β β βββ __tests__/ # Unit tests (Vitest)
β βββ package.json
β
βββ π server/ # Node.js backend (Express)
β βββ src/
β β βββ routes/ # API endpoints
β β β βββ analysis.js # Dependency analysis
β β β βββ repository.js # Repo scanning & cloning
β β β βββ graph.js # Graph operations
β β βββ services/ # Business logic
β β β βββ analysisService.js
β β β βββ repositoryService.js
β β β βββ semanticLayerEngine.js
β β β βββ cacheService.js # Redis cache layer
β β β βββ globalDependencyGraph.js
β β βββ utils/ # Utilities
β β β βββ redisClient.js # Redis connection
β β βββ __tests__/ # Unit tests (Jest)
β βββ package.json
β
βββ π docker/ # Docker configuration
β βββ Dockerfile # Production container
β βββ Dockerfile.dev # Development container
β βββ docker-compose.yml # Container orchestration
β βββ README.md # Docker usage guide
β
βββ π Guides/ # Documentation hub
β βββ Navigations/ # All documentation guides
β βββ INDEX.md # Documentation index
β βββ QUICK_START.md # Getting started
β βββ ARCHITECTURE.md # System architecture
β βββ TECHNICAL_ARCHITECTURE.md # Technical deep dive
β βββ SEMANTIC_LAYER_GUIDE.md # Semantic layer details
β βββ DEVELOPMENT.md # Development setup
β βββ INTEGRATION_CONTRACT.md # Public API contract
β βββ INTEGRATION_PATTERNS.md # Integration examples
β βββ FORWARD_COMPATIBILITY_ASSESSMENT.md
β βββ REDIS_INTEGRATION.md # Redis caching guide
β βββ DEPLOYMENT_GUIDE.md # Deploy to Upstash+Render+Vercel
β βββ DEPLOYMENT_CHECKLIST.md # Deployment verification
β βββ DEPLOYMENT_QUICK_REFERENCE.md
β βββ DEPLOYMENT_FILES_SUMMARY.md
β
βββ π README.md # This file
βββ π package.json # Workspace root
βββ π .env.example # Environment template
βββ π verify-deployment.js # Deployment verification script
# Run all tests
npm test
# Run with coverage
npm run test:coverage# Server tests only (Jest)
npm run test:server
# Client tests only (Vitest)
npm run test:client
# Watch mode
cd server && npm run test:watch
cd client && npm run test:watchTests cover:
- β Service layer (analysis, repository, semantic engine)
- β API routes (dependencies, complexity, centrality)
- β React components and hooks
- β State management (Zustand store)
- β Edge cases and error handling
# Run production container
docker-compose -f docker/docker-compose.yml up
# Run development container with hot reload
docker-compose -f docker/docker-compose.yml --profile dev upπ See docker/README.md for detailed Docker instructions.
# Build the client
npm run build:client
# Start production server
NODE_ENV=production npm startDeploy with Redis caching on production platforms:
# Run verification script
node verify-deployment.jsπ See Guides/Navigations/DEPLOYMENT_GUIDE.md for complete setup instructions.
Copy .env.example to .env and configure:
# Server
NODE_ENV=production
PORT=5000
# Analysis
MAX_FILE_SIZE_KB=500
LARGE_REPO_THRESHOLD=1000
# Timeouts
SERVER_TIMEOUT=300000
CLONE_TIMEOUT_MS=600000| Method | Endpoint | Description |
|---|---|---|
POST |
/api/repository/scan |
Scan local path or GitHub URL |
GET |
/api/repository/tree |
Get file tree structure |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/analysis/dependencies |
Analyze file dependencies |
POST |
/api/analysis/complexity |
Analyze code complexity |
POST |
/api/analysis/centrality |
Calculate module centrality |
POST |
/api/analysis/expand |
Expand a unit (Layer 2+) |
POST |
/api/analysis/churn |
Get git modification heat |
GET |
/api/analysis/insights/:nodeId |
Get node-specific insights |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/graph/build |
Build global dependency graph |
POST |
/api/graph/get |
Retrieve cached graph |
GET |
/api/graph/analysis/cycles |
Find circular dependencies |
GET |
/api/graph/analysis/most-used |
Get most imported modules |
| Command | Description |
|---|---|
npm run dev |
Start both servers with hot reload |
npm run dev:client |
Start frontend only (port 5173) |
npm run dev:server |
Start backend only (port 5000) |
npm run build |
Build for production |
npm test |
Run all tests |
npm run test:coverage |
Generate coverage report |
π See Guides/Navigations/DEVELOPMENT.md for full development setup.
Frontend:
- React 18 + Vite
- TailwindCSS + Framer Motion
- React Force Graph 2D / Sigma.js
- Zustand (state management)
- Vitest + Testing Library
Backend:
- Node.js + Express
- simple-git (Git operations)
- glob (file scanning)
- Jest + Supertest
All documentation is organized in Guides/Navigations/ folder. Start with the INDEX.md for complete navigation.
| Document | Description |
|---|---|
| QUICK_START.md | Get up and running quickly |
| ARCHITECTURE.md | System architecture overview |
| TECHNICAL_ARCHITECTURE.md | Deep technical dive |
| SEMANTIC_LAYER_GUIDE.md | Semantic layer details |
| DEVELOPMENT.md | Development environment setup |
| INTEGRATION_CONTRACT.md | Public API contract |
| DEPLOYMENT_GUIDE.md | Deploy to Upstash + Render + Vercel |
| REDIS_INTEGRATION.md | Redis caching setup |
π View all guides β
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Write tests for your changes
- Ensure all tests pass (
npm test) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with React Force Graph
- Styled with TailwindCSS
- State managed by Zustand
- Git operations by simple-git
Made with β€οΈ for developers who think in graphs