Simple API on FastAPI
(python, FastAPI, SQLAlchemy, SQLite)
Api has two main endpoints:
- save new note of current user
- get all notes of current user
Implemented:
- OAuth2 with Password and Bearer,
- api test with PyTest,
- db admin interface with SQLAdmin
- versioning with FastAPI-Versioning
- json logging to a stream
- monitoring with Sentry and Prometheus
- Documentation - http://127.0.0.1:5000/v2/docs
- SQLAdmin interface - http://127.0.0.1:5000/admin
- Sentry (registration is required) https://sentry.io/
- Prometheus is available at - http://127.0.0.1:9090
- Grafana (currently not configured) - http://127.0.0.1:3000
Create and start container:
$ docker-compose up
Stop lifted containers:
$ docker-compose stop
Start stopped containers:
$ docker-compose start
Stop and delete containers and network:
$ docker-compose down
Remove app image:
$ docker rmi notes_api
Clear logs:
$ sudo rm -rf logs/*