Skip to content

FewStrokes MVP: add Node server, client UI, tests, and DB schema#1

Draft
fadelbay wants to merge 1 commit into
mainfrom
codex/build-fewstrokes-mobile-and-web-app
Draft

FewStrokes MVP: add Node server, client UI, tests, and DB schema#1
fadelbay wants to merge 1 commit into
mainfrom
codex/build-fewstrokes-mobile-and-web-app

Conversation

@fadelbay

Copy link
Copy Markdown
Owner

Motivation

  • Provide a minimal MVP for the FewStrokes game that serves both API and web client from a single Node.js server and establishes basic gameplay flow and persistence model.
  • Expose endpoints for a daily deterministic challenge, attempt submission, voting, leaderboard, and reporting to enable early integration and testing.
  • Ship a simple, touch-friendly drawing client so the app is immediately playable in browsers and on mobile.
  • Add a draft PostgreSQL schema to capture users, challenges, attempts, votes, and reports for future production persistence.

Description

  • Added a lightweight HTTP server at apps/api/src/server.mjs that serves API endpoints (/health, /challenges, /challenges/:id, /challenges/:id/leaderboard, /challenges/:id/attempts, /attempts/:id/votes, /attempts/:id/reports) and static files from the client directory, plus a seeded daily challenge generator and in-memory storage for attempts and reports.
  • Implemented a client in apps/client/ with index.html, app.js, and styles.css that renders the base path, enforces stroke/ink rules, lets users submit attempts, and interact with the leaderboard and voting endpoints.
  • Added an automated test apps/api/test/server.test.mjs that boots the server, verifies challenge listing, submits an attempt, casts a vote, and checks the leaderboard ordering.
  • Added infra/sql/schema.sql to define the initial PostgreSQL schema for users, challenges, attempts, votes, and reports, plus indexes, and included project files: package.json, .gitignore, and README.md with run/test instructions.

Testing

  • Ran the API test suite via the project test script (NODE_ENV=test node --test apps/api/test/server.test.mjs).
  • The test sequence started the server, validated challenge retrieval, submitted an attempt, posted a vote, and confirmed the leaderboard update, and it passed.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant