# gamelift **Repository Path**: ruidream/game ## Basic Information - **Project Name**: gamelift - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-03-25 - **Last Updated**: 2025-03-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Gaming Voice of Players Analytics Gaming Voice of Players Analytics is a comprehensive, Gen-AI driven solution guidance designed to collect, analyze, and provide actionable insights from game community and game marketplace across multiple channels. Key features include Multi-source Data collection, Advanced Text Understanding on multi-languages , Real-time Analytics Dashboard with data visualization, Alerting for Crucial issues, Customizable Reporting. ## Architecture Overview ![Architecture](./docs/images/Architecture.png) 1. The user sends a request to a Lambda function through API Gateway. 2. The Next.js application running in Lambda integrates with Cognito to authenticate requests. 3. The system retrieves data or analysis results from DynamoDB. 4. The user uploads source data to S3 using a presigned URL generated by the web portal's server-side. 5. Uploading a file triggers a Step Function to start data processing and analytics, including Sentiment Analysis, Block Issue detection, and Insight generation. 6. EventBridge triggers Step Functions daily for Sentiment and Insight analytics. 7. The web portal's Lambda function triggers Step Functions for ad-hoc analytics. 8. Step Functions trigger a Glue Job to process source data. 9. Step Functions trigger AWS Batch (Data Analytics module) to run Python code for data analysis. 10. Bedrock is invoked to obtain analysis results. 11. Step Functions trigger a Lambda function to load data into DynamoDB. 12. Amazon ECS Fargate get discord channel's data. 13. Amazon ECS Fargate put the data to Amazon KDS (Kinesis Data Streams). 14. Amazon KDS trigger a Lambda function to process the data and store them into DynamoDB, and also trigger Step Functions to start block issue analytics. ## Deployment ### Available Regions This asset supports deployment in global regions which support Bedrock, suggest **us-east-1** and **us-west-2** regions ### Step1. Preparations - Make sure you have an AWS account - Configure [credential of aws cli][configure-aws-cli] - Install Node.js LTS version 20 - Install Docker Engine and keep Docker started - Install pnpm `npm install -g pnpm@9.6.0` - Initialize the CDK toolkit stack into AWS environment (only for deploying via [AWS CDK][aws-cdk] for the first time), and run `npx cdk bootstrap` - Install [git][git-install] - Enable **Claude 3.5 Haiku**, **Claude 3.5 Sonnet v2** and **Embed Multilingual** model in Bedrock > **!NOTE** > It is recommended to use EC2 as the workspace to install the software mentioned above, and then deploy the asset from this EC2. Here is the sample of the commands to set up development environment in a new EC2 host of Amazon Linux 2023. ```shell # Configure aws cli aws configure # Update the system packages sudo yum update -y # Install nvm and Node.js curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash source ~/.bashrc nvm install 20 # Install Docker Engine sudo yum install -y docker # Start and enable docker service sudo systemctl start docker sudo systemctl enable docker # Add your to the Docker Group sudo usermod -aG docker newgrp docker # Verify Docker installation docker --version # Install git sudo yum install -y git # Verify git installation git --version # Configure git git config --global user.name "Your Name" git config --global user.email "your.email@example.com" # Install pnpm npm install -g pnpm ``` ### Step2. Get source code: ``` git clone git@ssh.gitlab.aws.dev:aws-gcr-solutions/industry-assets/gaming/gaming-voice-of-players-analytics.git ``` The repository on gitlab.aws.dev is for internal use only, you need to do Midway authentication before checking out the code. Follow the below instructions to set up Midway on your EC2 host. ```shell # On EC2 host # Add gitlab host to ~/.ssh/config echo -e "\ Host ssh.gitlab.aws.dev\n\ Hostname ssh.gitlab.aws.dev\n\ PreferredAuthentications publickey\n\ IdentityFile ~/.ssh/aws_id_rsa\n\ ForwardAgent yes\n" >> ~/.ssh/config # On your local laptop mwinit -f export AWS_DEV_EC2_HOST= export AWS_DEV_EC2_PEM= scp -i ${AWS_DEV_EC2_PEM} ~/.ssh/id_rsa-cert.pub @${AWS_DEV_EC2_HOST}:/home//.ssh/aws_id_rsa-cert.pub scp -i ${AWS_DEV_EC2_PEM} ~/.ssh/id_rsa.pub @${AWS_DEV_EC2_HOST}:/home//.ssh/aws_id_rsa.pub scp -i ${AWS_DEV_EC2_PEM} ~/.ssh/id_rsa @${AWS_DEV_EC2_HOST}:/home//.ssh/aws_id_rsa ``` ### Step3. deploy the asset ```shell cd src/portal pnpm install && pnpm build cd ../../ ./install.sh [-p ] [-r ] ``` This step will be deployed the web portal after above CDK completed After the deployment is completed, you can get the portal URL from the CloudFormation stack outputs - `CloudFrontDomainName` > **!NOTE** > Please check your email for the login username and password. And do not copy the point `.` at the last sentence. ## Test 1. Log into the portal. You can get the portal URL from the CloudFormation stack outputs - `CloudFrontDomainName` 2. Go to the portal Management / Channel Settings / Discord page, connect to Discord server and select channel. 3. Follow this [instruction](./test/README.md) to send messages to selected Discord channel. 4. Check the results in portal dashboard. ## Local development step 1: Add **http://localhost:3000/api/auth/callback/cognito** to cognito user pool Allowed callback URL step 2: Goto the folder: `src/portal`, run script: ```shell ./dev.sh [-p ] [-r ] ```