This project part Full Stack Web Developer Nanodegree from Udacity
Developers using this project should already have Python3, pip, node, and npm installed.
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
Ionic ships with a useful development server which detects changes and transpiles as you work. The application is then accessible through the browser on a localhost port. To run the development server, cd into the frontend
directory and run:
ionic serve
tip: Do not use ionic serve in production. Instead, build Ionic into a build artifact for your desired platforms. Checkout the Ionic docs to learn more
Follow instructions to install the latest version of python for your platform 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:
To run the server, execute:
python main.py
The server will run in debug mode if you need to disable this you
need to remove app.debug = True
- Create a new Auth0 Account
- Select a unique tenant domain
- Create a new, single page web application
- Create a new API
- in API Settings:
- Enable RBAC
- Enable Add Permissions in the Access Token
- in API Settings:
- Create new API permissions:
get:drinks-detail
post:drinks
patch:drinks
delete:drinks
- Create new roles for:
- Barista
- can
get:drinks-detail
- can
- Manager
- can perform all actions
- Barista
- Test your endpoints with Postman.
Saleh Alibrahim authored the api (main.py) , authorization (auth.py), and this README. All other project files, including the models and frontend, were created by Udacity as a project template for the [Full Stack Web Developer Nanodegree]