Ensure Docker and Docker Compose are installed on your system. make should be available by default on macOS.
Build the Docker images:
make build
Start the application:
make up
Stop the application (when done):
make down
Build the Docker images:
docker-compose build
Start the application:
docker-compose up -d
Stop the application (when done):
docker-compose down
Once running, access the API at http://localhost:8000
. Use the value_uf/{date}
endpoint to interact with the API.
Also, you can access http://localhost:8000/docs
to see the api documentation
make test
make coverage
docker-compose run --rm test pytest -v --disable-warnings
docker-compose run --rm test pytest --cov=app --cov-report term-missing --cov-report html --disable-warnings
make bash
docker exec -ti api_uf_backend /bin/bash
- FastAPI: For the web framework to create RESTful endpoints.
- Redis: Implemented as a caching system and in-memory database, optimizing performance by storing frequently accessed data and avoiding repetitive requests to external sources.
- BeautifulSoup: For scraping the required UF value from the SII website.
- Docker: To containerize the application, ensuring it runs the same in every environment.
- docker-compose: To define and run multi-container Docker applications.
- Makefile (for macOS/Linux users): To simplify the command execution for building, running, and managing the Docker containers.