Skip to content

ClearThree/YandexContest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YandexContest for Backend school 2021.

REST app for candy delivery service.

App uses FastAPI, Uvicorn, Pydantic and Pytest libraries (reflected in requirements).

Install and run the app

  1. If not installed, install git and virtualenv with commands: sudo apt install python3-venv and sudo apt install git
  2. Clone the repository
  3. Create the virtual environment for project: python3 -m venv delivenv
  4. Activate the environment: source delivenv/bin/activate
  5. Get into the directory of repo and install required libraries with pip3 install -r requirements.txt
  6. Run uvicorn main:app --host 0.0.0.0 --port 8000

Run tests

  1. Perform steps 0-4 if not performed yet.
  2. Run pytest

Setting the autostart after reboot

To deploy the app as system service follow these steps:

  1. Get into repo directory
  2. Run sudo cat service.txt >delivery.service
  3. Do sudo mv delivery.service /etc/systemd/system/
  4. Enable the service with sudo systemctl enable delivery.service
  5. Finally, start the service with sudo systemctl start delivery.service

Note: If the virtualenv you created has the name that differs from "delivenv", then open delivery.service file and change the name to yours in 'Environment=...' and 'ExecStart=' paths.

About

REST app for delivery service.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages