FastAPI Template is a project template that provides a good file structure and setup for building FastAPI applications. It includes a pre-configured development environment, production-ready deployment scripts, and SSL configuration options. This template aims to make it easier for developers to start new FastAPI projects with a robust foundation and best practices in mind.
- Clean file structure for organizing your FastAPI application
- Virtual environment setup for isolated dependencies
- Production-ready bash scripts for deployment
- Configurable SSL setup for secure connections
- Pre-configured logging with logs saved to a file
- Web UI for viewing and searching logs with many options
- Clone the repository:
git clone https://github.com/Neko-Nik/FastAPI-Template.git
cd FastAPI-Template
- Create a virtual environment and activate it:
python3 -m venv virtualenv
source virtualenv/bin/activate
- Install the required dependencies:
pip3 install -r requirements.txt
To run the application locally, using Uvicorn or Gunicorn:
Using Uvicorn: uvicorn api.main:app --reload --port 8686
Using Gunicorn: gunicorn -k uvicorn.workers.UvicornWorker api.main:app
The application will start running on http://localhost:8086.
For production deployment, the template provides docker CI pipeline and docker-compose
configuration files for easy deployment.
Contributions are welcome! If you'd like to contribute to FastAPI Template, please follow these steps:
- Fork the repository
- Create a new branch for your feature or bug fix
- Make your changes and commit them
- Push your changes to your fork
- Submit a pull request to the
master
branch of the original repository
Please make sure to follow the existing code style and add tests for any new features or bug fixes.
FastAPI Template is released under the MIT License. You are free to use, modify, and distribute this template for any purpose.