Introduction

Part 2, Lesson 1



In Part 2, we'll split the project into three distinct projects. We'll also add code coverage and continuous integration testing to ensure that each service can be run and tested independently from the whole. Finally, we'll add ReactJS to the client-side.

Structure

  1. flask-microservices-main - Docker Compose files, Nginx, admin scripts
  2. flask-microservices-users - Flask app
  3. flask-microservices-client - client-side

Objectives

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

  1. Manage services housed in multiple git repos from a single Docker Compose file
  2. Utilize a git repo as the "build context" for Docker Compose
  3. Run unit and integration tests with code coverage inside a Docker Container
  4. Work with each service independently without Docker
  5. Configure Travis CI for continuous integration testing
  6. Explain what React is
  7. Work with React running inside a Docker Container
  8. Create a Single Page Application with React components
  9. Use React props and state appropriately
  10. Manage the state of a React component via component lifecycle methods
  11. Pass environment variables to a Docker image at build time
  12. Use React controlled components to handle form submissions

App

microservice architecture

Check out the live app, running on EC2 - http://flask-microservices-prod-alb-814316018.us-east-1.elb.amazonaws.com

You can also test out the following endpoints...

Endpoint HTTP Method CRUD Method Result
/users GET READ get all users
/users/:id GET READ get single user
/users POST CREATE add a user

The /users POST endpoint is restricted as of Part 3.

Grab the code:

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

Introduction

In Part 2, we'll split the project into three distinct projects. We'll also add code coverage and continuous integration testing to ensure that each service can be run and tested independently from the whole. Finally, we'll add ReactJS to the client-side.

Structure

  1. flask-microservices-main - Docker Compose files, Nginx, admin scripts
  2. flask-microservices-users - Flask app
  3. flask-microservices-client - client-side

Objectives

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

  1. Manage services housed in multiple git repos from a single Docker Compose file
  2. Utilize a git repo as the "build context" for Docker Compose
  3. Run unit and integration tests with code coverage inside a Docker Container
  4. Work with each service independently without Docker
  5. Configure Travis CI for continuous integration testing
  6. Explain what React is
  7. Work with React running inside a Docker Container
  8. Create a Single Page Application with React components
  9. Use React props and state appropriately
  10. Manage the state of a React component via component lifecycle methods
  11. Pass environment variables to a Docker image at build time
  12. Use React controlled components to handle form submissions

App

microservice architecture

Check out the live app, running on EC2 - http://flask-microservices-prod-alb-814316018.us-east-1.elb.amazonaws.com

You can also test out the following endpoints...

Endpoint HTTP Method CRUD Method Result
/users GET READ get all users
/users/:id GET READ get single user
/users POST CREATE add a user

The /users POST endpoint is restricted as of Part 3.

Grab the code:

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