Skip to content

Latest commit

 

History

History
80 lines (51 loc) · 1.68 KB

File metadata and controls

80 lines (51 loc) · 1.68 KB

FastAPI uv Template

A FastAPI project template powered by Copier and uv.

Requirements

To use this Copier template, you will need:

  • Git v2
  • Python 3
  • Copier

To install Git version 2, follow the official instructions.

To install Python 3, download and install it from the official website, or install it with uv:

curl -LsSf https://astral.sh/uv/install.sh | sh
uv python install 3.12

To install Copier, use uv or pipx:

uv tool install copier --with copier-templates-extensions

Or with pipx:

pipx install copier
pipx inject copier copier-templates-extensions

Usage

1. Generate a New Project

To generate a project, run one of the following commands:

copier copy --trust "https://github.com/heshinth/fastapi-uv-template" /path/to/your/new/project

Or with a shorter command:

copier copy --trust "gh:heshinth/fastapi-uv-template" /path/to/your/new/project

You can even generate a project without installing Copier, using uv:

uvx --with copier-templates-extensions copier copy --trust "gh:heshinth/fastapi-uv-template" /path/to/your/new/project

Replace /path/to/your/new/project with the desired path for your project.

2. Navigate to Your Project Directory

cd /path/to/your/new/project

3. Install Dependencies

Install the project dependencies using uv:

uv sync

4. Run the Development Server

uv run fastapi dev ./app/main.py

Your FastAPI application will be running at http://127.0.0.1:8000.