尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證UI for a gamified marketing platform
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Picture and short-definition trivia across many topics. This repository is the web frontend (Next.js).
There are no points, leaderboards, rankings, ads or prize draws.
| Role | Home | What they do |
|---|---|---|
Player (gamer) | /user/dashboard | Play trivia, build custom trivias, upgrade to Pro |
| Brand | /brand/dashboard | Set up a brand profile, build and pay for campaigns, read campaign results |
| Admin | /admin | Manage topics, cards and global settings; moderate campaigns; view revenue |
src/lib/api.ts) with bearer auth and cookie-based token refreshThe frontend never talks to a database. Everything goes through the backend API, whose contract
is documented in docs/frontend-integration.md. That file is the
source of truth for endpoints, payloads, error codes and state machines.
npm install
cp .env.local.example .env.local # then fill it in
npm run dev # http://localhost:3000
The backend must be running and reachable at NEXT_PUBLIC_API_URL.
| Variable | Required | Purpose |
|---|---|---|
NEXT_PUBLIC_API_URL | Yes | Origin of the backend, without a path (for example http://localhost:4000). The app calls {origin}/api/v1/... |
NEXT_PUBLIC_GOOGLE_CLIENT_ID | No | Enables the Google sign-in button. Left out, the button is hidden |
Three routes are linked to from outside the app, so the backend's FRONTEND_URL must point at
wherever this frontend is served:
/q/:slug — shared custom trivia links/payment/verify?reference= — the return page after a Paystack checkout/reset-password?token= — password reset emailsToken refresh uses a refresh_token cookie, so the frontend and the API need to be able to
share cookies (same site, or a cross-site cookie setup on the backend).
| Command | What it does |
|---|---|
npm run dev | Development server |
npm run build / npm start | Production build and server |
npm run lint | ESLint |
npx tsc --noEmit | Typecheck |
npm run test / npm run test:watch | Vitest |
Docker and deployment scripts are described in DEPLOYMENT.md.
src/
├── app/
│ ├── (routes)/
│ │ ├── (private-pages)/ # Login required
│ │ │ ├── trivia/ # Topic picker and setup
│ │ │ ├── play/[sessionId]/ # Quiz → result, for every kind of trivia
│ │ │ ├── my-quizzes/ # Custom trivia list, builder and preview
│ │ │ ├── pro/ # Plan and Pro checkout
│ │ │ ├── user/ # Player home, profile, settings
│ │ │ ├── brand/ # Brand home, campaigns, profile
│ │ │ └── admin/ # Admin pages
│ │ └── (public-pages)/ # Login, register, /q/[slug], /payment/verify, ...
│ └── _utils/ # endpoints.ts, routes.ts, constants.ts
├── atom/user.ts # Logged-in user (persisted to localStorage)
├── components/
│ ├── ui/ # shadcn/ui primitives and shared widgets
│ ├── match/ trivia/ cards/ # Game screens and the shared card editor
│ ├── quizzes/ campaigns/ pro/ admin/
│ └── layout/ auth/
├── hooks/ # Game settings, plan, session start, back-navigation block
├── lib/ # API client, uploads, sound, small helpers
└── types/index.ts # All API types
A few rules shape most of the code:
deadlineAt and
serverTime; the countdown is driven from those, not the device clock. The correct answer is
only returned after a question is settled./play/[sessionId] renders from the server's session status, so a refresh
lands on the same phase and the same question with the time that is left.GET /settings/game; nothing is hard-coded.CAMPAIGN_REQUIRED and the app offers the campaign instead.npm run test covers the trivia quiz (practice pointer, timeout, forward only, resume), the campaign gate, the upgrade prompts and the small validation helpers.
Tests mock @/lib/api and render pages with a fresh query client (see src/test-utils.tsx).
Before a release, walk through docs/qa-checklist.md against a real
backend. It covers what the tests cannot: payments, uploads, sound, and layout on a phone.