GameCraft

What is the GameCraft?

The GameCraft is a production-ready monorepo template for building full-stack web applications on AWS. It provides:

  • Backend API — A serverless REST API built with Hono running on AWS Lambda, featuring OpenAPI documentation and Cognito authentication.
  • Frontend SPA — A React single-page application built with Vite, Redux Toolkit, and Tailwind CSS, served via CloudFront.
  • Infrastructure as Code — AWS CDK stacks that provision API Gateway, Lambda, DynamoDB, Cognito, CloudFront, S3, and more.
  • AI Game Studio — Agent-driven game creation with polled progress updates and in-browser game previews, running agent turns on a per-conversation Bedrock AgentCore runtime.
  • Getting Started — Set up your local development environment and run the application.
  • Architecture — Understand the backend layered pattern, frontend module structure, and dependency injection.
  • CI/CD & Environments — Learn about deployment workflows, environment types, and the release pipeline.
  • API Reference — Interactive API documentation auto-generated from the deployed OpenAPI specification.

High-Level Architecture

The repository is organized as a pnpm monorepo with six workspace packages:

Package Path Purpose
backend apps/backend/ Hono API server, Lambda handlers, DI containers, business logic
frontend apps/frontend/ React SPA with Vite, Redux Toolkit, and Tailwind CSS
infra apps/infra/ AWS CDK constructs and stacks for all cloud resources
shared packages/shared/ Shared TypeScript types, constants, and oRPC API contracts
api-tests packages/api-tests/ Auto-generated and hand-written integration tests for the API
sync packages/sync/ Sync-from-starter tool for pulling upstream improvements

The shared package acts as the single source of truth for API contracts. Backend oRPC routers implement contracts from packages/shared/api/, the frontend builds typed oRPC clients from those contracts, and API tests use the same contracts for typed calls.

Environments

The monorepo supports three environment types, each with different configurations:

Type Name Pattern Purpose Lifecycle
Production production Live user-facing environment Manual deploy via workflow_dispatch
Integration integration Staging and continuous integration Auto-deploys on merge to main
Ephemeral pr0001pr9999 Per-PR preview environments Auto-created on PR, destroyed on close

Key differences between environments:

  • Data retention: Production retains DynamoDB tables on stack deletion; integration and ephemeral destroy them.
  • Self-signup: Only enabled on ephemeral environments for easy testing.
  • SSO sign-in: Available on production and integration; disabled on ephemeral.
  • Source maps: Included in integration and ephemeral builds for easier debugging; excluded from production.

For a full comparison, see the CI/CD & Environments guide.