How mjcaelum-oss/lucky-mate works
Lucky Mate is a mobile fortune service entered through an NFC keyring or a direct link. The user selects a fortune category, receives a daily result, and can revisit or share that result. The main runtime flow is represented alongside analytics, image sharing, and editorial content management. The README documents the optional Kakao and device-sharing behaviors; the sampled sources show the API, server, domain, and image-generation responsibilities. Database details are represented at the documented migration path.
Main entry points: experience.tsx Fortune experience · server.ts Fortune services · route.ts Action API · page.tsx Page entry
Components 16
User experience
- Fortune experience
components/experience.tsx - Page entry
app/[[...path]]/page.tsx - Share card generator
lib/sharing.ts
Fortune runtime
- Action API
app/api/[action]/route.ts - Domain rules
lib/domain.ts - Fortune services
lib/server.ts
Persistence and analytics
- Supabase database
supabase/migrations/001_initial.sql - Demo file store
lib/server.ts - Event logging
lib/server.ts
Content management
- Draft fortunes
lib/content.ts - Fortune CSV
supabase/seed/fortune_contents.csv - Content import
scripts/fortune-csv.ts
Other components
- Keyring visitor
- Kakao sharing
- Device sharing
- Purchase destination
Connections 17
- Keyring visitor → Page entry: opens route
README.md - Page entry → Fortune experience: renders
app/[[...path]]/page.tsx - Fortune experience → Action API: requests actions
README.md - Action API → Domain rules: validates inputs
app/api/[action]/route.ts - Action API → Fortune services: calls services
app/api/[action]/route.ts - Fortune services → Domain rules: uses types and rules
lib/server.ts - Fortune services → Draft fortunes: reads draft content
lib/server.ts - Fortune services → Supabase database: reads and writes
lib/server.ts - Fortune services → Demo file store: reads and writes
lib/server.ts - Action API → Event logging: records events
app/api/[action]/route.ts - Fortune services → Event logging: persists events
lib/server.ts - Fortune experience → Share card generator: generates share image
components/experience.tsx - Fortune experience → Kakao sharing: shares via SDK
README.md - Fortune experience → Device sharing: offers device sharing
README.md - Fortune experience → Purchase destination: opens purchase link
README.md - Fortune CSV → Content import: provides content
README.md - Content import → Supabase database: syncs content
scripts/fortune-csv.ts