How likegecko/jlpt-daily-quiz works
Main Components Identification
a) Frontend Layer:
• Client-side Pages (/app directory)
• UI Components (/components directory)
• Custom Hooks (/hooks directory)
b) Backend Layer:
• API Routes (/app/api directory)
• External Services Integration:
• Firebase (lib/firebase.ts)
• Resend Email Service (lib/resend.ts)
c) Data Layer:
• Static Data (public/words/n5.json)
• Quiz Generation System (utils/generate-quiz.ts)
┌─ Client Layer ─────────────────────┐
• Pages (/, /words/n5/[wordId]) │
• UI Components │
• Subscribe Popup │
• ┬───────────────────┘
• ↕
┌─ API Layer ────┴───────────────────┐
• Quiz API (/api/quizs) │
• Subscribe API (/api/subscribe) │
• Verification API │
• ┬───────────────────┘
• ↕
┌─ Service Layer ┴───────────────────┐
• Firebase Integration │
• Resend Email Service │
• ┬───────────────────┘
• ↕
┌─ Data Layer ───┴───────────────────┐
• N5 Words JSON │
• Quiz Generation Logic │
• ┘
Component Relationships
• Client-to-API communication (REST/API routes)
• API-to-Service interactions
• Data flow between quiz generation and storage
Technical Stack Indicators
• Next.js 13+ (App Router)
• TypeScript
• Tailwind CSS
• Firebase
• Resend Email Service
Detailed Component Breakdown
For each major section, include:
Client Layer:
• Page Components
• Shared UI Components (buttons, cards, dialogs)
• Custom Hooks (useToast)
API Layer:
• Quiz Management
• Subscription Handling
• Email Verification
Service Layer:
• Firebase Configuration
• Email Service Setup
Data Layer:
• Static Word Data
• Quiz Generation Logic
Additional Notes
• The app's serverless architecture
• API route organization
• Component reusability
• Data flow for quiz generation and delivery
Remember to maintain a balance between detail and clarity, focusing on the architectural decisions that make this application unique, such as the daily quiz system and the subscription verification flow.