How lablab-deepai/gitguard-ai works
Project type and purpose
• GitGuard-AI is a hybrid monorepo containing two major modules:
a. A full-stack “landing_page” (Next.js frontend + Python backend) that hosts a marketing/demo UI and exposes secret-detection APIs.
b. A “trae-plugin” Python package that integrates with the Trae IDE via a Modular Command Platform (MCP) to run secret-detection logic in developers’ editors or CI pipelines.
• Its core purpose is secret detection in codebases, with both a user-facing web demo and a programmatic IDE/CLI plugin.
File structure
• Top level:
• landing_page/ (separate frontend and backend subfolders)
• trae-plugin/ (gitguard core, MCP commands, utils, tests)
• docs/ (documentation)
• landing_page/frontend: Next.js app with React components, Tailwind, API routes under app/api.
• landing_page/backend: Python microservice (detector.py, main.py) defined in a pyproject.toml.
• trae-plugin/gitguard: Python package with MCP integration (create_mcp.py, secret_detection_script.py) and detection utils (llm_detect.py, regex_detector.py).
• tests cover plugin use cases.
README for additional insights
• Confirms two modules, points to module-level READMEs for details.
• Landing-page frontend uses v0.dev, backend provides detection endpoints.
• Trae-plugin implements IDE commands and secret detection algorithms; extensible via MCP.
a. Main components:
1. Web Frontend (Next.js React app)
2. Web Backend (Python FastAPI/Flask-style microservice)
3. Secret-Detection Core Library (Python utils in trae-plugin/gitguard/utils)
4. Trae IDE Plugin (MCP commands + scripts in trae-plugin/gitguard/mcp)
5. External Services: LLM provider (if configured), Version Control System (Git), Hosting platform (Vercel or similar)
6. Documentation module (docs/)
b. Component interactions:
• End user’s browser ↔ Frontend UI ↔ Next.js API routes ↔ Backend HTTP endpoints ↔ Detector logic ↔ Core utils ↔ Returns JSON results.
• Developer’s IDE ↔ Trae runtime ↔ Trae-plugin MCP command ↔ Secret-detection scripts ↔ Core utils ↔ Optionally invoke LLM API ↔ Show inline warnings.
• CI pipeline can invoke the same plugin or backend API for batch scanning.
c. Architectural patterns & principles:
• Monorepo with clear module boundaries (landing_page vs. plugin).
• Backend-for-frontend pattern: Next.js API routes forward requests to Python microservice.
• Plugin architecture via MCP for extensibility.
• Core detection logic is decoupled from transport layers.
d. Key technologies & frameworks:
• Next.js, React, Tailwind CSS, Vercel/v0.dev (frontend)
• Python (landing_page/backend + trae-plugin), MCP (Modular Command Platform), pytest (tests)
• LLM integration (in llm_detect.py) and regex-based detection