case
Generated by ProggerAI - Automated AI code generation platform
- Framework: FastAPI 0.104.1
- Python: 3.11+
- Database: PostgreSQL 15
- Container: Docker + Docker Compose
- Testing: pytest
case/
├── main.py # FastAPI application entry point
├── requirements.txt # Python dependencies
├── Dockerfile # Container definition
├── docker-compose.yml # Multi-container orchestration
├── .env.example # Environment variable template
├── .env # Local environment (create from .env.example)
├── tests/ # Test suite
│ └── test_main.py # Main test file
└── README.md # This file
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment:
cp .env.example .env # Edit .env with your configuration -
Run the application:
python main.py
-
Access the API:
- API: http://localhost:8000
- Interactive docs: http://localhost:8000/docs
- Health check: http://localhost:8000/health
-
Start all services:
docker-compose up -d
-
View logs:
docker-compose logs -f api
-
Stop services:
docker-compose down
# Run all tests
pytest
# Run with coverage
pytest --cov=. --cov-report=html
# Run specific test
pytest tests/test_main.py::test_health_checkGET /- API informationGET /health- Health check endpointGET /docs- Interactive API documentation (Swagger UI)GET /redoc- Alternative API documentation (ReDoc)
See .env.example for all available configuration options.
Required variables:
DATABASE_URL- PostgreSQL connection stringSECRET_KEY- Application secret key
- Define Pydantic models in the data models section
- Add route handlers with proper type hints
- Document with docstrings and OpenAPI tags
- Add tests in
tests/test_main.py
(Add Alembic migration instructions when you add database models)
- Set
ENVIRONMENT=productionin.env - Set
DEBUG=False - Configure proper
SECRET_KEY - Use production-grade database
- Configure CORS appropriately
- Set up SSL/TLS
- Configure logging and monitoring
This project was generated by ProggerAI's autonomous AI agents. The code follows industry best practices and includes:
- ✅ RESTful API design
- ✅ OpenAPI documentation
- ✅ Type hints and validation
- ✅ Error handling
- ✅ Health checks
- ✅ Docker support
- ✅ Test suite
- ✅ Environment configuration
[Add your license here]