I have created a website that emulates as a cafe for students to order drinks, socialize, and study hard. This website also has password authentication to protect each user's data using Python, JavaScript, TyprScript, SCSS and HTML.
The website has the following functionality:
- Display graphics representing the ratios of ingredients in each drink.
- Allow public users to view drink names and graphics.
- Allow the shop baristas to see the recipe information.
- Allow the shop managers to create new drinks and edit existing drinks.
This project depends on Nodejs and Node Package Manager (NPM). Before continuing, you must download and install Node (the download includes NPM) from https://nodejs.com/en/download.
The Ionic Command Line Interface is required to serve and build the frontend. Instructions for installing the CLI is in the Ionic Framework Docs.
This project uses NPM to manage software dependencies. NPM Relies on the package.json file located in the frontend
directory of this repository. After cloning, open your terminal and run:
npm install
tip: npm i is shorthand for npm install
Follow instructions to install the latest version of python for your platform in the python docs
We recommend working within a virtual environment whenever using Python for projects. This keeps your dependencies for each project separate and organized. Instructions for setting up a virtual environment for your platform can be found in the python docs
Once you have your virtual environment setup and running, install dependencies by naviging to the /backend
directory and running:
pip install -r requirements.txt
This will install all of the required packages we selected within the requirements.txt
file.
-
Flask is a lightweight backend microservices framework. Flask is required to handle requests and responses.
-
SQLAlchemy and Flask-SQLAlchemy are libraries to handle the lightweight sqlite database. Since we want you to focus on auth, we handle the heavy lift for you in
./src/database/models.py
. We recommend skimming this code first so you know how to interface with the Drink model. -
jose JavaScript Object Signing and Encryption for JWTs. Useful for encoding, decoding, and verifying JWTS.
From within the ./src
directory first ensure you are working using your created virtual environment.
Each time you open a new terminal session, run:
export FLASK_APP=api.py;
To run the server, execute:
flask run --reload
The --reload
flag will detect file changes and restart the server automatically.