stivenramireza / finance-api

Finance API for user transactions management.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Finance API

This finance API contains the following endpoints:

  • User register.
  • User login.
  • Restaurants list based on his city or latitude and longitude for logged users.
  • Historical user transactions.
  • User logout.

Architecture

Architecture

Technologies

The used technologies were:

Environment variables

These environment variables must be set before running the application.

  • ENV: Environment where the application will be executed, e.g production.
  • URL: URL where the application is running, e.g http://localhost:8000.
  • POSTGRES_HOST: Database host, e.g localhost.
  • POSTGRES_PORT: Database port, e.g 5432.
  • POSTGRES_SCHEMA: Database name
  • POSTGRES_USER: Database user.
  • POSTGRES_PASSWORD: Database password.
  • REDIS_HOST: Redis host, e.g localhost.
  • REDIS_PORT: Redis port, e.g 6379.
  • REDIS_PASSWORD: Redis password.
  • JWT_PRIVATE_KEY: Private RSA key used for JWT token encoding.
  • JWT_PUBLIC_KEY: Public RSA key used for JWT token decoding.
  • TRAVEL_ADVISOR_API_URL: External API URL used for getting restaurants in the world.
  • TRAVEL_ADVISOR_API_KEY: External API KEY used for endpoint calls.
  • TRAVEL_ADVISOR_HOST: Host used for the external API headers.

Execution

You can run this application with the following command:

$ docker-compose up

Testing

Some unit tests were implemented in order to check the finance API services. You can run them and see the coverage report with the following commands:

$ python3.10 -m venv venv
$ source venv/bin/activate
$ pip install --upgrade -r requirements.txt
$ coverage run -m pytest --verbose
$ coverage report -m

About

Finance API for user transactions management.

License:MIT License


Languages

Language:Python 99.2%Language:Dockerfile 0.8%