- Angular CLI frontend
- Plotly 3D Scatterplot used for game view
- Terraform deployment to AWS
- Django/PostgreSQL backend
- Django Rest Framework
- Client access to the Star Wars API (https://swapi.dev/api) to retrieve pilot names
- Serverless PostgreSQL database on Amazon Aurora
This app is built on python:3.7-slim-buster with nginx and Django added to the installation (see Dockerfile). In development, a postgres:12.2-alpine image is used to host the database.
This app is currently configured to deploy to AWS with the following configuration:
Internet traffic arrives at the Application Load Balancer (ALB) and is forwarded to the EC2 instances via the Virtual Private Cloud (VPC). The EC2 application instances (2 by default) are managed by Amazon Elastic Container Service (ECS), which hosts a Docker repository of the application image within Elastic Container Repository (ECR). The database is using Amazon new serverless Aurora configuration with a PostgreSQL 10.7-compatible database backend that autoscales based on app demand. The app (in the EC2 containers) can access the public Internet (Star Wars API, etc.) through a NAT gateway.
The configuration is managed by Terraform, which should be customized as follows:
- In the terraform/ directory:
- customize the
variables.tffile - copy
secrets.auto.tfvars.sampletosecrets.auto.tfvarsand customize
- customize the
- In the root (this) directory:
- copy
env.sampleto.envand customize - review the Makefile (run
make helpin a terminal) - ensure Docker Desktop is installed and configured
- in a terminal, run:
make install-prereqsto install terraform, node, and yarnmake buildto build the Angular client and Docker image- For development:
make dev-clientto build/watch Angulardocker-compose upin a new terminal to start up the dev containers- Visit http://localhost (as the nginx proxy server runs on port 80)
aws configureto setup AWS CLI -- use an IAM with sufficient account privileges to:- create/destroy EC2, ECS, Aurora, ALB, and gateway instances, and security groups...
- setup CloudWatch logs...
- basically, an AWS "superuser"
make planto run terraform plan & check the configurationmake deployto deploy to AWSmake opento open the latest deployed URL (the ALB URL on AWS)
- copy