Introduction

In Part 3, we'll add database migrations along with password hashing in order to implement token-based authentication to the users service with JSON Web Tokens (JWTs). We'll then turn our attention to the client and add React Router to the React app to enable client-side routing along with client-side authentication.

Objectives

By the end of part 3, you should be able to...

  1. Use Flask Migration to handle database migrations
  2. Configure Flask Bcrypt for password hashing
  3. Implement user authentication with JWTs
  4. Write tests to create and verify JWTs and user authentication
  5. Use React Router to define client-side routes in React
  6. Build UI components with React Bootstrap
  7. Explain the difference between user authentication and authorization
  8. Implement user authorization

App

flask tdd logo

Check out the live app, running on EC2 - http://54.89.0.180/

You can also test out the following endpoints...

Endpoint HTTP Method Authenticated? Result
/auth/register POST No register user
/auth/login POST No log in user
/auth/logout GET Yes log out user
/auth/status GET Yes check user status
/users GET No get all users
/users/:id GET No get single user
/users POST Yes (admin) add a user
/ping GET No sanity check

Grab the code:

  1. flask-microservices-main
  2. flask-microservices-users
  3. flask-microservices-client


Introduction

In Part 3, we'll add database migrations along with password hashing in order to implement token-based authentication to the users service with JSON Web Tokens (JWTs). We'll then turn our attention to the client and add React Router to the React app to enable client-side routing along with client-side authentication.

Objectives

By the end of part 3, you should be able to...

  1. Use Flask Migration to handle database migrations
  2. Configure Flask Bcrypt for password hashing
  3. Implement user authentication with JWTs
  4. Write tests to create and verify JWTs and user authentication
  5. Use React Router to define client-side routes in React
  6. Build UI components with React Bootstrap
  7. Explain the difference between user authentication and authorization
  8. Implement user authorization

App

flask tdd logo

Check out the live app, running on EC2 - http://54.89.0.180/

You can also test out the following endpoints...

Endpoint HTTP Method Authenticated? Result
/auth/register POST No register user
/auth/login POST No log in user
/auth/logout GET Yes log out user
/auth/status GET Yes check user status
/users GET No get all users
/users/:id GET No get single user
/users POST Yes (admin) add a user
/ping GET No sanity check

Grab the code:

  1. flask-microservices-main
  2. flask-microservices-users
  3. flask-microservices-client