Enterprise AI-Powered Code Grading Engine with Advanced Microservices Architecture
ToastyAnalytics is a production-ready code analysis and grading system that uses meta-learning to continuously improve its assessment accuracy. Features include JWT authentication, rate limiting, distributed tracing, neural network graders, and full microservices support.
# Clone repository
git clone https://github.com/Lordbeatus/Toasty-Analytics.git
cd Toasty-Analytics
# Install dependencies
pip install -r requirements.txt
# Start infrastructure (databases, Redis, Jaeger)
cd deployment/docker
docker-compose -f docker-compose.split-db.yml up -d
# Run server
cd ../..
uvicorn src.server_v2:app --reload
# API available at: http://localhost:8000/docs
# Jaeger UI at: http://localhost:16686- JWT Authentication: Token-based API security with RBAC
- Rate Limiting: Redis-based request throttling (tiered limits)
- Distributed Tracing: OpenTelemetry with Jaeger/Zipkin
- API Keys: Service-to-service authentication
- Neural Network Graders: CodeBERT-based ML grading
- Meta-Learning: Adaptive thresholds from user feedback
- Federated Learning: Privacy-preserving distributed training
- Custom Plugins: Python & YAML-based extensibility
- Microservices: 4 independent services + API gateway
- Service Mesh: Istio with canary deployments & circuit breaking
- Database Splitting: Per-service PostgreSQL databases
- Event Streaming: Kafka/RabbitMQ integration
- GraphQL API: Flexible queries alongside REST
- Distributed Tracing: End-to-end request tracking
- Metrics: Prometheus + Grafana dashboards
- Structured Logging: JSON logs with Sentry integration
- Health Checks: Readiness/liveness probes
- Complete Documentation - System overview, features, and tech stack
- Deployment Guide - Production deployment for all platforms
- Architecture Reference - Technical architecture details
- Quick Commands - Quick reference for development
- Code Examples - Usage examples and patterns
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API Gateway (JWT + Rate Limiting) β
β http://localhost:8080 β
ββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββ
β (Distributed Tracing)
ββββββββββΌβββββββββ¬βββββββββββββ¬βββββββββββββ
β β β β β
βββββΌβββ ββββΌββββ ββββΌβββββββ ββββΌβββββββββ βββΌβββββ
βUser β βGrade β βMeta-Lrn β βAnalytics β βEventsβ
βSvc β βSvc β βSvc β βSvc β βBrokerβ
ββββ¬ββββ ββββ¬ββββ βββββ¬ββββββ βββββ¬βββββββ ββββ¬ββββ
β β β β β
ββββΌβββββ ββΌββββββ βββΌβββββ ββββββΌββββ βββββΌβββ
βUser DBβ βGrade β βMeta β βAnalyticsβ βKafka β
β:5433 β βDB β βDB β βDB β β/RMQ β
β β β:5434 β β:5435 β β:5436 β β β
βββββββββ ββββββββ ββββββββ βββββββββββ ββββββββ
import requests
response = requests.post("http://localhost:8000/grade", json={
"code": "def hello(): print('Hello')",
"language": "python",
"user_id": "user-123",
"dimensions": ["code_quality", "reliability"]
})
print(response.json())import asyncio
import websockets
async def listen():
async with websockets.connect("ws://localhost:8000/ws/user-123") as ws:
async for message in ws:
print(f"Event: {message}")
asyncio.run(listen())toastyanalytics/
βββ core/ # Base graders and types
βββ graders/ # Dimension-specific graders
βββ meta_learning/ # Self-improvement engine
βββ database/ # ORM models
βββ mcp_server/ # MCP protocol server
βββ scripts/ # Utility scripts
βββ tests/ # Test suite
β βββ integration/ # Integration tests
βββ docs/ # Documentation
βββ servers/ # Server implementations
βββ server_v2.py # Production server (v2)
# Run unit tests
pytest tests/
# Test WebSocket connection
python tests/integration/test_websocket.py
# Test full grading pipeline
python tests/integration/test_v2.pyThe Docker Compose stack includes:
| Service | Port | Description |
|---|---|---|
| API | 8000 | FastAPI application |
| PostgreSQL | 5432 | Database |
| Redis | 6379 | Cache layer |
| Prometheus | 9090 | Metrics collection |
| Grafana | 3000 | Dashboards (admin/admin) |
| Worker | - | Celery background tasks |
| Beat | - | Celery scheduler |
# Install dependencies
pip install -r requirements-prod.txt
# Run locally (without Docker)
uvicorn server_v2:app --reload
# Run tests with coverage
pytest --cov=. tests/- Prometheus: http://localhost:9090
- Grafana: http://localhost:3000 (login: admin/admin)
- API Metrics: http://localhost:8000/metrics
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with β€οΈ for vibecoding and AI agent self-improvement
- Thanks to all contributors who help improve ToastyAnalytics
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: docs/
If you find this project useful, please consider giving it a star on GitHub!
- Multi-dimensional grading
- Meta-learning engine
- WebSocket support
- Event-driven architecture
- Neural network graders
- GraphQL API
- Kafka integration
- Federated learning
- VS Code extension
- Efficiency enhancements and improved model
Built with β€οΈ for vibecoding and AI agent self-improvement