How bojanognjen/quizzical works
Quizzical is a small browser-based trivia quiz. A player starts a game, the Quiz component fetches five questions from Open Trivia DB, and then displays loading, error/retry, or quiz states. Players select answers in each question, submit to see their score, and can reset to start again. Shared trivia types form an internal contract between fetching and presentation. The runtime excerpts show these main calls; the README documents static hosting, which is deployment rather than a product workflow.
Main entry points: Quiz.tsx Quiz controller · GameScreen.tsx Game screen · trivia.ts Trivia fetcher · StartScreen.tsx Start screen
Components 11
App shell
- Root layout
app/layout.tsx - Quiz page
app/page.tsx - Global styles
app/globals.css
Quiz experience
- Quiz controller
components/Quiz.tsx - Start screen
components/StartScreen.tsx - Game screen
components/GameScreen.tsx - Question item
components/Question.tsx
Trivia data
- Trivia fetcher
api/trivia.ts - Open Trivia DB
- Trivia types
types.ts
Other components
- Player
Connections 13
- Root layout → Global styles: imports
app/layout.tsx - Quiz page → Quiz controller: renders
app/page.tsx - Player → Start screen: starts quiz
components/StartScreen.tsx - Quiz controller → Start screen: renders
components/Quiz.tsx - Start screen → Quiz controller: calls start
components/StartScreen.tsx - Quiz controller → Trivia fetcher: fetches questions
components/Quiz.tsx - Trivia fetcher → Open Trivia DB: requests questions
api/trivia.ts - Quiz controller → Game screen: renders
components/Quiz.tsx - Game screen → Question item: renders questions
components/GameScreen.tsx - Game screen → Quiz controller: calls reset
components/GameScreen.tsx - Trivia fetcher → Trivia types: uses response type
api/trivia.ts - Game screen → Trivia types: uses response type
components/GameScreen.tsx - Question item → Trivia types: uses question type
components/Question.tsx