Python-API-Development (YouTube video)
Open Source | |
---|---|
Tech Stack |
This is my interpretation of the Python API Development 20h course from Sanjeev Thiyagarajan on Youtube. :)
This project consists in a web app backend of a social message board type. We can create users, with their respective authentication credentials (OAuth 2.0), each user can post messages, and do the usual CRUD type of requests (subject to authentication) regarding the posts. They also have the possibility of voting on posts.
This project is (now) being planned and tracked, using Linear.app. See an example of this integration here.
- Black:Python code formatter. Character line length optimised for my screen.
- Flake8: Analyses your code without actually running it. It checks for errors, enforces a coding standard, looks for code smells, and can make suggestions about how the code could be refactored. Initially, this repo used pylint, but when using an ORM like SQLAlchemy, pylint is too slow.
- isort: Python utility / library to sort imports alphabetically, and automatically separated into sections and by type.
One thing that could be improved was leaving the pytest tests until the end... In my opinion, Sanjeev should have introduced the tests much earlier, and as he created the new methods, or operations, he could have explained a bit how to create useful tests.
- Add coverage report.
Allows us to query, visualize, alert on and understand our metrics from different data sources, all through creating our own dashboards. PostgreSQL, and Prometheus as grafana's datasources have been added.
The dashboard from PostgreSQL was created in an automated way.
The dashboard from Prometheus metrics, in the picture below, was imported manually.
- Put a Grafana Loki integration up and running.
- Improve Prometheus dashboards.
Prometheus collects and stores its metrics as time series data, i.e. metrics information is stored with the timestamp at which it was recorded, alongside optional key-value pairs called labels.
- Add a PostgreSQL exporter to Prometheus docker image.