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
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
- 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
- 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
- Provide the cache service (skip if it is already running on the host):
$ docker compose up cache -d
- Run the application:
$ fastapi prod src/rabdulatipoff_evvve_test/main.py --port $APP_PORT
- Provide a .env configuration & modify values if needed:
$ cp .env.compose .env
$ . ./.env
- Build the Docker image and start Compose services in detached mode:
$ docker compose up --build -d
- 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