How abstractplay/node-backend works
Project type and purpose
• This is a serverless Node.js “backend for AbstractPlay” that exposes a REST-style API via AWS API Gateway and AWS Lambda functions. It uses AWS DynamoDB as its single table data store, and AWS Cognito to manage authentication and authorization. Utility scripts live in a “utils” folder for batch or maintenance jobs, and i18n support is provided via translation JSON files in “locales.”
File structure
• Top-level configuration files
• serverless.yml: declares all Lambda functions, HTTP events, DynamoDB table settings, and Cognito authorizer settings
• .github/workflows/…: GitHub Actions that automatically deploy dev and prod on branch commits
• tsconfig.json, package.json, .eslintrc.json: TypeScript, dependency, and lint setups
• “api” directory
• abstractplay.ts: main Lambda handler implementing the REST API routes
• “lib” directory
• Shared helper modules (country code mapping, ISO conversions) compiled from TS to JS
• “utils” directory
• Stand-alone TypeScript scripts for database dumps, record migrations, tournaments, summaries, etc. invoked manually or via cron
• “locales” directory
• i18next JSON files for English, French, Italian used at build time by i18next-parser.config.js
• index.html
• A minimal static file (could be a test page or landing page)
README for additional insights
• Cognito user pools for Dev/Prod are configured and referenced in serverless.yml.
• All data lives in a single DynamoDB table with a composite primary key design (pk, sk) implementing many entity-types in one table.
• Utilities and Lambdas use AWS SDK to read/write items according to the single-table schema.
• GitHub Actions trigger deployments automatically on branch pushes.