Ekam

One engine, one room per code, one codebase for three platforms.

Ekam is a TypeScript monorepo: a pure rules engine, a content package with the deities and their art, a Cloudflare Worker that hosts the rooms, and an Expo app that runs on the web, iOS and Android.

Visit ek4m.com

The rules live in exactly one place

The engine package has no platform code at all: cards, rules, scoring, bots and the house rules are plain TypeScript functions over a game state. The server runs it to decide what happens; the app runs the same code to know which cards to light up. The two can never disagree, because there is nothing to disagree about.

Shuffles come from a seeded random number generator, so any game can be replayed from its seed. A simulator plays whole bot-versus-bot matches in a loop, which is how changes to a rule get checked for game length and fairness before they ship.

The Ekam home screen on a desktop browser
The web client is the first platform; the iOS and Android builds come from the same Expo project.

A room is a Durable Object

Each six-letter room code maps to one Cloudflare Durable Object, which holds that game’s state in memory and owns every WebSocket connected to it. Turn timers, disconnect grace periods and the ten-minute idle close all run inside the object, and the hibernation API means an idle room costs nothing while it waits.

Accounts are optional and social-only, through better-auth on D1. There are no passwords to store and no email to send; a guest can play every mode without signing in.

  • The green felt board with a marigold and lotus border

    The board

  • The card back: a gold mandala on deep purple

    Card back

  • An empty card frame, ready for a deity and a colour

    Card frame

  • Shiva drawn as a toddler with a trident and a drum

    A finished portrait

AI-drawn art with a human sign-off

The portraits, cheer poses and item close-ups were generated with an image model through Cloudflare AI Gateway and had their backgrounds removed by a second model, but the model never had the last word. A written character guide fixes the proportions, the mood, each deity’s attributes and skin tone, and a list of things that are never shown. Every image went through review rounds against that guide, and the deity list itself has a recorded cultural sign-off.

Ads and in-app purchases sit behind TypeScript interfaces with mock implementations, so the game runs end to end with no third-party SDK installed.

Shipping

Every merge to the main branch deploys the API and the web client to staging, where a script plays a full smoke game against bots before the deploy is called good. Publishing a GitHub release deploys production. Rolling back is re-running the last good release.

The project was built with an AI orchestrator working from a written manifest, with hard checkpoints where the owner reviewed and approved each phase. That process is itself part of what this site is here to show.

By the numbers

1
rules engine, shared by server and app
2 to 10
players per room
300+
automated tests
3
platforms from one codebase