I fixed the client/frontend responsiveness and maps keys being duplicated or null in component map renders
Abdul Barry A. Adam
Quizzy is a quiz platform where you can pick a topic and play at your own pace, or bring everyone together for a live qu
Made by
@abdul-barry-a-adam
Backend Developer | Tech Enthusiast
Small questions. Bright minds. Good company.
Quizzy is a quiz platform where you can pick a topic and play at your own pace, or bring everyone together for a live quiz night. Hosts can build quizzes by hand or generate questions with AI, then review and edit everything before the quiz is created.
Status: MVP in active development. Quizzy is a Turborepo monorepo with a Fastify API (
apps/server), a React web app (apps/client), and shared Zod schemas (packages/shared).
Quizzy separates content from play:
| Concept | What it is |
|---|---|
| Quiz | The reusable content: title, category, and an ordered list of questions. Source is MANUAL or AI. |
| Quiz session | One play-through of a quiz: mode (SOLO or LIVE), join code, status, timer, participants, and results. |
| Participant | A user inside one session. Answers belong to the participant, so replays and repeat sessions never collide. |
A solo play is simply a session with one participant. A live game moves through LOBBY → ACTIVE → FINISHED.
Question progression is driven by server deadlines rather than browser-only intervals. The client derives remaining time from the persisted question start time and the session's configured seconds per question, then resyncs after a reconnect. Answers submitted after the grace window are rejected, duplicate submissions are ignored, and expired questions advance automatically.
Sessions use HttpOnly cookies for the access and refresh tokens. Refresh tokens rotate on use, and unsafe HTTP requests require an X-CSRF-Token header that matches the csrf_token cookie. WebSocket connections reuse the access cookie and verify the origin against CORS_ORIGINS.
The quiz detail page lives at /dashboard/quiz/:id. It reads GET /quiz/:id/stats and authenticated GET /quiz/:id/questions; answer review during a session uses GET /session/:id/answers.
The data model lives in apps/server/prisma/schema.prisma. For a visual overview, see apps/server/db.dbdiagram and apps/server/db.dbml.
| Layer | Technology |
|---|---|
| Monorepo | Turborepo + pnpm workspaces |
| Language | TypeScript |
| Backend | Fastify 5 |
| Validation | Zod (shared schemas via @quizzy/shared) |
| Database | PostgreSQL |
| Cache / rate limiting | Redis |
| Object storage | Supabase Storage for uploaded images |
| ORM | Prisma 7 (with the pg driver adapter) |
| Authentication | HttpOnly cookie sessions (JWT access + rotating refresh tokens), CSRF double-submit tokens, and bcryptjs |
| Frontend | React 19 + Vite |
| Routing | React Router 7 |
| Data fetching | TanStack Query |
| Styling / UI | Tailwind CSS v4 + shadcn/ui (Base UI) |
| HTTP client | Axios |
| AI generation | Groq (groq-sdk), reviewed by the host before saving |
quizzy/
├── apps/
│ ├── client/ # React web app (Vite)
│ │ └── src/
│ │ ├── pages/ # Landing, auth, dashboard, host tools
│ │ ├── components/ # UI and shared components
│ │ ├── context/ # Auth and theme providers
│ │ └── hooks/ # Query and data hooks
│ └── server/ # Fastify API
│ ├── prisma/ # Schema and migrations
│ └── src/
│ ├── modules/ # auth, users, quiz, category, question, session, ai
│ ├── plugins/ # Prisma, JWT, Redis cache/rate limit, Supabase uploads, query builder
│ └── config/ # Environment validation
├── packages/
│ └── shared/ # Zod schemas, timer helpers, and shared types
├── turbo.json
├── pnpm-workspace.yaml
└── package.json
corepack enable is recommended)# 1. Clone the repository
git clone https://github.com/WareBar/quizzy.git
cd quizzy
# 2. Install all workspace dependencies
pnpm install
Create apps/server/.env from the example file:
cp apps/server/.env.example apps/server/.env
Then fill in the values:
NODE_ENV=development
PORT=3000
DATABASE_URL="postgresql://USER:PASSWORD@localhost:5432/quizzy"
JWT_SECRET="replace-with-a-long-random-secret"
ACCESS_TOKEN_TTL=15m
REFRESH_TOKEN_TTL=7d
CORS_ORIGINS=http://localhost:5173,http://127.0.0.1:5173
COOKIE_DOMAIN=
COOKIE_SECURE=false
COOKIE_SAME_SITE=lax
GROQ_API_KEY="your-groq-api-key"
SUPABASE_URL="https://your-project.supabase.co"
SUPABASE_KEY="your-supabase-key"
SUPABASE_BUCKET="quizzy"
REDIS_URL="redis://localhost:6379"
ACCESS_TOKEN_TTL, REFRESH_TOKEN_TTL, CORS_ORIGINS, and the COOKIE_* values have defaults, but setting them explicitly keeps local and deployed behavior aligned.
Optionally, point the client at the API by creating apps/client/.env:
VITE_BACKEND_URL=127.0.0.1:3000
The client prepends
httpfor127.0.0.1/localhostaddresses andhttpsotherwise. Do not include the protocol, trailing slash, or trailing whitespace inVITE_BACKEND_URL.
Never commit your .env files.
The deployed web app and API are on different sites:
| App | Origin |
|---|---|
| Client | https://quizzylo.vercel.app |
| API | https://quizzyserver-production-c4124e03.up.railway.app |
Use these API env values:
CORS_ORIGINS=https://quizzylo.vercel.app
COOKIE_SECURE=true
COOKIE_SAME_SITE=none
COOKIE_DOMAIN=
And this client env value:
VITE_BACKEND_URL=quizzyserver-production-c4124e03.up.railway.app
Because the origins differ, browser JavaScript cannot read the API host's csrf_token cookie. The client calls GET /auth/csrf, keeps the returned token in memory, and sends it as X-CSRF-Token on unsafe requests. Login, register, and refresh reuse the existing CSRF token instead of rotating it. This setup still relies on third-party cookies being allowed by the browser.
# Apply migrations and generate the Prisma client
pnpm --filter @quizzy/server prisma:migrate
pnpm --filter @quizzy/server prisma:generate
pnpm dev
Turbo starts both apps with hot reload:
Use this dummy account to explore the dashboard and test the app:
| Username | Password |
|---|---|
barrydam |
barrydam123 |
| Command | Description |
|---|---|
pnpm dev |
Run all apps in development mode |
pnpm build |
Build all apps (client and server type-check as part of the build) |
pnpm lint |
Lint packages that define a lint task |
pnpm typecheck |
Type-check packages that define a typecheck task |
pnpm --filter @quizzy/server prisma:studio |
Open Prisma Studio |
source = AI.Generated content is a draft, not a final result. The host is always the editor of record.
This is currently a personal project. Issues and suggestions are welcome.
MIT
© 2025 Quizzy

Dermalens
DermaLens is an experimental computer vision project. Shine scores are estimates, not measurements of sebum production o
Live
qr-box-reader-extension
Scan QR codes without a phone with extension. Select a QR image on your screen and get the link
Building
ChatTalk
A real-time chatting web app, made to practice django web socket
Paused
ClueFinding
A One Piece Clue Finding app where the users inputs clues in order to get the name of the user that has the Will of D
BuildingAbdul Barry A. Adam
I fixed the client/frontend responsiveness and maps keys being duplicated or null in component map renders
Building a dev tool or hiring developers? Get seen here. Become our Sponsor
Building a dev tool or hiring developers? Get seen here. Become our Sponsor