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 keeps the monorepo split between client/ for Next.js UI code and api/ for Laravel backend code. Frontend route files remain in client/app, feature-owned frontend logic lives in client/features, shared UI remains in client/components, and shared TypeScript types live in client/types.
Backend controllers are grouped by responsibility under api/app/Http/Controllers, validation lives in api/app/Http/Requests, single-purpose business flows live in api/app/Actions, domain services live in api/app/Services, and database/queue/scanner/AI logic stays backend-owned under api/.
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.