System architecture

BrandQuest architecture

A serverless, event-sourced platform designed to scale from a single campaign to millions of game attempts without expensive always-on infrastructure.

Amazon DynamoDB is used for high-volume game attempts, leaderboard events, reward claims, campaign analytics, and player progression.

Vercel Frontend (Next.js App Router)

Server components render dashboards, the arcade, and the campaign builder. Edge-cached marketing pages.

Next.js Server Routes & Actions

All mutations flow through server code: campaigns, attempts, leaderboards, analytics, custom-game review.

Auth Layer

Role-aware sessions (Player / Creator / Admin), prepared for Google + email sign-in. Secrets stay server-side.

Score Validation & Anti-cheat

Rejects impossible scores, expired campaigns, over-limit and duplicate attempts; flags suspicious play.

Analytics Event Capture

Each interaction emits a typed event (viewed, started, submitted, validated, claimed) for creator analytics.

Leaderboard Query Pattern

Attempts stored with zero-padded scores in the sort key — leaderboards read back pre-sorted.

Reward Claim Workflow

Eligible winners claim rewards; claims are stored and surfaced in creator analytics.

Amazon DynamoDB

Single-table design for campaigns, attempts, leaderboards, reward claims, analytics, and player progression.

Cost safety layer

BrandQuest deliberately uses only serverless, pay-per-use building blocks to keep AWS costs predictable.

DynamoDB only

No EC2, RDS, Aurora, NAT Gateway, Load Balancer, SageMaker, Bedrock, or OpenSearch. One pay-per-request table.

Budgets are alerts

AWS Budgets notify — they do not hard-cap spend. Resources are created manually and kept minimal. See AWS_SETUP_LATER.md.

Custom game review workflow

  1. 1. Submit: Creators submit custom game metadata (never executable code).
  2. 2. Review: Admins review against a security checklist and approve or reject.
  3. 3. Sandbox: Approved games run in a restricted sandboxed iframe.
  4. 4. Score: Scores are reported through the secure, validated score API.