Skip to content

Repository files navigation

FastAPI ORM Template (Cookiecutter)

This is a cookiecutter template for FastAPI with ORM (SQLAlchemy) projects.

Features

  • Cookiecutter
  • FastAPI
  • REST API
  • Web service
  • Microservice
  • ORM (SQLAlchemy)
  • SQL databases (RDB)
  • Database migrations (Alembic)
  • PostgreSQL
  • Project structure
  • Boilerplate/Template
  • Best practices
  • Configuration
  • Tests
  • Build
  • Scripts
  • Examples
  • Documentation
  • CI/CD
  • Docker and docker compose

🐤 Getting started

1. 🚧 Prerequisites

For DEVELOPMENT environment:

2. 📥 Download or clone the repository

# Create projects directory:
mkdir -pv ~/workspaces/projects
# Enter into projects directory:cd~/workspaces/projects
# Clone the repository:
git clone [REPOSITORY_URL]
# Or download and extract the repository from GitHub:# 1. Go to the repository on GitHub.# 2. Click on the "Code" button.# 3. Select "Download ZIP" and save the file to your computer.# 4. Extract the ZIP file in current directory.# Enter into the repository:cd rest-fastapi-orm-template
# Change to cookiecutter branch:
git checkout cookiecutter

3. 📦 Install cookiecutter

# Install cookiecutter:
pip install -r ./requirements.txt
# Install pre-commit hooks:
pre-commit install

4. 🏗️ Generate project with cookiecutter

# Generate project:
cookiecutter -f .# Or:
./scripts/build.sh

5. 🏁 Start the project

cd [PROJECT_NAME]
# Start:
./compose.sh start -l
# Stop:
./compose.sh stop

👍

📑 References

Releases

Contributors

Languages