AI-powered backend analysis & generator tool - Not just another chatbot. A professional backend audit system with rule-based validation and AI-powered insights.
Traditional AI coding assistants generate code without understanding backend architecture. This tool analyzes first, suggests second - providing professional-grade insights that make tech leads raise their eyebrows (in a good way).
✅ Rule-based first, AI second - No hallucinations, just facts
✅ Structured output only - No free-form text, always JSON schemas
✅ Context-aware analysis - Understands your backend patterns
✅ Gradual enhancement - AI only when rules are insufficient
- OpenAPI Spec Generator - From code to professional API documentation
- Controller Analyzer - Complexity, duplication, and validation insights
- Auth/RBAC Flow Validator - Security gap detection
- Rule-based Pre-check - Syntax & schema validation before AI
- GitHub/GitLab integration
- Performance profiling suggestions
- Database query analysis
- Rate limiting recommendations
- Multi-language support (Go, Python, Java)
- Auto-test generation
- Architecture pattern suggestions
- Compliance checks (GDPR, PCI-DSS, HIPAA)
- Runtime: Node.js 18+
- Framework: Fastify (Modern, fast, TypeScript-friendly)
- Validation: Zod (Schema-first validation)
- AI/LLM: OpenAI GPT-4 / Local LLM options
- Code Analysis: TypeScript AST Parser
- API Docs: Fastify Swagger + Swagger UI
# Clone the repository
git clone https://github.com/yourusername/backend-copilot-ai.git
cd backend-copilot-ai
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Add your OpenAI API key to .env
# Start development server
npm run dev- Analyze Your Controller
curl -X POST http://localhost:3000/api/analyze/controller \
-H "Content-Type: application/json" \
-d '{
"code": "app.post(\"/api/users\", async (req, res) => { const user = req.body; db.save(user); res.json(user); })"
}'- Generate OpenAPI Spec
curl -X POST http://localhost:3000/api/generate/openapi \
-H "Content-Type: application/json" \
-d '{
"code": "app.get(\"/api/users/:id\", authMiddleware, getUser)"
}'- Check Health
curl http://localhost:3000/health{
"complexity": {
"score": 45,
"level": "HIGH",
"issues": ["nested_callbacks", "long_function", "missing_validation"]
},
"security_risk": "MEDIUM",
"suggestions": [
"Extract validation to middleware",
"Add error handling for database calls",
"Implement rate limiting"
]
}backend-copilot-ai/
├── src/
│ ├── analyzers/ # Code analysis modules
│ ├── generators/ # OpenAPI/documentation generators
│ ├── rules/ # Rule-based validators (FIRST!)
│ ├── ai/ # LLM integration with guardrails
│ ├── routes/ # API endpoints
│ └── utils/ # Shared utilities
├── schemas/ # Zod validation schemas
├── tests/ # Test suites
└── docs/ # Documentation# Development mode (hot reload)
npm run dev
# Build for production
npm run build
# Run tests
npm test
# Run tests with watch
npm run test:watch
# Lint code
npm run lint
# Format code
npm run formatCreate .env file:
NODE_ENV=development
PORT=3000
OPENAI_API_KEY=your_key_here # Optional for v1-
Basic syntax checking
-
OpenAPI generation
-
Controller analysis
-
Auth flow validation
-
Rule engine completion
-
GitHub integration
-
Test generation
-
Performance insights
-
Database query analysis
-
Multi-language support
-
Team collaboration features
-
Compliance reporting
-
Plugin system
-
No code execution - only static analysis
-
API keys stored locally
-
All AI calls are opt-in
-
Rule-based validation prevents harmful suggestions
This project is licensed under the terms of the LICENSE.
Made with ❤️ for backend developers who care about quality
This is not just another AI tool - it's your backend architect assistant.