Skip to content

jdengoh/FastAPI-Template

Repository files navigation

FastAPI-Template

A FastAPI template for my experimental learning

Python FastAPI Docker uv

Table of Contents

Overview

TODO: Overview

Features

TODO: Features

Project Structure

Folder Structure

app/
  api/            # FastAPI routers and endpoints
  core/           # Core config, environment, logging
  database/       # Database models and enums
  schemas/        # Global schemas for API and cross-agent use
  services/       # Service layer (agent orchestration, auth, etc.)
  config/         # Logging and app config
scripts/          # Startup and utility scripts
Dockerfile        # Docker build
README.md         # Its THE readme you are reading!

Getting Started

Prerequisites

Backend Setup

Create a Virtual Environment

This project uses uv as the Python package and project manager.

Create the venv:

uv venv

Activate the venv.

On macOS or Linux, run:

source .venv/bin/activate

On Windows, run:

.venv/Scripts/activate

Install project dependencies:

uv sync

Running backend with Script

On macOS or Linux, run:

./scripts/start.sh

On Windows, run:

./scripts/start.ps1

Running backend with Docker

NOTE: docker only runs for the backend, frontend has to be ran separately

On macOS or Linux, run:

./scripts/start_docker.sh

On Windows, run:

./scripts/start_docker.ps1

Running with Uvicorn

Run the following command to run the app with Uvicorn:

uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload

Environment Variables

Backend environemtn variables: Copy .env.example to .env in the project root and fill in all required fields:

FRONTEND_HOST=http://localhost:3000
BACKEND_CORS_ORIGINS=http://localhost:8000
  • Replace your-key with your actual API keys.
  • These variables are required for both backend and frontend integration.
  • Never commit your real .env file to version control.

API Endpoints

Endpoint Method Description

Development

TODO: Development Notes

Contributors

TODO: List contributors

License

MIT

About

A FastAPI template for my experimental learning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published