A FastAPI-based web API with a complete development environment setup.
- FastAPI framework with automatic API documentation
- Pydantic models for data validation
- Comprehensive testing with pytest
- Code formatting with Ruff
- Type checking with MyPy
- Pre-commit hooks for code quality
- Development server with hot reload
# Using the shell script
./dev.sh setup
# Or using Make
make setup
# Or using Python script
python scripts/dev.py setup# Using the shell script
./dev.sh dev
# Or using Make
make dev
# Or using Python script
python scripts/dev.py devThe API will be available at:
- Server: http://localhost:8000
- Interactive API docs: http://localhost:8000/docs
- ReDoc documentation: http://localhost:8000/redoc
make help # Show available commands
make setup # Install dependencies and set up pre-commit hooks
make dev # Start development server with hot reload
make test # Run tests
make test-watch # Run tests in watch mode
make lint # Run linting
make format # Format code
make type-check # Run type checking
make check # Run all checks (lint, format, type-check)
make clean # Clean cache and temporary files
make install # Install dependenciesmy-api/
├── src/
│ └── main.py # FastAPI application
├── tests/
│ ├── __init__.py
│ └── test_main.py # Test cases
├── .pre-commit-config.yaml # Pre-commit hooks configuration
├── Makefile # Make commands
├── pyproject.toml # Project configuration
└── README.md # This file
This project uses several tools to maintain code quality:
- Ruff: Fast Python linter and formatter
- MyPy: Static type checker
- pytest: Testing framework
- pre-commit: Git hooks for code quality
All tools are configured in pyproject.toml and run automatically via pre-commit hooks.
Run tests with:
make testTests are located in the tests/ directory and use pytest with FastAPI's test client.
- Python 3.13+
- uv (Python package manager)