🚀 FastAPI Quickstart is a package designed to streamline FastAPI development. It includes database management with SQLModel, Alembic migrations, and a powerful CLI for automating common tasks.
- Pre-configured FastAPI setup with SQLModel
- Async database support for PostgreSQL & SQLite
- Built-in CRUD base for repository-style development
- Alembic migration CLI for managing database migrations
- CLI commands for scaffolding models, migrations, and more
- Fully configurable via environment variables
uv pip install fastapi-quickstart# For SQLite support
uv add fastapi-quickstart[sqlite]
# For PostgreSQL (asyncpg) support
uv add fastapi-quickstart[postgres]uv init myproject
cd myprojectRename .env.example.postgres or .env.example.sqlite to .env, then update it with your database credentials.
Example .env file for PostgreSQL:
DB_TYPE=postgres
DB_USER=myuser
DB_PASSWORD=mypassword
DB_HOST=localhost
DB_NAME=mydatabase
POOL_SIZE=20
MAX_OVERFLOW=64
DB_ECHO=True
fastapi-quickstart migrate init
fastapi-quickstart migrate revision "Initial migration"
fastapi-quickstart migrate upgradefastapi dev path/to/main.pyFastAPI Quickstart automatically detects your database type based on the .env file and configures the connection accordingly.
Supported Databases:
- ✅ PostgreSQL (
postgresql+asyncpg://...) - ✅ SQLite (
sqlite+aiosqlite://...)
The ASYNC_DATABASE_URI is automatically generated based on .env settings:
from fastapi_quickstart.core.config import settings
print(settings.ASYNC_DATABASE_URI) # Outputs the full database URLfastapi-quickstart migrate initfastapi-quickstart migrate revision "Added users table"fastapi-quickstart migrate upgradefastapi-quickstart migrate downgradeThe FastAPI Quickstart CLI provides an easy way to manage your project.
fastapi-quickstart --help| Command | Description |
|---|---|
init |
Create a new FastAPI project |
migrate init |
Initialize Alembic migrations |
migrate revision "message" |
Generate a new migration script |
migrate upgrade |
Apply all pending migrations |
migrate downgrade |
Revert last migration |
pytest tests/ruff check .
ruff formatContributions are welcome! Feel free to open an issue or pull request.
git clone https://github.com/ElderEvil/fastapi-quickstart.git
cd fastapi-quickstart
uv sync -e .[dev]pytestMIT License © 2025 FastAPI Quickstart
If you like this project, please ⭐️ it on GitHub!