This project contains containerized Flask API, MySQL DB and Next.js front-end. The project also contains Terraform code with which the infrastructure can be provissioned on AWS.
For development use docker compose.
You must create a secrets dir in the root of the project and create the following files:
db_name
db_password
db_root_password
db_user
Start the containers:
docker compose up -d --build
Stop the containers:
docker compose down
You can find autogenerated API docs at:
http://localhost:8000/api/docs
First you need to manually create a key/value secret in AWS Secrets Manager with the following keys:
MYSQL_ROOT_PASSWORD
MYSQL_DATABASE
MYSQL_USER
MYSQL_PASSWORD
And to update the db_details_secret variable in ./terraform/variables.tf with the secret's name.
Other relevant variables such as aws_region, aws_account_id should also be updated if there are changes in that.
You can create/update the infrastructure with terraform:
cd terraform
terraform init
terraform plan
terraform apply
And you can also destroy it:
terraform destroy