Skip to content

monarchmaisuriya/fastapi-bootstrapped

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Bootstrapped

A production-ready FastAPI project template with best practices for rapid development.

Features

  • 🚀 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)

Project Structure

├── 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

Getting Started

Prerequisites

  • Python 3.10 or higher
  • PDM package manager
  • PostgreSQL

Installation

  1. Clone the repository:
git clone https://github.com/monarchmaisuriya/fastapi-bootstrapped.git
cd fastapi-bootstrapped
  1. Setup and install dependencies:
pdm venv create 3.10
pdm use -f .venv
pdm install
  1. Set up environment variables:
cp example.env .env
# Edit .env with your configuration
  1. Run database migrations:
pdm run alembic upgrade head
  1. Start the development server:
pdm run dev

The API will be available at http://localhost:8080

API Documentation

Once the server is running, you can access:

  • Swagger UI: http://localhost:8080/docs
  • ReDoc: http://localhost:8080/redoc

Development

Creating New Migrations

pdm run alembic revision -m "your migration description"

Running Tests

pdm run test

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A modern starter kit for a FastAPI server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors