Professional FastAPI service for intelligent AI-powered code analysis. Delivers automated code reviews, refactoring suggestions, and quality improvements for Python, JavaScript, TypeScript, Java, and more. Built on Groq LLM with production-ready Docker setup, Redis caching, and Prometheus monitoring. 21+ tests, clean architecture, fully deployment-ready.
- 🔍 Intelligent Code Review - AI-powered analysis with severity ratings and line-specific issues
- 🔧 Automated Refactoring - Smart suggestions for code improvements
- ⚡ Combined Operations - Review and refactor code in one request
- 🌐 Multi-Language - Python, JavaScript, TypeScript, Java, C++, Go, Rust, Ruby, PHP, and more
- 🚀 Production Ready - Docker multi-stage builds, health checks, non-root user
- 🔄 Hot Reload - Development environment with live code updates
- 📊 Comprehensive Tests - 21+ passing tests with coverage reporting
- 🔐 Secure - HTTPS/SSL support, rate limiting, input validation
- Python 3.11+ or Docker
- Groq API key (get here)
# Clone and setup
git clone https://github.com/ituvtu/codeshaper.git
cd codeshaper
poetry install
# Configure
cp .env.example .env
# Edit .env with your Groq API key
# Run
poetry run uvicorn app.main:app --reloadVisit: http://localhost:8000/docs
# Development with hot reload
docker-compose -f deployment/docker-compose.dev.yml up
# Production full stack
docker-compose -f deployment/docker-compose.prod.yml up -dGET /healthPOST /api/v1/review
Content-Type: multipart/form-data
Parameters:
- file: Code file to review
- language: Programming language (auto-detected)POST /api/v1/refactor
Content-Type: multipart/form-data
Parameters:
- file: Code file to refactor
- language: Programming language (auto-detected)POST /api/v1/review-and-refactor
Content-Type: multipart/form-data
Parameters:
- file: Code file
- language: Programming language (auto-detected)Full examples and response formats: docs/DEPLOYMENT.md
Environment variables in .env:
API_KEY=your_groq_api_key_here # Required
MODEL=llama-3.1-8b-instant # LLM model
REDIS_URL=redis://localhost:6379 # Cache (optional)
POSTGRES_URL=postgresql://... # Database (optional)
PORT=8000
LOG_LEVEL=infoSee deployment/.env.example for all options.
# Tests
poetry run pytest tests/ -v
# Code quality
make lint # Linting checks
make format # Format code
make test-cov # Tests with coverage
# All commands
make helpcodeshaper/
├── app/ # Application code
│ ├── api/routes.py # API endpoints
│ ├── services/ # Business logic & LLM client
│ └── static/index.html # Web UI
├── tests/test_api.py # 21+ comprehensive tests
├── deployment/ # Docker & configs
│ ├── docker-compose.*.yml
│ ├── nginx.conf
│ └── prometheus.yml
├── docs/ # Full documentation
├── Dockerfile # Multi-stage build
└── pyproject.toml # Dependencies
Automated testing and quality checks on every push:
- ✅ Test matrix: Python 3.11, 3.12, 3.13
- ✅ Linting: Ruff, Mypy, Black
- ✅ Coverage reports
- 🐳 Docker build validation
- 📊 Code quality metrics
View workflows: .github/workflows/
- 📖 Deployment Guide - Local, Docker, and production setup
- 🏗️ Architecture Guide - System design and technical details
- ⚙️ CI/CD Guide - GitHub Actions workflows
- ✅ Non-root container user
- ✅ HTTPS/SSL ready
- ✅ Rate limiting per IP
- ✅ Input validation
- ✅ CORS protection
- ✅ Environment variable validation
- Fork the repository
- Create feature branch (
git checkout -b feature/improvement) - Make changes and test
- Push and open Pull Request
All contributions must pass CI/CD checks (tests, linting, coverage).
MIT License - see LICENSE file for details
- 🐛 Issue Tracker
- 💬 Discussions
- 📧 Questions? Open an issue on GitHub