- fastapi
- streamlit
- AWS: VPC, EC2, S3, DynamoDB, Polly, Textract
- terraform
Download these tools before you start working on the project.
- python 3.12
- poetry
- ngrok (for setting up a public endpoint of locahost for SNS webhook)
Black FormatterVSCode extension (also set format on save, and set as default formatter for python insettings.json)
- Run
terraform initto initialize the terraform project - Run
terraform planto see the changes that will be applied - Copy
.env.templatefile in root of the folder as.envinto the same directory fill in the values. - Run
ngrok http 8000, copy the forwarding url (e.g.https://8a24-49-228-104-201.ngrok-free.app) and paste it in the.envin the fieldSNS_TOPIC_ENDPOINT - Run
chmod +x load_env.shto make the script executable - Run this to create the infrastructure
source ./load_env.sh
terraform apply- Run
terraform output -raw secret_access_keyto get the secret access key forserver setup
- Run
poetry install(to add packages dopoetry add <package>andpoetry updateto update all packages) - Copy
.env.templatefile in root of the folder as.envinto the same directory fill in the values. - Run
poetry env activateto activate the virtual environment - Run
poetry env info --pathto get the path of the virtual environment - In VSCode,
Ctrl + Shift + Pand typePython: Select Interpreter, selectEnter interpreter path...and paste the path of the virtual environment. This will allow intellisense for the project - Place your background
mp4clips in/server/videose.g. Minecraft parkour, Subway Surfers, etc. - Run
poetry run python run.pyto start the application
# these envs are available by doing terraform apply in /infrastructure
AWS_ACCESS_KEY_ID= # access_key_id
AWS_SECRET_ACCESS_KEY= # after applying, run `terraform output -raw secret_access_key`
AWS_REGION= # region
AWS_BUCKET_NAME= # bucket_name- like
server(skip step 2, 7) - Run
poetry run streamlit run ./app/main.pyto start the application
- Swagger is available at
http://localhost:8000/docs - If you don't want to see
__pycache__folders, add this to VSCode'ssettings.jsonfile:
"files.exclude": {
"**/__pycache__": true,
},