Setup a new python virtual environment
cd api
pip3 -m venv .venv
And activate the virutal environment
For MacOs
source .venv/bin/activate.fish
For Windows
env/Scripts/Activate.ps1
Then, install the dependencies using
pip3 install -r requirement.txt
NOTE: VSCode can identify requirement.txt as pip file and prompt to create a virtual enviroment
To load menu data into the database, run
python3 script.py --menu
To load waiter's credentials into the database, run
python3 script.py --waiter
To initiate the sequence generator for orders, run
python3 script.py --order
To generate a bcrpyt salt, run
python3 script.py --salt
Or, to run all the above command
python3 script.py --all
ALGORITHM=HS256
ORIGINS=<list-of-origins>
SALT=<salt-for-hashing>
SECRET=<jwt-secret>
WAITER_SECRET=<jwt-secret-for-waiter>
SEQ_START=<integer>
WAITER_PASSWORD=<password-for-waiter>
CLOSE_TIME=<isoformat-time HH:MM:SS>
# Inside your api directory run the following command
uvicorn main:app
# for development, use --reload
uvicorn main:app --reload
This runs the server at localhost:8000 and API documentation can be found at localhost:8000/docs
Run the following command to install the node packages,
cd frontent
npm install
# for development purpose
npm run dev
# for production purpose
npm run build
npm run preview
This runs the frontend server at localhost:8080 for both development and production