How ntquangminh/quangminh-toeic works
Quang Minh TOEIC is a Vietnamese TOEIC vocabulary learning and exam-preparation platform. Learners study vocabulary through flashcards and practice activities, take quizzes, and review difficult or due words; account-backed progress, goals, and streaks track that activity. Separate branches provide registration and login, bookmarks, AI tutoring, and administrator vocabulary management. The graph combines sampled calls and SOURCE INDEX references with capabilities documented in the README; unsampled routes and pages are represented only where their role is clear, and their internal wiring is not inferred.
Main entry points: db.ts Persistent database · review/page.tsx Review page · auth.ts Session and tokens · practice/page.tsx Quiz practice
Components 33
Study experience
- Study pages
src/app/learn/page.tsx - Flashcard
src/components/Flashcard.tsx - Pronunciation audio
src/components/AudioButton.tsx - Speech button
src/components/VoiceSpeechButton.tsx - Tutor modal
src/components/AITutorModal.tsx - Learning endpoint
src/app/api/learn/route.ts - Bookmarks
src/app/api/bookmarks/route.ts - Progress dashboard
src/app/dashboard/page.tsx - Exam countdown
src/components/ExamCountdownWidget.tsx - Progress bar
src/components/ProgressBar.tsx - Completion feedback
src/components/Confetti.tsx
Practice and review
- Quiz practice
src/app/practice/page.tsx - Quiz endpoint
src/app/api/quiz/route.ts - Matching endpoint
src/app/api/match/route.ts - Review page
src/app/review/page.tsx - Review endpoint
src/app/api/review/route.ts - Review quiz builder
src/lib/review-quiz.ts - Difficult words
src/app/difficult-words/page.tsx
Accounts and administration
- Account pages
src/app/register/page.tsx - Authentication routes
src/app/api/auth/login/route.ts - Vocabulary admin
src/app/admin/page.tsx - Vocabulary API
src/app/api/vocabulary/route.ts
Application services
- Session and tokens
src/lib/auth.ts - AI endpoints
src/app/api/ai/tutor/route.ts - AI service
src/lib/ai.ts - Rate limiter
src/lib/rate-limiter.ts - Persistent database
src/lib/db.ts - Study tracker
src/lib/study-tracker.ts - SM-2 scheduler
src/lib/sm2.ts - Sound effects
src/lib/sound-effects.ts
Learning content
- TOEIC vocabulary
src/data/toeic-vocab-seed.ts - Reading passages
src/data/toeic-reading-passages.ts
Other components
- Learner
Connections 48
- Learner → Study pages: studies with
- Study pages → Learning endpoint: requests words
- Learning endpoint → Persistent database: reads and writes
src/app/api/learn/route.ts - Learning endpoint → Session and tokens: resolves user
src/app/api/learn/route.ts - Learning endpoint → Study tracker: records activity
src/app/api/learn/route.ts - Study pages → Flashcard: presents cards
- Flashcard → Pronunciation audio: renders audio
src/components/Flashcard.tsx - Flashcard → Speech button: renders speech
src/components/Flashcard.tsx - Flashcard → Tutor modal: opens tutor
src/components/Flashcard.tsx - Learner → Quiz practice: takes quizzes
- Quiz practice → Quiz endpoint: submits answers
src/app/practice/page.tsx - Quiz endpoint → Persistent database: reads and writes
src/app/api/quiz/route.ts - Quiz endpoint → Session and tokens: verifies identity
src/app/api/quiz/route.ts - Quiz endpoint → Study tracker: records activity
src/app/api/quiz/route.ts - Learner → Matching endpoint: plays matching
- Matching endpoint → Persistent database: reads vocabulary
src/app/api/match/route.ts - Matching endpoint → Study tracker: records activity
src/app/api/match/route.ts - Learner → Review page: reviews words
- Review page → Review endpoint: loads and rates
- Review endpoint → Persistent database: reads and writes
src/app/api/review/route.ts - Review endpoint → Session and tokens: resolves user
src/app/api/review/route.ts - Review endpoint → SM-2 scheduler: calculates schedule
src/app/api/review/route.ts - Review endpoint → Study tracker: records activity
src/app/api/review/route.ts - Review page → Review quiz builder: builds review quiz
src/app/review/page.tsx - Learner → Difficult words: reviews mistakes
- Learner → Account pages: registers account
- Account pages → Authentication routes: submits credentials
- Authentication routes → Session and tokens: creates session
src/app/api/auth/login/route.ts - Authentication routes → Persistent database: reads and writes
src/app/api/auth/login/route.ts - Authentication routes → Rate limiter: limits requests
src/app/api/auth/login/route.ts - Vocabulary admin → Vocabulary API: manages vocabulary
- Vocabulary API → Persistent database: reads and writes
src/app/api/vocabulary/route.ts - Vocabulary API → Session and tokens: checks admin role
src/app/api/vocabulary/route.ts - Learner → Bookmarks: saves words
- Bookmarks → Persistent database: reads and writes
src/app/api/bookmarks/route.ts - Bookmarks → Session and tokens: resolves user
src/app/api/bookmarks/route.ts - Tutor modal → AI endpoints: asks tutor
- AI endpoints → AI service: generates response
src/app/api/ai/tutor/route.ts - AI endpoints → Rate limiter: limits requests
src/app/api/ai/tutor/route.ts - TOEIC vocabulary → Persistent database: seeds vocabulary
src/lib/db.ts - Progress dashboard → Progress bar: renders progress
src/app/dashboard/page.tsx - Progress dashboard → Exam countdown: shows countdown
src/app/dashboard/page.tsx - Quiz practice → Progress bar: renders progress
src/app/practice/page.tsx - Quiz practice → Completion feedback: shows completion
src/app/practice/page.tsx - Quiz practice → Sound effects: plays feedback
src/app/practice/page.tsx - Review page → Flashcard: renders cards
src/app/review/page.tsx - Review page → SM-2 scheduler: uses scheduling
src/app/review/page.tsx - Review page → Progress bar: renders progress
src/app/review/page.tsx