Skip to content

Lordbeatus/Toasty-Analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ToastyAnalytics

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.

πŸš€ Quick Start

# 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

✨ Feature Highlights

πŸ” Security & Performance

  • 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

🧠 Advanced AI Features

  • 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

πŸ—οΈ Enterprise Architecture

  • 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

πŸ“Š Observability

  • Distributed Tracing: End-to-end request tracking
  • Metrics: Prometheus + Grafana dashboards
  • Structured Logging: JSON logs with Sentry integration
  • Health Checks: Readiness/liveness probes

πŸ“– Documentation

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              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    β”‚ β”‚      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”˜

πŸ”§ API Examples

Grade Code

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())

WebSocket Events

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())

πŸ“¦ Project Structure

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)

πŸ§ͺ Testing

# Run unit tests
pytest tests/

# Test WebSocket connection
python tests/integration/test_websocket.py

# Test full grading pipeline
python tests/integration/test_v2.py

πŸ”Œ Services

The 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

πŸ› οΈ Development

# Install dependencies
pip install -r requirements-prod.txt

# Run locally (without Docker)
uvicorn server_v2:app --reload

# Run tests with coverage
pytest --cov=. tests/

πŸ“Š Monitoring

🀝 Contributing

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

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

πŸ™ Acknowledgments

  • Built with ❀️ for vibecoding and AI agent self-improvement
  • Thanks to all contributors who help improve ToastyAnalytics

πŸ“§ Contact & Support

⭐ Show Your Support

If you find this project useful, please consider giving it a star on GitHub!

🎯 Roadmap

  • 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

About

A comprehensive framework for grading and enabling self-improvement in AI agents through multi-dimensional evaluation.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors