FastAPI Server Kit
A production-grade FastAPI template and toolkit with support for PostgreSQL (Sync/Async), SQLite (Async), and MySQL (Async). Built for speed, scalability, and clean architecture.
Features
- Multi-Database Support: Easily switch between SQLite, PostgreSQL, and MySQL.
- SQLAlchemy 2.0 (Async): Modern ORM patterns with centralized session management.
- Clean Architecture: Organized into Core, Models, Repositories, Services, and Routers.
- Alembic Migrations: Ready-to-use async migration setup.
- Environment Management: Robust configuration using
pydantic-settings.
Installation & Quick Start
The easiest way to start a new project is to use uvx. No installation or pre-existing project is required.
# In an empty directory, run:
uvx fastapi-server-kit@latest
This single command will trigger an interactive setup:
- Project Name: Choose your own folder name.
- Database Selection: Choose between SQLite, PostgreSQL, or MySQL.
- Auto-Initialization: The tool runs
uv syncto set up your.venv. - Instant Start: The FastAPI server launches immediately.
CLI Flags (Automation)
For non-interactive use or CI/CD:
uvx fastapi-server-kit@latest my-app --db postgres --no-input
Alternative Installation
If you want to add the kit as a dependency to an existing project:
uv add fastapi-server-kit@latest
Manual Setup
If you prefer to clone the repository or use it as a template:
git clone https://github.com/atnatewoshw/fastapi-starter-template
cd fastapi-starter-template
2. Configure Environment
Create and configure your .env file from .env_example:
cp .env_example .env
3. Install Dependencies
uv sync
4. Running Locally
uv run uvicorn app.main:app --reload
Project Structure
The kit follows a clean, modular directory layout:
fastapi-starter-template/
├── fastapi_server_kit/ # Packaged CLI + templates
├── app/ # FastAPI application
│ ├── core/ # Configuration and security
│ ├── models/ # SQLAlchemy models
│ ├── repositories/ # Data access layer
│ ├── routers/ # API endpoints
│ ├── schemas/ # Pydantic models
│ └── services/ # Business logic
├── tests/ # Unit and integration tests
├── pyproject.toml # Project dependencies
└── README.md
Database Migrations
Initialize your database:
uv run alembic upgrade head
Create a new migration:
uv run alembic revision --autogenerate -m "description"
License
This project is licensed under the MIT License.
Metadata
Release files for fastapi-server-kit 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fastapi_server_kit-0.2.3.tar.gz | 86.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastapi_server_kit-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 97.7 kB
Release files / fastapi_server_kit-0.2.3.tar.gz
| Download URL | fastapi_server_kit-0.2.3.tar.gz |
|---|---|
| Size | 86.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2875123e61f4e3b7119f1fa937a075813d857f021f7c631d5356cc0572e3b853
|
|
BLAKE2b-256 checksum How to use checksums |
e0baf2f8d6f52d3feff3b2f92ddc86ec068d3d901083040c6755b347dbdd4984
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / fastapi_server_kit-0.2.3-py3-none-any.whl
| Download URL | fastapi_server_kit-0.2.3-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3572c8f815cdd085b852af98c845c3a70c3dfccf591fbdab2ff955d90ceb87f1
|
|
BLAKE2b-256 checksum How to use checksums |
88c8beb939cccdb17969371a35579f2b7eb4b1e9f39bc5937f32c8f50c5b48a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for fastapi-server-kit 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.