This is a Todo app. A basic one. But it has been used for learning ways of abstraction in python, such as Generics and Protocols. Also, I have tried to use best practices of format and such.
The best way to get the running is by using Docker. To do this, you must have Docker installed in your machine. Once you have it, you can run the following command:
docker compose -f docker-compose.development.yml up -d
This will get you:
- The frontend running in port 3000
- The backend running in port 5000
- Prometheus running in port 9090
- Grafana running in port 7000
To stop the app, you can run:
docker compose -f docker-compose.development.yml down
To start development of the frontend app, do the following:
cd src\frontend && npm install
For linting and formatting, do:
npm run prettier
npm run eslint
To start development of the frontend app, do the following:
cd src\backend && poetry install
For linting and formatting, do:
poetry run pyright .
poetry run ruff check .
poetry run black --check .
Tests require Docker to be running. To run them, just do:
poetry run pytest
These are two concepts that I have been using in my code. Though they help the type checker tell if something is wrong in code (static analysis), they really have no influence in runtime.
Dependency injection is used to decouple the different parts of the program. To use this, objects must not create new instances of classes in their constructors, but receive them as parameters.
Asyncio is used together with aiofiles to read and write files in an asyncronous way Also, SQLAlchemy uses an async backend asyncpg