/fast-api-template

A template to Develop Fast API Projects

Primary LanguagePythonMIT LicenseMIT

FastAPI Template

A simple FastAPI template with a structured project layout for building asynchronous APIs.

Project Structure

├── src/
│   ├── config/
│   │   └── env.py
│   ├── controllers/
│   │   └── webhook_controller.py
│   ├── routes/
│   │   ├── webhook_routes.py
│   │   └── template_routes.py
│   ├── schemas/
│   ├── services/
│   ├── utils/
│   └── main.py
├── watch.py
├── .env
├── requirements.txt
└── README.md

Setup

  1. Create a virtual environment:
python -m venv venv
  1. Activate the virtual environment:
# On Windows
venv\Scripts\activate
# On Unix or MacOS
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file in the root directory with your environment variables.

Running the Application

Normal mode:

uvicorn src.main:app --reload

With file watcher:

python watch.py

API Documentation

Once the application is running, you can access the API documentation at: