Skip to content
agrhubPublic

About

Codebase assistant powered by Google Agent, GitLab, GitHub MCP

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒŠ BaseFlow

BaseFlow is an advanced, interactive codebase visualization and AI-assisted software architect platform. It maps out complex code repositories as structured, interactive 2D mindmaps while integrating an autonomous AI assistant powered by Google Gemini API (using the Google ADK) to help developers inspect components, perform refactoring risk analysis, and orchestrate automated fixes.


โœจ Features

๐Ÿง  Core Capabilities

  • ๐Ÿ” Multi-Language AST Codebase Parser: Traverses files recursively to construct structural models using the official typescript compiler API for TypeScript/JavaScript/Vue, and regex-based parsers for Python, Java, and C#.
  • ๐Ÿ—บ๏ธ Interactive 2D Mindmaps: Renders classes, modules, inheritance (extends), interface implementations (implements), and dependency usages in a clean, hierarchical force-directed graph layout.
  • ๐Ÿค– Autonomous AI Architect Agent: Integrates Google's Agent Development Kit (@google/adk) with Gemini 3. The agent has 11 tools to inspect code, navigate the UI, highlight mindmap nodes, write files, and interact with DevOps platforms.
  • ๐Ÿ—๏ธ AI Architecture Diagrams: Auto-generates system architecture and class interaction diagrams using Mermaid.js.
  • ๐Ÿ“„ Document Q&A: Analyzes markdown documents in your repository and answers questions in context.

๐Ÿš€ New โ€” AI DevOps Intelligence (GitLab/GitHub Agent Platform)

GitLab Duo MCP integration โ€” connects to the official GitLab Duo MCP endpoint at https://gitlab.com/api/v4/mcp. See GitLab Duo MCP Integration for full setup instructions.

GitHub Copilot MCP integration โ€” connects to the official GitHub MCP endpoint at https://api.githubcopilot.com/mcp/. See GitHub Copilot MCP Integration for full setup instructions.

  • ๐Ÿ“Š DevOps Health Score: Computes a real-time score (0โ€“100) across open issues, MRs, and pipeline success rate. The AI agent produces a full narrative report with charts and prioritized recommendations.
  • ๐Ÿค– AI Issue Resolver & Auto-Create MR: Click any GitLab/GitHub issue โ†’ the agent reads it via MCP, finds relevant codebase classes, writes a structured fix playbook, and automatically creates a Merge Request with the fix.
  • ๐Ÿ› ๏ธ Gemini CLI Modified Files Navigator: Renders files modified by the Gemini CLI inside assistant chat bubbles as clickable links. Clicking a file link instantly navigates to and highlights the file in the Codebase Explorer.
  • ๐Ÿ“ฅ Interactive Code Review & Diff Viewer: Displays inline color-coded diff highlights comparing local workspace changes against Git HEAD (supporting both tracked and new untracked files) directly inside the codebase explorer view.
  • ๐Ÿ’พ Header Source Downloader: Quick download button in the CodeViewer header panel to retrieve any text-based code file directly.
  • ๐Ÿ” AI MR Code Review: BaseFlow fetches the MR diff via GitLab MCP and posts inline AI review comments directly to GitLab with a single click.
  • ๐Ÿ›ก๏ธ Codebase Security Audit: Scans your codebase structure for vulnerabilities. Risky components are instantly highlighted in RED on the interactive mindmap with warning shields.
  • ๐Ÿ” CI/CD Watchdog: Click any failed pipeline โ†’ the agent fetches the job log via gitlab_get_job_trace, cross-references it with your codebase, highlights affected classes on the mindmap, and generates root-cause analysis.
  • ๐Ÿ“ค Multi-Agent GitLab Duo AI Catalog & GitHub Copilot Integration: Formats any generated skill file as a Custom Agent system prompt and prepares it for publication to the GitLab Duo AI Catalog and GitHub Copilot.
  • ๐Ÿ“ˆ Real-Time Remote DevOps Metrics: Automatically fetches and caches (24h) live commit activity, stars, and forks from the GitHub/GitLab REST APIs to power the Dashboard Activity charts.
  • ๐Ÿ’ฌ Context-Aware Document Analysis: Chat directly with AI about any Markdown document or Playbook using the integrated "Ask Agent" feature with pre-generated contextual suggestions.

โš™๏ธ Platform

  • ๐Ÿ”— Dual MCP Integration: GitLab Duo MCP + GitHub MCP running concurrently in the same agent session.
  • ๐ŸŒ Modern Responsive UI: Vue 3, Vite, Element Plus โ€” Dark/Light mode, EN/VI localisation, SSE streaming. Optimized with markRaw for rendering massive codebase graphs without UI freezing.
  • ๐Ÿณ Docker + Cloud Run Ready: Single-container deployment to Google Cloud Run. See Cloud Run Deployment for full setup instructions.

๐Ÿ“ธ Screenshots & Visual Tour

๐Ÿ“Š Repository Dashboard & Overview

Compute live commit metrics, total class counts, language percentages, and Git activity trends. Repository Dashboard & Overview

๐Ÿ—บ๏ธ G6 Interactive Codebase Mindmap

Traverse package directory trees visually. Auto-focus node cameras and switch between Mindmap and Neural Map layouts. G6 Interactive Codebase Mindmap

๐Ÿ” Class Inspector & UML ERD Drawer

Single-click class nodes to inspect fields/methods or double-click to draw UML Entity-Relationship dialogues. Class Inspector & UML ERDs UML Entity-Relationship dialogues

๐Ÿ›ก๏ธ AI DevOps Workspace & Security Audits

Compute DevOps health indexes, generate onboarding guides, and run codebase security audits (vulnerability warning nodes highlighted in RED). AI DevOps Workspace Security Audit Mindmap highlights

๐Ÿ—๏ธ System Architecture Mermaid Diagrams

Deconstruct imports and module interaction maps automatically into zoomable, fullscreen Mermaid flowcharts. System Architecture Mermaid diagrams

๐Ÿ“„ AI Document Playbooks & Q&A

Read repository Markdown files, prompt agent Q&A chat drawers, and prepare skill playbooks for Copilot/Duo. AI Document Playbooks & Q&A

๐Ÿ’ป Sidebar Explorer & Selection Chat

Expand folder trees in the sidebar, view source code with line-highlighting, and select text to invoke SRE chat bubble. Sidebar Explorer & Selection Chat

๐Ÿค– Conversational Chatbot Assistant

Slide open the Gemini assistant sidebar to optimize classes, write test suites, or ask freeform queries. Conversational chatbot assistant


๐Ÿ—๏ธ Architecture & Technology Stack

BaseFlow runs as a unified containerized service hosting both backend API services and frontend assets.

graph TD
    subgraph Client [Browser - Vue 3 SPA]
        G6-Graph[Neural / Mindmap]
        Chat[ADK Agent Chat]
        Inspector[Class Inspector]
    end

    subgraph Container [Docker Container - Node 20 Server]
        Express[Express.js Server]
        SQLite[(SQLite DB - connections.db)]
        ADK[ADK Runner & Agent]
        AST[AST Engine - TS Compiler]
    end

    subgraph External [External APIs]
        Gemini[Google Gemini API]
        GitLab[GitLab API & MCP]
        GitHub[GitHub API & MCP]
    end

    Client -- HTTPS & SSE --> Express
    Express -- Connection Profile --> SQLite
    Express -- Parse Request --> AST
    ADK -- Tool Executions --> AST
    ADK -- Model Calls --> Gemini
    Express -- Webhooks / MCP --> GitLab
    Express -- Webhooks / MCP --> GitHub
    Express -- Serve Static Assets --> Client
Loading

๐Ÿ”ฎ 3D Visual Architecture Flow

BaseFlow 3D System Architecture

Components

  1. Backend (backend/):
    • Express: Exposes authentication, connection configurations, and repository details endpoints.
    • SQLite: Manages connection configurations inside an encrypted SQLite database using sqlite3 and sqlite.
    • AST Engine: Gathers structural metrics and maps components to custom mindmap coordinates.
    • ADK Agent: Orchestrates LLM actions using the @google/adk package (with MCP toolsets for GitHub/GitLab).
  2. Frontend (frontend/):
    • Vue 3 / Vite: Hot-reloadable single-page application framework.
    • Pinia: Core state engine managing active repositories, connection profiles, and authentication states.
    • Element Plus: Responsive UI library powering forms, layouts, drawers, and notifications.
    • G6 Graph : Graph visualization engine. It provides basic capabilities for graph visualization and analysis such as drawing, layout, analysis, interaction
  3. E2E Tests (tests/):
    • Automated user flows validated through headed Playwright scripts.

๐Ÿ› ๏ธ Local Development Setup

Prerequisites

  • Node.js (v20+ recommended)
  • Git installed and available in your environment path
  • Google Cloud Agent API Key (from Google Cloud Agent)

1. Backend Setup

  1. Navigate to the backend directory:
    cd backend
  2. Install dependencies:
    npm install
  3. Create a .env file inside the backend/ folder:
    PORT=5000
    PASSWORD=admin
    GOOGLE_API_KEY=your_google_agent_api_key_here
    AGENT_MODEL=gemini-3.1-flash-lite
    GOOGLE_GENAI_USE_VERTEXAI=1
  4. Run the server in development (hot-reload) mode:
    npm run dev
    The backend will start on http://localhost:5000.

2. Frontend Setup

  1. Navigate to the frontend directory:
    cd ../frontend
  2. Install dependencies:
    npm install
  3. Start the Vite dev server:
    npm run dev
    Open the browser at http://localhost:5173 to view the console.

๐Ÿงช Running Automated Tests

E2E UI flows are managed by Playwright inside the tests/ directory.

To run the automated tests locally:

  1. Ensure both your frontend (port 5173) and backend (port 5000) dev servers are running.
  2. Navigate to the tests directory:
    cd tests
  3. Install the testing dependencies:
    npm install
  4. Run the test suite:
    npm run test

This will launch a headed Chromium instance, log in with admin, create a connection profile, perform toggle interactions, and output test reports alongside page screenshots.


๐Ÿš€ Cloud Run Deployment

BaseFlow is optimized to deploy to Google Cloud Run in a single consolidated container.

Prerequisites

  1. Installed Google Cloud SDK (gcloud CLI).
  2. Authenticated account:
    gcloud auth login
  3. An active GCP Project ID with Billing, Cloud Run API, and Cloud Build API enabled.

Deploying

Open the deploy script matching your operating system inside the project root:

The deployment script executes a remote container build via Cloud Build utilizing the multi-stage Dockerfile and registers the service at port 5000.

Important

Once deployed, configure the Environment Variables in the Google Cloud Run panel for GOOGLE_API_KEY, PASSWORD, and AGENT_MODEL to enable the AI Architect features.

๐Ÿ‘ค Developer

๐Ÿ‘ค Supporter


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Codebase assistant powered by Google Agent, GitLab, GitHub MCP

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages