# Ukay Delivery Mobile Services Back-End
This repository will house all of the services required in order for drivers to interact with the application.

Services will include data bases, data streaming, delivery updating, and more.

# Development Setup
## Install pyenv
### For Mac
```bash 
brew install pyenv
brew install pyenv-virtualenv
# Add the following to the end of your ~/.zshrc or ~/.bashrc file
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
```
### For Windows
Follow instructions (here)[https://github.com/pyenv-win/pyenv-win]

## Setup pyenv
```bash 
pyenv install 3.11.0
pyenv global 3.11.0
pyenv virtualenv ukay-delivery-backend
pyenv activate ukay-delivery-backend
```
## Install Requirements
```bash
pip install -r requirements.txt 
```
If you understand everything from the above steps and don't want to manually go through the process, then run the following script from the project root:
```bash
./scripts/core.sh -c
```

Note, an alias for the script will be added to your .zshrc file, meaning that you will only have to type "ukay" to run the script.

## Run the Program
Run the following script from the src directory:
```bash
ukay -r
```

## Project Layout
```
mobile-backend
├──────DOCUMENTATION──────
│
├─ LICENSE ────────────GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007
├─ README.md ──────────This file
├─ requirements.txt ───Python dependencies. Do NOT modify this file
├─ sample_commands.json
├──────CODEBASE AND SCRIPTS──────
├─ api ────────────────Holds OpenAPI.json file
├─ docker ─────────────Useful Docker files
├─ scripts ────────────Useful scripts and PostgreSQL Init script
├─ app
│  ├─ api ─────────────Home to all API routes
│  ├─ configs ─────────Configs for DB Connections and Logger
│  ├─ data_objects ────Python object representations of DB Tables (Holds business logic for each API call)
│  ├─ db ──────────────PostgreSQL DAO Interface
│  └─ resources ───────Other useful Python resources
└─ tests
   └─ api ─────────────Test API Business Logic
```