Hello there
This code is a simple system of token validation using a MVC (model, view, controller) architecture, on this code was applied some concepts like:
- Test driven code (unity tests and integration)
- Documentation with mkdocs
- Api Rest
- Schemas for request and response
- Object-oriented programming
Beyond that, the technologies used are:
- SqlAlchemy
- Pydantic
- Python
- Pytest
- Alembic
- Black
- Flake8
- Fast Api
- Sqlite
For configuring the environment run the following commands
Windows:
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
Linux:
python -m venv venv
venv/bin/activate
pip install -r requirements.txt
This project was created using sqlite, but you can change and use any database, in order to create the sqlite using the models available you must use the following code:
python
from src.infra.config.db_connection import *
from src.infra.models.users import *
db_conn = DataBaseConnectionHandler()
engine = db_conn.get_engine()
Base.metadata.create_all(engine)
exit()
alembic upgrade head
To run the documentation with mkdocs you must use following command
mkdocs serve
For running the project you must run:
uvicorn server:app --reload --port 8080
This project has support to docker, so if you want to run use:
Build:
docker build -t mvc-python
Run:
docker run -it mvc-python