🧮 Abacus Training Game Architecture

Serverless Mental Math Training Platform on AWS

👤 Users
AWS Region: ap-southeast-1
Frontend Layer

📦 S3 Static Website

Bucket: abacus-training-game

• HTML5 Game Interface

• CSS3 Animations

• JavaScript Game Logic

• Responsive Design

• CloudFront Distribution

API Gateway Layer

🚪 API Gateway

RESTful API Endpoints

• POST /start-game

• POST /submit-answer

• GET /leaderboard

• CORS Configuration

• Request Validation

Serverless Compute

⚡ Lambda Functions

Python 3.9 Runtime

• Game Logic Processing

• Score Calculation

• User Authentication

• Leaderboard Management

• Auto-scaling

Database Layer

🗄️ DynamoDB Tables

NoSQL Database

• Users Table (PK: user_id)

• GameSessions Table (PK: session_id)

• Leaderboard Table (PK: game_type)

• On-demand Billing

• Point-in-time Recovery

Monitoring & Logging

📊 CloudWatch

Monitoring & Alerts

• Lambda Function Metrics

• API Gateway Logs

• DynamoDB Performance

• Error Rate Monitoring

• Custom Dashboards

🔄 Game Flow

Game Initialization

  • User loads S3 website
  • JavaScript generates problems
  • API call to start session
  • Lambda creates game record

Answer Processing

  • User submits answer
  • API Gateway validates request
  • Lambda calculates score
  • DynamoDB stores result

Leaderboard Update

  • Score comparison logic
  • Real-time ranking update
  • Top 10 players display
  • Achievement tracking

📊 Architecture Stats

4
Lambda Functions
3
DynamoDB Tables
1
API Gateway
1
S3 Bucket
0
Server Management
99.9%
Availability SLA