Skip to main content

A production-grade FastAPI template with support for PostgreSQL, SQLite, and MySQL.

Project description

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

You can install fastapi-server-kit using uv (recommended) or pip:

uv add fastapi-server-kit
# or
pip install fastapi-server-kit

🛠️ Quick Start (CLI)

The easiest way to start a new project is to use the built-in CLI tool:

# Initialize a new server folder in your current directory
fastapi-server-kit

This will create a server/ directory with the complete production-ready structure.

🛠️ 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/server

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 fastapi_server_kit.server.app.main:app --reload

📂 Project Structure

The kit follows a structured directory layout within the server package:

fastapi_server_kit/
└── server/
    └── app/
        ├── core/          # Configuration and security
        ├── models/        # SQLAlchemy models
        ├── repositories/  # Data access layer
        ├── routers/       # API endpoints
        ├── schemas/       # Pydantic models
        └── services/      # Business logic

🗄️ 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_server_kit-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_server_kit-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_server_kit-0.1.0.tar.gz.

File metadata

  • Download URL: fastapi_server_kit-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for fastapi_server_kit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 62324af9dc2ff822ca58a729fadc90df25f8e63598ba300dd14343d5fa77c487
MD5 9867cf1097c0a34eb3f5a37b81224a43
BLAKE2b-256 1864a26e98cfc7649c426e095af31c77604ad52a65c6586a567600bf8cfecefb

See more details on using hashes here.

File details

Details for the file fastapi_server_kit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fastapi_server_kit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for fastapi_server_kit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0aae7aaa19622ac2ae7bee15eeea0a40cdf1097d8e5bc23f322993c78b4bb162
MD5 82db42f1bf03835715f0742dccfd71f4
BLAKE2b-256 79b1fcbda9207f5d9571fcc3a2bed711e14b99c0babdbc1741bd4ee409d94572

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page