/Jets_rental

API for fictional superjet rental service.

Primary LanguagePythonMIT LicenseMIT

Fictional superjet rental service.

Python FastAPI SQLalchemy Postgres Docker Swagger

Hits

Api for superjet rental service.

The application allows you to rent a superjet for a specific date and calculate the rental cost.

  • It is possible to register users, verify, simulate fake email.
  • Create, update superjet objects according to the specified parameters.
  • Rental for a specified date, the minimum rental duration is one day.
  • Calculation of rental cost based on duration.
  • Upload data from csv and create csv with any quantity rows.
  • Checking data with pagination.

Data for preview and documentation available.


Fast Start with docker compose.

# Clone
git clone <proj>

# Move to folder infra/
cd <proj>/infra/

sudo docker compose -f docker-compose-v2.yaml up -d

Documentation:
http://127.0.0.1:8000/docs

Authorize test user:

Username: super@mail.com  
Password: super  

Dev local run with Postgres.

# Copy .env to root project folder
cp infra/.env.local .env

# Create and activate venv
# python -m venv venv
python3.10 -m venv venv
. venv/bin/activate

# Upgrade pip and install requirements
python -m pip install --upgrade pip
pip install -r dev-requirements.txt

# If "fast start with docker compose" was used, delete the previous images/containers
sudo docker compose -f infra/docker-compose-v1.yaml up -d

# Make alembic migrations to DB
# From folder with alembic.ini
alembic upgrade head

# Run the server
uvicorn app.main:app --reload

# Super user and test user has been registered.

Documentation:
http://127.0.0.1:8000/docs

Authorize test user:

Username: super@mail.com  
Password: super