Skip to content

hsperker/fastapi-container-app-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Container App Starter

A production-ready template for building and deploying FastAPI services in containers.

Overview

This project provides a complete starter template for developing FastAPI applications with modern Python tooling. It's designed to help you quickly bootstrap new API services with best practices already in place.

Features

  • FastAPI - High-performance web framework for building APIs
  • Clean Architecture - Organized project structure with separation of concerns
  • Type Safety - Fully typed Python codebase with MyPy integration
  • Testing - Pytest setup with sample unit and integration tests
  • Modern Python Tooling - Uses uv for faster package management and virtual environments
  • Development Mode - Hot reloading support for rapid development
  • Production-Ready - Container-optimized setup for deployment

Getting Started

Prerequisites

  • Python 3.11
  • uv

Setup

  1. Clone this repository or use it as a template:

    git clone https://github.com/hsperker/fastapi-container-app-starter.git
    cd fastapi-container-app-starter
  2. Run type checking to verify code quality:

    uv run mypy app tests

    Note: This command will automatically create a virtual environment and install the necessary dependencies.

  3. Run tests to ensure everything is working properly:

    uv run pytest
  4. Start the development server:

    uv run fastapi dev

Project Structure

app/
├── __init__.py
├── main.py
├── api/             # API routes and schemas
├── core/            # Core business logic
└── infrastructure/  # Repositories

tests/
├── core/            # Unit tests for core functionality
└── integration/     # Integration tests

API Documentation

When running the server, API documentation is automatically generated:

About

A production-ready template for building and deploying FastAPI services in containers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages