Want to build a new API server but dont know where to start? Looking to learn an awesome new framework? Need a backend stack to quickly develop an API for your new project?
This project provides you an out of the box API service that demonstrates the wonders of FastApi. This codebase provides the needed basics and some useful goodies out of the box. Simply clone this repository and customize to your own needs and requirements!
- Backend service built in Fastapi
- For more info on Fastapi, please checkout the docs. They are great!
- Restful API with sample endpoints
- Schema validation with Pydantic
- Extendable CRUDBase class to easily configure crud operations
- Object Relational Mapping with Sqlalchemy
- Postgresql database running in docker with sample data
The following are instructions on how to setup the projects to run and develop. Source code is available in the app folder.
- Python 3.12 or greater
- python3.XX-venv for virtual environment
- Docker for postgresql container
- Create a virtual environment
python3 -menv venv ./venv/ - Activate env and install requirements
source venv/bin/activatepip install -r requirements.txt
- Setup database
- Start docker container
docker compose up -d - Setup and populate sample data
python3 ./scripts/populate_db.py
- Start docker container
- Run database container
docker compose up -d - Start fast app
fastapp dev - Take a look at the api spec http://localhost:8000/docs
- Cleaner setup script
- Run app in docker container
- Authentication
- Certain db access per user
- only see own salaries/if admin
- Testing
- Error handling
- Logging
- db session pool
- pagination
This project is licensed under the terms of the MIT license.
