Introduction

Part 6, Lesson 1



In the final part, we'll focus our attention on adding a new Flask service, with two RESTful-resources, to evaluate user-submitted code. Along the way, we'll tie in AWS Lambda and API Gateway and spend a bit of time refactoring React and the end-to-end test suite. Finally, we'll update the staging and production environments on ECS.

Objectives

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

  1. Practice test driven development while refactoring code
  2. Integrate a new microservice in the existing set of services
  3. Explain what AWS Lambda and API Gateway are and why would would want to use them
  4. Develop a RESTful API endpoint with API Gateway that triggers an AWS Lambda function
  5. Update the staging and production environments on Amazon ECS

App

microservice architecture

Check out the live app, running on EC2 -

  1. Production
  2. Staging

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
/health GET No sanity check
/scores GET No get all scores
/scores/:id GET No get single score
/scores/user GET Yes get all scores by user id
/scores/user/:id GET Yes get single score by user id
/scores POST Yes add a score
/scores/:id PUT Yes update a score
/scores PATCH Yes upsert (update or add if the score does not exist)
/exercises GET No get all exercises
/exercises POST Yes (admin) add an exercise

Grab the code:

  1. flask-microservices-main
  2. flask-microservices-users
  3. flask-microservices-client
  4. flask-microservices-swagger
  5. flask-microservices-eval

Introduction

In the final part, we'll focus our attention on adding a new Flask service, with two RESTful-resources, to evaluate user-submitted code. Along the way, we'll tie in AWS Lambda and API Gateway and spend a bit of time refactoring React and the end-to-end test suite. Finally, we'll update the staging and production environments on ECS.

Objectives

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

  1. Practice test driven development while refactoring code
  2. Integrate a new microservice in the existing set of services
  3. Explain what AWS Lambda and API Gateway are and why would would want to use them
  4. Develop a RESTful API endpoint with API Gateway that triggers an AWS Lambda function
  5. Update the staging and production environments on Amazon ECS

App

microservice architecture

Check out the live app, running on EC2 -

  1. Production
  2. Staging

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
/health GET No sanity check
/scores GET No get all scores
/scores/:id GET No get single score
/scores/user GET Yes get all scores by user id
/scores/user/:id GET Yes get single score by user id
/scores POST Yes add a score
/scores/:id PUT Yes update a score
/scores PATCH Yes upsert (update or add if the score does not exist)
/exercises GET No get all exercises
/exercises POST Yes (admin) add an exercise

Grab the code:

  1. flask-microservices-main
  2. flask-microservices-users
  3. flask-microservices-client
  4. flask-microservices-swagger
  5. flask-microservices-eval