A shared board where team members can post questions and upvote the ones they care about most.
- Runtime: Node.js with Express 5
- Database: Supabase (PostgreSQL)
- Tests: Vitest + supertest
See CONTRIBUTING.md for coding conventions, linter usage, and API response rules.
Go to the GitHub issues. Check the "Blocked by" section — don't start an issue until its blockers are merged.
Never commit directly to main. Name the branch after the issue: issue-NN-short-description:
git checkout main
git pull
git checkout -b issue-8-username-middlewareBefore writing any implementation code, write a failing test first. This is called red-green-refactor:
- Red — write a test that describes the behavior you want. Run it and confirm it fails.
- Green — write the minimum code to make the test pass.
- Refactor — clean up the code without changing the behavior. Run the tests again to confirm they still pass.
npm test # run tests in watch mode
npm run test:run # run tests onceEach issue has acceptance criteria with specific test cases listed. Use those as your starting point.
When your branch is ready:
git push -u origin issue-8-username-middlewareThen open a PR on GitHub. In the PR description, reference the issue it closes:
Closes #8
At least one teammate must review and approve your PR before it can be merged. Review someone else's PR while you wait — the team moves faster when reviews are not a bottleneck.
Once approved, merge the PR into main on GitHub. Delete the branch after merging.
-
Install dependencies:
npm install
-
Copy
.env.exampleto.envand fill in your Supabase credentials:cp .env.example .env
The
.env.examplefile includes instructions for setting up the Supabase project and running the required SQL. -
Start the server:
npm start
All requests require an x-username header.
| Method | Path | Description |
|---|---|---|
GET |
/questions |
List all questions, sorted by votes |
POST |
/questions |
Post a new question { text: string } |
POST |
/questions/:id/vote |
Upvote a question (once per user) |