A simple FastAPI template with a structured project layout for building asynchronous APIs.
├── 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
- Create a virtual environment:
python -m venv venv- Activate the virtual environment:
# On Windows
venv\Scripts\activate
# On Unix or MacOS
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Create a
.envfile in the root directory with your environment variables.
uvicorn src.main:app --reloadpython watch.pyOnce the application is running, you can access the API documentation at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc