← All work

05 / 05 · NUS Orbital 2024

GeNiUS

Search first, ask second, and find a mentor if you’re still stuck.

TypeScript · Next.js 14 · Auth.js · Zod · TanStack Query · PostgreSQL · Drizzle · Docker · Vitest · Playwright

View on GitHub ↗

A discussion with an anonymous reply, upvotes and Load More (demo data)

The problem

NUS students often don’t know who to ask for module help, hesitate to ask in public, or want advice from someone who already took the module. Ed Discussion gets little input from seniors, and Telegram chats offer no anonymity and no way to check who’s answering. GeNiUS adds module-tagged posts, anonymous posting, and profiles that show the modules each person has taken.

My role

Team of two for NUS Orbital 2024. I built discussions and comments, their pagination, admin moderation, and a large share of the tests.

How it works

  1. InputPost formTitle, body, tag, up to 3 images
  2. Auth gateCheck session userCaller must be the author
  3. Schema gateValidate and filterZod schema and profanity list
  4. MediaConvert and hash imagesAVIF files named by SHA-1
  5. StoreWrite in transactionRow and counters change together
  6. OutputRank and loadCursor pages, most upvoted first

Model stepHuman or code gatePlain step

What I built

Trust boundaries · who can do what

Hardest part

Comments are ranked by upvotes, which change while people scroll, so page numbers would skip or repeat. I used a cursor that reads the last comment’s upvotes and date and fetches only what ranks after it. Deleted comments stay for their replies and are placed after the live ones.

Outcome

Was deployed as a live site and presented at Orbital 2024 across three milestones. CI runs lint, unit tests and Playwright end-to-end tests on every push and pull request.