It's a FastAPI implementation as the backend for a blog system. This project's a funny goal to apply things that I'm learning. Things that you see here like telemetry using open source projects, CRUD using REST, and GraphQL (I hope that I have time to do that).
- Poetry
- SQLAlchemy
- Alembic for migrations
- OpenTelemtry for instrumentation
- Docker
- Docker-Compose
- Jaeger
- Next.js
- React
- Make
Use make command to run inside a docker container, it'll expose the port 8000 and access using URL: http://localhost:8000
. I'm not sure if a makefile runs in the Powershell, probably yes but I suggest using WSL2.
The frontend is in the early stage but you can see access: http://localhost:3000/
.
Up and run:
make dev-up
This repo is instrumented by OpenTelemtry and export metric to Jaeger that starts together with the app by Docker-Compose, to access: http://localhost:16686/
To run tests will up a PostgreSQL container and expose 5433 port to populate. The report will write in htmlcov
dir.
make test-app
The FastAPI code here was OpenTelemetry instrumented and to export Traces to Jaeger. If you want to see a break simulation, follow the steps below.
python -m venv .venv
pip install poetry
poetry install
make dev-up
opentelemetry-instrument tests/populate_posts.py
Open a third shell session to stop Postgres, this will break the FastAPI app. You'll see error messages in the log and the script client on the console. Stop Postgres, wait some seconds or a minute, start Postgres again.
make dev-db-kill
sleep 30
make dev-db-start
Stop the populate_posts.py
scritpt (ctrl+c
), go to Jaeger UI (http://localhost:16686/). If everything fine (or fail... 😁), you'll see on Jaeger like screenshots below.
- FastAPI errors exported by OpenTelemetry to Jaeger
- An error detail from the client request and server.
- Some Opentelemetry warnings will show when tests ran.
Pagination- CORS
- Token authentication
- GraphQL
- Improve Token
- SAML/Oauth2
- Run tests in container
Autentication- Implement UI (React)
- Helm Chart
- Improvement tests with tox
Implement a default path (/)- Custom Limit and Offset
Add script to ingest samplesCI tests