Tax Game
Setup Guide
How to setup the game on our own AWS account
Self Hosting Taxga.me
- Create an AWS account here.
- Install NodeJS here.
- Install AWS SAM here.
- Install AWS CDK here.
- Create access keys for your specified AWS user, preferably using an service account. You can view a guide here.
- Put the code from the
submission.zip
into an AWS Codecommit repository. You can follow this guide on how to get it all setup. Using AWS Codecommit will stream the process, but you can upload each file manually, especially in the case of AWS Amplify. - Setup and link the client folder to AWS Amplify, and make sure you have the following as environmental variables. You can follow this guide to setup NextJS on AWS Amplify.
- Create a
.env.
in the folderserver
with the following:
- In the server folder, run the command
cdk deploy --all
to deploy all stacks to AWS. - Setup your EC2 and ElastiCache instances. You can follow this guide on how to do this.
- Once that has completed, you will need to visit AWS DynamoDB, get the table names and populate
DATABASE_TABLES
variable inserver/lambda/index.ts
, line 36. - You will also need to populate the Lambda functions with the OPENAI and REDIS environmental variables. These can be added on the Lambda function, configuration, environmental variables. You can read this guide on how to do this.
- If you wish to add a custom domain, read this guide on how to add it and link to your AWS services. AWS Amplify has a step-by-step guide GUI on how to do this, to be sure to follow that.
Common Issues
Not communicating between networks
There might be an issue where your AWS services are not talking to each other. You need to ensure that all your AWS Lambda functions (both for the RESTful and Web Socket service) are on the same VPC (Virtual Private Cloud) as your EC2 instance that holds the Redis instance. Connect your Lambda functions to the VPC, you can follow this guide, and it should resolve all your issues.