/Online-Auctions-Backend

API for online auction service.

Primary LanguagePython

📃 About

Online auctions is a FastAPI-based application that implements a platform for creating lots and bids for them, at the end of the lot, an email is sent to the winner.

You can view all project endpoints at: http://127.0.0.1:8000/docs

The project was created as a test task.

❕ Peculiarities

  • The application follows a layered architecture, each layer of the application is responsible for its own logic.
  • When logging in, you need to enter your email in the username field, this is a peculiarity of the FastAPI-Users library.
  • Sending email letters to the winners of the lot is implemented through scheduled celery tasks, the frequency is 1 minute.
  • The project is completely covered by tests using pytest library.

💽 Installation

  1. Clone or download the repository.

  2. Rename .env.dist to .env and populate it with all "Mailing" section variables.

  3. Activate environment % install dependencies: poetry shell & poetry install

  4. Run docker services: docker-compose -f docker/local/docker-compose.yaml up -d

  5. Apply migrations: alembic revision --autogenerate & alembic upgrade head

  6. Run server: uvicorn app.main:app --reload

🌄 Demonstration

Lot creation:

Postman_8DDcxOga3s

Adding a bid per lot:

Postman_cfQfSiIktX

Lot detail:

Postman_hnI1TpTddi