8000 GitHub - ammubhave/wow: Puzzle hunt collaboration software used by the Wafflehaüs team for the MIT Mystery Hunt · GitHub
[go: up one dir, main page]

Skip to content
ammubhavePublic

About

Puzzle hunt collaboration software used by the Wafflehaüs team for the MIT Mystery Hunt

Topics

Resources

Stars

2 stars

Watchers

3 watching

Forks

Latest commit

 

History

515 Commits

Folders and files

Repository files navigation

Wafflehaüs Organized Workspaces (WOW)

Welcome to WOW! This is a puzzle-hunt collaboration platform to provide teams with a central workspace where they can manage and collaborate on puzzles, track progress, and communicate effectively.

The platform is available at www.wafflehaus.io for use. If you would like to contribute to the codebase, please follow the instructions below to set up the development environment.

Getting Started

You need to install Node.js prior to running this project. The recommended method is to use nvm:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

Next, clone the repository and navigate into the project directory.

git clone git@github.com:ammubhave/wow.git
cd wow

You will require a .env.keys file in the project root that contains the private keys for decrypting the secrets necessary to run the project. Please reach out to the project maintainer to obtain this file. Note that project can still be run locally for development purposes without all the secrets, but certain features will not work as expected.

Next, run the following commands to install dependencies, set up the database, and start the development server:

nvm use
corepack enable pnpm
pnpm install
pnpm db:migrate
pnpm run dev

Tech Stack

WOW is a single-page React app served by one Cloudflare Worker. The Worker serves the app shell as a static file and runs only /api/*.

Frontend

Backend

Integrations

  • The Google Drive and Sheets APIs, for teams that keep puzzle sheets in Google Drive (optional).
  • A Discord bot, for puzzle channels and voice.
  • PostHog for product analytics and error tracking.

Tooling

  • Vite+ (vp) runs the dev server, build, tests (Vitest), linting (Oxlint, with type checks) and formatting.
  • Tests: pnpm test:unit for pure modules (in Node), and pnpm test:workers for the Durable Objects and D1, inside the Workers runtime (Workers Vitest integration, test/workers). pnpm build runs both.
  • pnpm for packages, Wrangler for Cloudflare, and dotenvx for encrypted secrets.
  • Pushes to main deploy to production through Workers Builds.

Before sending a change, run:

pnpm lint
pnpm build

Chrome Extension

extension/ is the WOW Chrome extension (WXT + React). It reuses the website's code (@/ is src/): the oRPC client, the puzzle panel, chat, voice and presence. It signs in through WOW's OAuth provider (better-auth's OAuth 2.1 provider, /api/auth/oauth2/*) as a first-party public client, and calls the same API and websocket rooms with its access token instead of the session cookie (see src/lib/extension.ts, src/lib/api-endpoint.ts and src/server/request-session.ts).

  • pnpm ext:dev builds it against a local WOW (WOW_ORIGIN, default http://localhost:3140) and opens Chrome with it loaded.
  • pnpm ext:build builds it for production (extension/.output/chrome-mv3). pnpm ext:zip packs it for the Chrome Web Store.
  • pnpm ext:check type-checks it.

The extension's ID (nimgpjcklefjcmbfjhminmkhhjdkicck) is the one the Chrome Web Store gave it. Development builds get the same ID from the store's public key in extension/.pubkey; pnpm ext:zip leaves the key out, since the store refuses a package with one. The ID is in src/lib/extension.ts, which the server's trusted origins use, and in the OAuth client's redirect URI (a migration).

Database Migrations

Schema changes go through Drizzle migrations in migrations/:

  1. Edit src/lib/db/schema.ts.
  2. pnpm db:generate writes a new migration. Review the SQL before committing it.
  3. pnpm db:migrate applies pending migrations to your local database.
  4. After merging, pnpm db:migrate:prod applies them to production (node scripts/migrate-d1-prod.mjs --dry-run lists what is pending). Apply migrations before deploying code that depends on them.

drizzle-kit push is disabled for production. On D1, a migration that rebuilds a table (DROP TABLE) cascade-deletes every row that references it, because D1 ignores PRAGMA foreign_keys=OFF. pnpm db:generate and both migrate commands refuse such migrations until the dependent rows are preserved (see scripts/2026-10-01-d1-reconcile-schema.sql) and the migration is marked -- d1-cascade-reviewed.

Secrets Management

All secrets are checked in encrypted format using DotenvX. To make changes to your secrets, follow the instructions below.

  1. Make changes in .env.local file.

  2. Encrypt the .env.local file using the command below.

pnpm encrypt
  1. Commit the changes to the .env.local.encrypted file to source control.

  2. Update the secret in the Cloudflare dashboard.

License and Contributions

Please refer to the LICENSE file for the applicable terms.

Contributions are welcome. By submitting a contribution (e.g. a pull request), you agree that it may be used and incorporated into the project and that the ownership of such contributions shall be assigned to the project maintainer in accordance with the terms of the LICENSE file.

About

Puzzle hunt collaboration software used by the Wafflehaüs team for the MIT Mystery Hunt

Topics

Resources

Stars

2 stars

Watchers

3 watching

Forks

Used by

Contributors

Languages

0