Project Info
Inspiration
I had been meaning to scaffold this one for a while. The idea started at my day job, where sales contests are a real thing that runs on whiteboards, spreadsheets, and whoever remembers what changed. I had also started sketching a version of it for a gaming group, as a scoreboard for friendly competition as I always have trouble imagining fake data. Neither version got far, but the ideas were all resting. Build Week was the forcing function. It let me restart from zero, aim the idea at restaurant sales where the mechanics are sharpest, and use the whole thing as a real test of what Codex and GPT-5.6 can carry. A hackathon deadline is a better project manager than good intentions.
What it does
SIM runs a weekly sales contest for a restaurant floor team, end to end. Managers set a goal and a prize, then describe the contest they want in plain words. GPT-5.6 turns that into a validated contest configuration. Servers compete on a live dashboard that ranks them across sales metrics, contest goals, and daily Bingo wins. Shift leaders log contest quantities and returned Bingo cards during service. Everything funnels into one auditable prize drawing at the end of the week. The pieces: Live dashboard. Every server ranked against the active contest, with switchable performance lenses, current prize, target, last winner, and deadline always visible. AI Contest Designer. A manager's plain-words goal becomes a validated contest config: GPT-5.6 structured output under a strict JSON schema, then local validation of every menu ID and contest rule. Printable Server Bingo. Randomized five-by-five cards drawn from the active contest's menu pool, one clean card per page, legible at arm's length. Sales games. The same live totals drive a visible floor race and a shared goal board. Final awards convert into wheel entries. Auditable prize wheel. The draw resolves and saves an immutable snapshot first. Only then does the wheel animate toward the already-recorded winner. The show stays exciting without letting the animation decide anything. Sales data entry and import. Shift leaders add contest-only quantities without inventing check data, and managers import their own sales through a shared spreadsheet schema. Corrections are preserved in an audit trail. Every screen works on a fresh clone with no API key and no account. All data shown is fictional. How I built it Next.js 15 App Router with TypeScript and Tailwind, React 19, SQLite through better-sqlite3 with plain readable SQL, Vitest for the metric formulas. Local-first by design: npm install && npm run seed && npm run dev and you have a working app. No auth, no cloud, no deployment step, no POS integration. I wrote a specification first, then built it in Codex sessions against that spec. The spec defined the data model, the exact metric formulas, the contest config shape, and a cut list of things explicitly not being built. Having the cut list in writing mattered more than I expected; it was the thing I pointed at whenever a session started drifting toward scope that would not ship by Tuesday. Two rules shaped most of the architecture. Metrics are always computed in queries and never stored, so no number on screen can drift from the sales records behind it. And the no-key fallback is sacred: if OPENAI_API_KEY is missing, the Contest Designer serves a versioned sample config instead of throwing, so the whole product stays demoable for anyone who just cloned it. The MCP angle. This is the part I did not expect going in. I built two local MCP servers so an agent could operate the app the way a manager or shift leader actually would: sim_boh_pos records fully itemized fictional closed checks as a synthetic point-of-sale feed. sim_ops reads runbooks and current state, previews irreversible operations before committing them, executes role-aware idempotent operations, and returns receipts plus screenshot paths. On top of those, the repo carries canonical JSON runbooks that are both human documentation and agent-executable scripts. An agent can run the Contest Manager or Shift Manager workflow end to end against a disposable copy of the database, produce reconciled receipts and screenshot evidence, and hand back a run package that a verifier script checks for structural completeness. It is a way of testing an app through its actual operator workflows instead of through unit tests alone. Both MCP servers are local STDIO processes, and sim_ops refuses to talk to anything that is not localhost. The demo video is built the same way: demo/manifest.json is the scene plan, a capture script drives Playwright against the running app, and an FFmpeg renderer assembles the master. The prompt that specified that pipeline is versioned in the repo next to the code it produced. Challenges I ran into Keeping the demo honest. Early on it was tempting to record the Contest Designer with a key configured and quietly skip what happens without one. Instead the video shows a live API response and states the fallback behavior plainly. The fallback is a feature, not an embarrassment, and pretending otherwise would have made the whole demo less trustworthy. Animation cannot decide the outcome. The first prize wheel resolved the winner from wherever the animation happened to stop. That is a fun spinner and a terrible system of record. Rewriting it so the draw persists first and the wheel animates toward a recorded result was a small change with a large consequence: the drawing became auditable, and a manager can prove after the fact who won and why. Agent rehearsals found less than I hoped. I invested real time in agent-executable runbooks expecting them to surface product defects. They mostly proved the app already worked and surfaced gaps in my own evidence contract instead. Useful, but not the payoff I had planned. Knowing which techniques do not pay off is worth something, and it is the honest result. Working across two AI tools. Core functionality was built in Codex. I also kept a reviewer in the loop to audit completion claims against the written spec line by line. That division caught real things and kept "it runs" from being mistaken for "it is done." Accomplishments that I'm proud of The zero-config promise holds. Clone it, seed it, run it, and every feature is demoable in under a minute with no key and no account. The prize drawing is genuinely auditable. Immutable entry snapshot, recorded winner, visible drawing history, and an animation that reports the result instead of producing it. The demo video is reproducible from the repository rather than hand-edited once and lost. The scene plan is a versioned artifact, and so is the prompt that generated the pipeline. 45 tests green, production build clean, everything committed. What I learned Writing the specification before opening a Codex session changed the quality of what came out of it. So did having a completion definition that meant something specific: acceptance criteria met, tests green, build passing, work committed, docs current. "The code runs" is not a finish line. The other lesson is that prompts are code. I lost a theme-generator prompt to a chat window mid-build and had to reconstruct it. Any prompt that generates part of the product now lives in the repo, versioned next to the schema it produces.
What's next
for SIM Remote sales entry first: a simple phone panel for shift managers that feeds the live dashboard during service, so entry happens on the floor instead of at the back office computer. After that, the list the rehearsals actually earned. Pre-finalization reconciliation so every tally is checked before a contest closes. Wheel provenance with visible odds, so servers can see exactly why they had the entries they had. Role-guarded lock and award controls, so a shift leader cannot trip a manager-only action.
Sales Incentive Machine
SIM is a local-first restaurant sales-contest workspace. Managers configure goals and prizes, shift leaders enter live contest quantities and returned Bingo cards, and the team can present gameboards and one auditable prize drawing.
Built for OpenAI Build Week in Codex with GPT-5.6. Watch the demo.
Judging this? Start with JUDGES.md for a five-minute guided tour.
All included restaurant, server, menu, check, and contest data is fictional.
How Codex and GPT-5.6 built this
Codex wrote the product. Every feature in this repository was built in Codex sessions against a written specification (docs/superpowers/specs/2026-07-13-sim-design.md), which defined the data model, exact metric formulas, contest config shape, acceptance criteria, and an explicit cut list. Session IDs for each build thread are logged in SUBMISSION.md. The model was GPT-5.6 at high reasoning effort throughout.
GPT-5.6 is also a runtime dependency. The Contest Designer (app/api/contest-designer/route.ts) is the product's AI surface: a manager describes the contest they want in plain words, and GPT-5.6 returns a complete contest configuration through the Responses API using strict json_schema structured output. The response is then validated locally against real menu IDs and contest rules. A validation failure feeds the specific error back into a second attempt; if that also fails, or if no key is present, the app loads a versioned sample config instead of erroring. The AI writes the contest, but the app decides what is valid.
Codex agents operated the app through MCP. The repo ships two local Model Context Protocol servers so a Codex agent could drive the product the way a real operator would:
sim_boh_posrecords fully itemized fictional closed checks as a synthetic point-of-sale feed.sim_opsreads runbooks and current state, previews irreversible operations before committing them, executes role-aware idempotent operations, and returns receipts plus screenshot paths.
Paired with the agent-executable runbooks in runbooks/, this let Codex rehearse the full Contest Manager and Shift Manager workflows against a disposable copy of the database, then hand back a run package of reconciled receipts and screenshot evidence that npm run runbook:verify checks for completeness. Testing the app through its actual operator workflows, not only through unit tests.
Codex built the demo pipeline too. The submission video is reproducible from this repository: demo/manifest.json is the scene plan, scripts/demo-video/capture.mjs drives Playwright against the running app, and scripts/demo-video/build.mjs renders the master with FFmpeg. The prompt that specified that pipeline is versioned at docs/prompts/demo-video.md, next to the code it produced.
Run it without installing anything
Click the badge. The container installs dependencies, seeds the deterministic fictional database, starts the dev server, and opens SIM on the forwarded port 3000. No key, no account, no local setup.
If the preview does not open on its own, run npm run dev in the Codespace terminal and open the forwarded port. Setup is already done by then; the database is seeded during container creation.
There is no hosted public instance by design: SIM is local-first, writes to a SQLite file, and ships with a deterministic seed so every run starts from the same known state.
Start locally
npm install
npm run seed
npm run dev
Open http://127.0.0.1:3000. No environment variable or OpenAI key is required. When no key is configured, Contest setup uses the versioned fallback contest.
Enable the live Contest Designer (optional)
Create .env.local in the repo root:
OPENAI_API_KEY=sk-...
With a key set, Contest setup sends the manager's plain-words goal to GPT-5.6 (override with OPENAI_MODEL) under a strict JSON schema, retries once on validation failure, and still falls back to the versioned sample config if both attempts miss. Without a key, every feature stays fully demoable.
Demo video pipeline
The submission video is reproducible from the repo: demo/manifest.json is the scene plan, node scripts/demo-video/capture.mjs demo/manifest.json captures footage from the running app, and node scripts/demo-video/build.mjs demo/manifest.json renders the master (ffmpeg required on PATH). The prompt that specified the pipeline is versioned at docs/prompts/demo-video.md.
Operating guides
- Contest Manager runbook
- Shift Manager runbook
- Agent-executable runbook specification
- Local operations API and MCP guide
The human guides, agent prompts, screenshot checklist, and verifier all use the canonical JSON manifests in runbooks/.
Disposable discovery runs
npm run runbook:scaffold -- --scenario shift-live-entry
npm run runbook:serve -- --run <run-id> --port 3100
npm run runbook:verify -- --run <run-id>
Each run receives a copy of data/sim.db; operating the run never changes the source database. Run artifacts live under the ignored artifacts/runbook-runs/ directory.
Available scenarios are manager-item-contest, manager-late-information, shift-live-entry, and shift-error-recovery.
Local agent tools
The project registers two separate optional MCP servers:
sim_boh_posrecords fully itemized fictional closed checks as a synthetic POS feed.sim_opsreads runbooks and current state, previews irreversible work, executes role-aware idempotent operations, and returns receipts plus screenshot paths.
Both are local STDIO processes. sim_ops only connects to an HTTP origin on localhost, 127.0.0.1, or ::1. Restart Codex after changing .codex/config.toml so the project MCP registrations reload.
Verification
npm test
npm run build
Analysis
View
Metric
- 27
- 19
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- HTMLIn code
- JavaScriptIn code
- Next.jsIn code
- ReactIn code
- SQLIn code
- TypeScriptIn code
- Node.jsClaimed
- Tailwind CSSClaimed
7 of 9 appear in the indexed code. 2 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- Claude CodeCommits
- CodexConfig
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
466 KB
Source files
95
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
estevanhernandez-stack-ed/sales-incentive-machine
128 files · 720 KB · @ c903291
Structure
Interface
18 files · 14%Screens, components and styles rendered to the user.
+1 moreAPI & routing
22 files · 17%Request entry points: routes, handlers and controllers.
Application logic
25 files · 20%Domain rules, services and shared utilities.
+3 moreData & schema
10 files · 8%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- TypeScript47%
- Markdown35%
- CSS9%
- HTML6%
- JavaScript1%
- SQL1%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
package.json
npm · 12- @types/better-sqlite3
- better-sqlite3
- next
- react
- react-dom
- +7 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.