A production-ready FastAPI project template with best practices for rapid development.
- 🚀 FastAPI for high-performance API development
- 🔐 User authentication and authorization
- 📦 SQLAlchemy, SQLModel, and Alembic for database management
- 🎯 Repository pattern for clean architecture
- 🛠️ PDM for dependency management
- 📝 Logging setup with proper error handling
- 🔍 API versioning
- 🧪 Testing setup (ready for your tests)
├── migrations/ # Database migrations
├── scripts/ # Utility scripts
├── src/ # Source code
│ ├── api/ # API routes, endpoints and business logic
│ ├── base/ # Base classes and interfaces
│ ├── core/ # Core configurations
│ ├── helpers/ # Helper utilities
│ ├── models/ # Database models
│ └── repositories/ # Data layer and business logic
└── tests/ # Test files
- Python 3.10 or higher
- PDM package manager
- PostgreSQL
- Clone the repository:
git clone https://github.com/monarchmaisuriya/fastapi-bootstrapped.git
cd fastapi-bootstrapped- Setup and install dependencies:
pdm venv create 3.10
pdm use -f .venv
pdm install- Set up environment variables:
cp example.env .env
# Edit .env with your configuration- Run database migrations:
pdm run alembic upgrade head- Start the development server:
pdm run devThe API will be available at http://localhost:8080
Once the server is running, you can access:
- Swagger UI:
http://localhost:8080/docs - ReDoc:
http://localhost:8080/redoc
pdm run alembic revision -m "your migration description"pdm run testThis project is licensed under the MIT License - see the LICENSE file for details.