Coffee Shop Full Stack is the third project for the 2019 Udacity Full-stack Developer Nanodegree. The project is associated with the Identity and Access Management course. Visit this repository for the starter code and project instructions.
The project contains a working frontend and the starter code for a backend.
The work performed on the frontend was limited to adding values to environment.ts
that allow the frontend to connect
to the backend and to the authentication service.
In the backend, I implemented the following methods in auth.py
: get_token_auth_header
, check_permissions
, verify_decode_jwt
,
and requires_auth
. In api.py
, I implemented 5 endpoints and implemented error handling. In models.py
, I added some functionality
to the Drink model.
Open a terminal window, clone the repository and cd into the project root:
git clone https://github.com/wanderindev/u-cafe.git
cd u-cafe
Create a virtual environment, and activate it:
python3 -m venv venv
. venv/bin/activate
Install the project requirements:
pip install -r backend/requirements.txt
Run the RESTful API:
cd backend/src
export FLASK_APP=run;
flask run --reload
The project includes a Postman collection (u-cafe.postman_collection.json
) and a
Postman environment (u-cafe.postman_environment.json
) within the backend directory. To test the API with Postman, follow these steps:
- Open Postman.
- Click on
Import
. - Select both json files and click on open.
- Click on
Runner
. The Collection Runner will open. - Select the
u-cafe
collection and theu-cafe
environment. - Scroll all the way down and click the
Run u-cafe
button. The collection will make 19 requests to the different endpoint with manager, barista, and public access. There is no need to manually enter the tokens for manager and barista. The first two requests in the collection authenticates both users and sets the tokens to environment variables.
Leave the backend running and open a new terminal window. Go into the frontend directory:
cd u-cafe/frontend
The Ionic Command Line Interface is required to serve and build the frontend. If needed, follow the instructions for installing the CLI at Ionic Framework Docs
Once the Ionic CLI is set up, install the frontend dependencies:
npm install
Start the frontend:
ionic serve
Access the frontend at http://127.0.0.1:8100. The credential for the manager is manager@wanderin.dev
password Udacity-Cafe
.
The credential for the barista is barista@wanderin.dev
password Udacity-Cafe
.
👤 Javier Feliu
- Twitter: @JavierFeliuA
- Github: @wanderindev
Starter code provided by Udacity.
Give a ⭐️ if this project helped you!
Copyright © 2019 Javier Feliu.
This project is MIT licensed.
I based this README on a template generated with ❤️ by readme-md-generator