A powerful monorepo system containing an Architecture Governance Agent (AGA). It clones, analyzes, maps, and queries codebases using interactive graph-based visualizations and AI-assisted analysis.
AGA automatically maps codebase dependencies and structural elements into an interactive, layered architecture graph. It enables developers, architects, and product managers to interactively explore code paths, analyze the impact/blast-radius of changing specific files, and converse with an AI Oracle to understand complex architectural decisions.
- 🌐 Interactive Graph Visualization: Layered representation of UI components, API endpoints, middlewares, controllers, services, and databases using React Flow.
- 🤖 AI Oracle: Ask natural-language questions about codebase structure, auth mechanisms, and patterns, powered by IBM Bob / Granite or deterministic demo fallbacks.
- 💥 Blast Radius & Dependency Analysis: Calculate upstream/downstream impact when a given component changes.
- 🚀 Asynchronous Code Analysis: Background cloning and code parsing using Laravel Queue worker.
- 🐳 Dockerized Dev Environment: Multi-service Docker Compose setup running PostgreSQL, Next.js, and Laravel.
/
├── client/ # Next.js 16 (React 19) Frontend Application
│ ├── app/ # Dashboard views, dynamic routes (/repos/[name]), and proxy endpoints
│ ├── components/ # Shared layouts, visualizer panels, legend, and toolbar components
│ ├── hooks/ # Custom React hooks (useArchitectureData, useFlowInteractions, useDependencyAnalysis)
│ ├── lib/ # API clients and helpers
│ └── types/ # TypeScript type declarations
├── api/ # Laravel 11 Backend API Service
│ ├── app/ # Controllers (RepositoryController, OracleController) and Services (GitHubService, ParserService)
│ ├── config/ # Core service configurations
│ ├── database/ # Migrations and database schemas (repositories, nodes, edges, ai_cache)
│ ├── routes/ # Laravel API route definitions
│ └── storage/ # Cloned repositories and seed data (demo-architecture.json)
├── docs/ # Comprehensive design, architecture, and sprint documentation
├── scripts/ # Multi-platform environment setup tools (setup-env.sh, setup-env.bat)
├── docker-compose.yml # Dev environment orchestration
└── package.json # Monorepo workspaces definition (client, api)
- Docker and Docker Compose
- GitHub Personal Access Token (PAT) (for cloning repositories)
- IBM Bob API credentials (optional, demo mode fallback enabled by default)
-
Clone the repository and navigate to the project root:
git clone <repo-url> cd aga
-
Generate Environment Files: Run the setup script corresponding to your operating system to generate
.envfiles in root,api/, andclient/:- Windows (PowerShell/CMD):
scripts\setup-env.bat
- Linux / macOS:
chmod +x scripts/setup-env.sh ./scripts/setup-env.sh
- Windows (PowerShell/CMD):
-
Spin Up Containers:
docker-compose up -d
This spins up:
- PostgreSQL Database on port
5433 - Laravel API on port
8000 - Next.js Client on port
3000
- PostgreSQL Database on port
-
Install Backend Dependencies & Setup Database:
docker-compose exec api composer install docker-compose exec api php artisan key:generate docker-compose exec api php artisan migrate
-
Start Queue Worker (crucial for background repository scanning):
docker-compose exec api php artisan queue:work
- Navigate to the
apifolder and install packages:cd api composer install - Copy configuration and generate keys:
cp .env.example .env php artisan key:generate
- Set up your database and migration:
php artisan migrate
- Run the local development server:
php artisan serve --port=8000
- Navigate to the
clientfolder and install dependencies:cd client npm install - Set up your environment variables:
cp .env.example .env.local
- Launch development server:
npm run dev
| Variable | Description |
|---|---|
DB_DATABASE |
PostgreSQL database name |
DB_USERNAME |
Database user |
DB_PASSWORD |
Database password |
API_PORT |
Port exposed by Laravel service (Default: 8000) |
CLIENT_PORT |
Port exposed by Next.js service (Default: 3000) |
| Variable | Description |
|---|---|
GITHUB_TOKEN |
Your Personal Access Token (classic) with repo permission |
IBM_BOB_ENABLED |
Set true to enable real IBM Bob AI queries |
IBM_BOB_API_KEY |
IBM Bob model authentication key |
| Monorepo Command | Scope | Description |
|---|---|---|
npm run dev |
Frontend | Start client development build |
npm run build |
Frontend | Build production client bundle |
php artisan queue:work |
Backend | Start processing repo clone/parse background jobs |
php artisan test |
Backend | Run PHPUnit automated tests |
For deep dives into codebase mechanics, consult files within the docs/ and service subdirectories:
- 🏗️ System Architecture: docs/ARCHITECTURE_DIAGRAM.md
- 🎨 Visual Design Guide: docs/DESIGN.md
- 🔌 API Integration & Parsing: api/IMPLEMENTATION_GUIDE.md
- 🔑 Auth Flow Guide: docs/AUTHENTICATION_GUIDE.md
This project is licensed under the MIT License.