A minimal and scalable FastAPI server template for building RESTful APIs quickly.
- FastAPI framework for high-performance APIs
- Automatic interactive API documentation (Swagger)
- Pydantic for data validation
- Async support for high concurrency
- CORS support
- Environment variable configuration
- Logging and error handling
- Ready
Config
class with.env
example and validation forint
,float
,str
, and missing values - FastAPI email client
- Middleware example class
- Ready model for
User
andItem
as examples - Custom logger with file logging and console logging with auto colors
- alembic support for migrations
git clone https://github.com/electro199/FastApi-Complete-Template
cd fastapi-server-template
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
or
python3 run.py
After running the server, access API docs at:
- Swagger UI: http://localhost:8000/docs
Create a .env
file by renaming .env.template:
To deploy on production, run Uvicorn:
uvicorn app.main:app --host 0.0.0.0 --port 8000
This project is licensed under the MIT License.