Coder Social home page Coder Social logo

python-api-development's Introduction

Python-API-Development (YouTube video)

alt text

Overview

Open Source BSD 3-clause
Tech Stack Python FastAPI Grafana Prometheus Postgres Docker Postman

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.

Integrations

Linear

This project is (now) being planned and tracked, using Linear.app. See an example of this integration here.

Pre-Commit Hooks

  • 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.

Pytest

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.

TODO:

  • Add coverage report.

Grafana

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. Screenshot from 2023-06-12 20-02-59

The dashboard from Prometheus metrics, in the picture below, was imported manually. image

TODO:

  • Put a Grafana Loki integration up and running.
  • Improve Prometheus dashboards.

Prometheus

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.

TODO:

  • Add a PostgreSQL exporter to Prometheus docker image.

python-api-development's People

Contributors

ialvata avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.