Skip to content

Repository files navigation

yyt examples

Sample game stacks for the yyt platform. Each sample is a standalone pnpm project on the @yingyeothon/* libraries, deployed with Serverless Framework 4 to your own AWS account. Copy one, rename the service, replace the rules.

Example Shows Start with
sample-dungeon The minimum: auth JWT accepted unchanged, match callback starts an actor, one WebSocket game loop src/game.ts
sample-morpg A MORPG loop: lobby on the gateway, instanced dungeon actor, character sheets in the doc store, two clients src/sim.ts, assets/*.json
flowchart LR
  subgraph yyt["yyt platform (console account)"]
    auth[auth channel]
    rt[match / lobby / q channel]
    store[Redis · doc store · asset CDN]
  end
  subgraph aws["your AWS account (one sample)"]
    api[HTTP + WebSocket API]
    actor[actor Lambda]
  end
  client((client)) -- JWT --> auth
  client -- same JWT --> rt
  rt -- signed callback / roster --> api
  api --> actor
  actor <--> store
Loading

Prerequisites

Need Detail
Toolchain Node ≥ 22, pnpm, Serverless Framework v4 CLI (npm i -g serverless, logged in or SERVERLESS_ACCESS_KEY), wscat, jq
AWS Credentials in the shell (AWS_PROFILE or env vars); the stacks deploy to ap-northeast-2
yyt console account plus the yyt CLI (curl -fsSL https://raw.githubusercontent.com/yingyeothon/service/main/cli/install.sh | sh, then yyt login --device)
yyt resources sample-dungeon: auth + match channel and a Redis (own, or a q channel's). sample-morpg: auth + lobby + q channel, a doc-store key, an asset bundle. Each sample README lists the commands

Check

Each sample carries its own lockfile; the repo root has no dependencies and no gate.

(cd sample-dungeon && pnpm install --frozen-lockfile && pnpm lint && pnpm typecheck && pnpm test)
(cd sample-morpg && pnpm install --frozen-lockfile && pnpm lint && pnpm typecheck && pnpm test && pnpm web:build)

Copy into your project

git clone https://github.com/yingyeothon/examples.git && cd examples
mkdir -p ~/my-game && git archive HEAD sample-dungeon | tar -x -C ~/my-game --strip-components=1
cd ~/my-game && sed -i 's/^service: .*/service: my-game/' serverless.yml && pnpm install && pnpm typecheck

Never cp -r or rsync a directory that has been deployed: .serverless/, .esbuild/ and web/dist/ hold the previous account's state and baked env values. git archive copies tracked files only.

Secrets

This repository is public. Env files, deploy output and anything naming the platform's infrastructure stay in gitignored local/; git hooks and CI enforce it. Read docs/secrets.md before committing; CONTRIBUTING.md has the setup.

License

MIT. The art in sample-morpg/assets/view is CC0 (sample-morpg/CREDITS.md).

About

Sample game stacks for the yyt platform (deployable to your own AWS account)

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages