- pnpm - for installing node packages
- terraform - cli for deploying terraform
- aws cli - for s3 uploads and cloudfront invalidations
- python 3.12 - for development
The server has three components.
- Backend - this is where the program logic is housed to be deployed as lambda functions.
- Frontend - the angular web app that will act as the user interface.
- Terraform - this folder contains the infrastructure as code (IaC) definitions for the entire infrastructure.
- Please update the fields inside the
variables.tf
file. - Updaten the
backend.tf
file to point to correct places.
This could be any framework. But in this example I have put an angular app. When you change this, please update the relevant build commands in the variables.tf
file.
build.py
is angular specific. But most web frame works have either similar or simpler configurations. It just call the following functions.
pnpm install # to install the node modules for the web app
# in between it edits the environment.ts file to update env variables as needed
ng build # something similar to this code, but prod specific configs
Currently the environment file is replaced. Change the code to suit your needs.
Make sure you have AWS credentials added to the active terminal window. Then confirm that you are pointing to the correct backend in the backend.tf
file. This manages the state of the infrastructure deployments.
The infrastructure can be deployed using the following commands.
terraform init
terraform apply --auto-approve
Each folder has .vscode
directory that automates code formatting.
For python we use black
and isort
, for typescript prettier
and for terraform hcl terraform formatter
. For development you can open new VSCODE window on each of these folders and work. Code formatting happen automatically upon save. Or do so manually. For terrafor, you can run the following command.
terraform fmt *.tf
Comments style
DOC: documentation
FIX: bug fixes
MAINT: code formatting, import fixing, etc
DEV: development tasks