**Simple example of Flask API using microservices architecture, the application contained here develops some functionalities for accessing the database and creating models and migrations. Below are the steps required to run the database and the application backend locally.
This project uses several libraries and tools to facilitate the development and execution of the application. The main dependencies and their functions are listed below:
- Flask: Web framework used to build the API.
- SQLAlchemy: ORM (Object-Relational Mapper) used to interact with the PostgreSQL database.
- marshmallow: simplified object serialization.
- python-dotenv: Library to manage environment variables.
- pymysql: Driver for MariaDB.
- PyJwt: library which allows you to encode and decode JSON Web Tokens.
- unittest: Testing framework used for test-driven development (TDD).
Docker and Docker-Compose installed on the environment.
- Build project
$ docker-compose up --build -d
- First migration
$ docker exec -it remotelab_dev_app bash
@container $ rm -rf migrations
@container $ flask db init
@container $ flask db migrate
@container $ flask db upgrade
@container $ flask seed
$ docker exec -it remotelab_dev_db bash
@container $ mysql -u root -p
@container $ >password root
http://localhost:4010/remotelab-api/swagger/
$ docker exec -it remotelab_dev_app bash
@container $ python -m unittest discover -v