This web service is designed to meet the requirements of the test assignment provided by 'QB' company. The service provides API endpoints to check the availability of financial instruments by date and time intervals and fetch instrument information by ID. Additionally, it supports streaming binary file data to clients. You can find the detailed assignment in the task directory in this repository.
- Python
- FastAPI
- SQLAlchemy
- Pydantic
- PostgreSQL
- Docker
- Docker Compose
- Nginx
- GitHub Actions
- Docker
- Docker Compose V2
- Clone the Repository:
git clone https://github.com/Srmrlt/QB_Challenge.git git switch FastAPI-main cd QB_Challenge/infra - Environment Variables. Copy the .env.dev file from the project infra folder
to a new file named .env and fill in/adjust the necessary environment variables:
cp ../.env.example .env
- Building and Running the Containers.
Use Docker Compose to build and start the containers:
docker compose up --build -d
- Stopping and Removing Containers, Volumes, and Images:
docker compose down --rmi all -v
- The project should now be running at http://localhost:80.
Based on the test assignment, the following endpoints are implemented:
GET /api/isin_exists?date=YYYY-mm-dd&instrument=<instrument>&exchange=<exchange>
GET /api/isin_exists_interval?date_from=YYYY-mm-dd&date_to=YYYY-mm-dd&instrument=<instrument>&exchange=<exchange>
GET /api/iid_to_isin?date=YYYY-mm-dd&iid=<instrument_id>
GET /stream?date=YYYY-mm-dd&chunk_size=<size_in_bytes>
Data generation and parsing into the database occur automatically upon project startup.