Skip to content

rabdulatipoff/rabdulatipoff-evvve-test

Repository files navigation

Exchange Prices Aggregator

This is a service which collects, parses and aggregates coin price data from a selection of crypto exchanges, a test assignment done for Evvve. Currently supported:

- Binance
- ByBit

Table of Contents

Development

This project uses PDM for dependency/project management, keeping general configuration settings in pyproject.toml. Install it with:

$ pip install --user pdm
$ pdm self update

Fetching dependencies:

# Production + development
$ pdm install --dev

# Production only
$ pdm install --prod

Run the app:

# Switch to the project virtualenv
$ eval $(pdm venv activate)

# Make sure that your .env configuration exists and is valid
$ . ./.env

$ fastapi dev src/rabdulatipoff_evvve_test/main.py

Updating requirements.txt for container deployment:

$ pdm export -f requirements --prod > requirements.txt

Running locally

  1. Install dependencies (skip if you have followed the Development section):
# It is advised to create a virtualenv first
$ virtualenv ./.venv
$ source .venv/bin/activate

$ pip install -r requirements.txt
  1. Provide a .env configuration & modify values if needed:
# Use .env.local if memcached is running on the host system (e.g. installed from a DEB/RPM repository)
$ cp .env.compose .env
$ . ./.env
  1. Provide the cache service (skip if it is already running on the host):
$ docker compose up cache -d
  1. Run the application:
$ fastapi prod src/rabdulatipoff_evvve_test/main.py --port $APP_PORT

Running with Docker Compose

  1. Provide a .env configuration & modify values if needed:
$ cp .env.compose .env
$ . ./.env
  1. Build the Docker image and start Compose services in detached mode:
$ docker compose up --build -d
  1. Observe logs with:
$ docker compose logs app -f

Explore the API in a browser (APP_PORT is set to 8000 by default):

https://localhost:8000/docs

About

An API implementation for Evvve test assignment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages