Microservices with Docker, Flask, and React



Learn how to build, test, and deploy microservices powered by Docker, Flask, and React!

In this course, you will learn how to quickly spin up a reproducible development environment with Docker to manage a number of microservices. Once the app is up and running locally, you’ll learn how to deploy it to an Amazon EC2 instance. Finally, we’ll look at scaling the services on Amazon EC2 Container Service (ECS) and adding AWS Lambda.

We’ll also be practicing test-driven development (TDD), writing tests first when it makes sense to do so. The focus will be on server-side unit, functional, and integration tests along with end-to-end tests to ensure the entire system works as expected.

“Code without tests is broken by design.” - Jacob Kaplan-Moss

flask tdd logo


Purchase Now!

Or, preview parts 1 & 2

(Current version: 2.2, released on Feb 19th 2018)



What will you build?

Services

  1. users - Flask app for managing users and auth
  2. client - client-side, React app
  3. nginx - reverse proxy web server
  4. swagger - Swagger API docs
  5. scores - Flask app for managing user scores
  6. exercises - Flask app for managing exercises

App

microservice architecture


Check out the live app, running on multiple EC2 instances -

  1. Production
  2. Staging


Purchase Now!

Or, preview parts 1 & 2



What will you learn?

Part 1

In this first part, you’ll learn how to quickly spin up a reproducible development environment with Docker to create a RESTful API powered by Python, Postgres, and the Flask web framework. After the app is up and running locally, you’ll learn how to deploy it to an Amazon EC2 instance.

Tools and Technologies: Python, Flask, Flask-SQLAlchemy, Flask-Testing, Gunicorn, Nginx, Docker, Docker Compose, Docker Machine, Postgres, Flask Blueprints, Jinja Templates

Part 2

In part 2, we’ll 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 along with Jest, a JavaScript test runner, and Enzyme, a testing library made specifically for React, to the client-side.

Tools and Technologies: Code Coverage with Coverage.py, Node, NPM, Create React App, Axios, Flask-CORS, React forms, Flask Debug Toolbar

Part 3

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-side and add React Router to the React app to enable client-side routing along with client-side authentication.

Tools and Technologies: Flask-Migrate, Flask-Bcrypt, PyJWT, react-router-dom, React Bootstrap, React Router Bootstrap, React Authentication and Authorization

Part 4

In part 4, we’ll add an end-to-end (e2e) testing solution, form validation to the React app, a Swagger service to document the API, and deal with some tech debt. We’ll also set up a staging environment to test on before the app goes into production.

Tools and Technologies: TestCafe, Swagger UI

Part 5

In part 5, we’ll dive into container orchestration with Amazon ECS as we move our staging and production environments to a more scaleable infrastructure. We’ll also add Amazon EC2 Container Registry along with Amazon’s Elastic Load Balancing for load balancing and Amazon’s Relational Database Service for data persistence.

Tools and Technologies: Docker Hub, AWS, EC2, EC2 Container Registry (ECR), EC2 Container Service (ECS), Elastic Load Balancing (ELB), Application Load Balancer (ALB), Relational Database Service (RDS)

Part 6

In part 6, 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.

Tools and Technologies: AWS Lambda and API Gateway

Part 7

In part 7, we’ll refactor the AWS Lambda function to make it dynamic so it can be used with more than one exercise, introduce type checking on the client-side with React PropTypes, and update a number of components. We’ll also introduce another new Flask service to manage scores. Again, we’ll update the staging and production environments on ECS.

Tools and Technologies: AWS Lambda and ECS, PropTypes, and Flask


Purchase Now!

Or, preview parts 1 & 2



Join our mailing list to be notified about course updates and new tutorials.