Skip to content

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.

License

Notifications You must be signed in to change notification settings

wanderindev/u-cafe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RESTful API for Udacity coffee shop application ☕

Documentation Maintenance License: MIT Twitter: JavierFeliuA

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.

Project overview

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.

How to use

Clone the repository

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

The backend

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

Testing the API with Postman

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 the u-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.

The frontend

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.

References

Auth0 Authentication API

Author

👤 Javier Feliu

Starter code provided by Udacity.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 Javier Feliu.

This project is MIT licensed.


I based this README on a template generated with ❤️ by readme-md-generator

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages