How lixiny-code/chaincue-ielts works
Chaincue is an IELTS Speaking Part 2 practice app that turns a learner’s real experience into reusable, topic-specific speaking scripts. The documented workflow runs from topic selection and experience entry through AI story analysis, topic matching, and script generation, then supports review and saving. The README also describes custom topic imports, read-aloud, copying, ratings, and history. Frontend orchestration is documented but its source was not sampled, so those links reflect the README; other endpoint wiring is shown only where supported by sampled code.
Main entry points: index.html Practice interface · 01_init.sql Supabase database · ai-request.js AI request client · generate-answer.js Single answer
Components 21
Practice workflow
- Practice interface
index.html - Topic selection
index.html - Custom topic import
index.html - Read, copy, rate
index.html - Experience entry
index.html
AI generation
- Story decomposition
api/decompose.js - Category mapping
api/map-categories.js - Topic recommendations
api/recommend-topics.js - Multi-topic scripts
api/generate.js - Single answer
api/generate-answer.js - AI request client
lib/ai-request.js
Accounts and history
- Story library
api/stories.js - History list
api/histories.js - History detail
api/history/[id].js - Save archive
api/save-archive.js - Redeem credits
api/redeem-code.js - REST data helpers
api/lib/supabase.js
External services
- Supabase auth
- AI completion API
- Supabase database
supabase/migrations/01_init.sql
Other components
- Learner
Connections 40
- Learner → Practice interface: uses
- Practice interface → Topic selection: selects topics
- Practice interface → Custom topic import: imports topics
- Practice interface → Read, copy, rate: reviews scripts
- Practice interface → Experience entry: enters experience
- Experience entry → Story decomposition: submits story
- Story decomposition → AI request client: requests analysis
- AI request client → AI completion API: sends prompt
- Story decomposition → Supabase auth: validates user
- Story decomposition → Supabase database: logs decomposition
- Practice interface → Category mapping: maps categories
- Category mapping → AI request client: requests mapping
- Category mapping → Supabase auth: validates user
- Category mapping → Supabase database: logs mapping
- Practice interface → Topic recommendations: requests recommendations
- Topic recommendations → AI request client: requests matches
- Topic recommendations → Supabase auth: validates user
- Topic recommendations → Supabase database: logs recommendations
- Practice interface → Multi-topic scripts: generates scripts
- Multi-topic scripts → AI request client: requests scripts
- Multi-topic scripts → Supabase auth: validates user
- Practice interface → Single answer: generates answer
- Single answer → AI request client: requests answer
- Single answer → Supabase auth: validates user
- Single answer → Supabase database: logs answer
- Single answer → Supabase database: updates credits
- Practice interface → Story library: manages stories
- Story library → Supabase auth: verifies token
- Story library → REST data helpers: calls data helpers
- Practice interface → History list: views history
- History list → Supabase database: reads records
- Practice interface → History detail: opens record
- History detail → REST data helpers: queries record
- History detail → Supabase auth: verifies token
- Practice interface → Save archive: saves result
- Save archive → Supabase database: stores archive
- Practice interface → Redeem credits: redeems code
- Redeem credits → Supabase auth: validates user
- Redeem credits → Supabase database: updates credits
- REST data helpers → Supabase database: queries and writes