How lekyucv/tc-team-football works
TC TEAM is a Vietnamese internal football-team management PWA. Members view upcoming matches, register for a place or waitlist, submit payment proof, and track match credits; admins manage matches, members, payments, team funds, and backups. Match scheduling and allocation, payment verification, accounting, and notifications are distinct operational stages. The graph emphasizes documented workflows and sampled call sites; some broader feature links rely on the README because many routes were not sampled.
Main entry points: schema.ts D1 database · route.ts Portal bootstrap · registrations.ts Seat allocation · schedule.ts Scheduling rules
Components 29
PWA experience
- Team interface
app/tc-app.tsx - Admin interface
app/admin/page.tsx
Application API
- Portal bootstrap
app/api/bootstrap/route.ts - Match APIs
app/api/matches/route.ts - Registration APIs
app/api/matches/[id]/register/route.ts - Community view
app/api/community/route.ts - Admin match API
app/api/admin/matches/[id]/route.ts - Admin fund API
app/api/admin/fund/route.ts - Member insights
app/lib/member-insights.ts
Match operations
- Scheduling rules
app/lib/schedule.ts - Seat allocation
app/lib/registrations.ts - Match rounds
app/api/match-results/route.ts - Match timers
app/lib/match-timer.ts - Vietnam time rules
app/lib/timezone.ts
Payments and funds
- Payment confirmation
app/lib/payment-confirmation.ts - Payment proofs
app/lib/payment-proofs.ts - SePay reconciliation
app/lib/sepay.ts - Team accounting
app/lib/accounting.ts - Match credits
app/lib/match-credits.ts
Identity and data
- Backup and restore
app/lib/backups.ts - Sessions and server
app/lib/server.ts - D1 database
db/schema.ts - Notifications
app/lib/notifications.ts
Other components
- Member
- Admin
- Google Drive
- SePay service
- OpenAI vision
- Web Push
Connections 36
- Member → Team interface: uses
README.md - Admin → Admin interface: manages
README.md - Team interface → Portal bootstrap: loads portal data
- Admin interface → Portal bootstrap: loads admin data
- Portal bootstrap → Sessions and server: gets session and database
app/api/bootstrap/route.ts - Portal bootstrap → Scheduling rules: loads upcoming matches
app/api/bootstrap/route.ts - Portal bootstrap → Payment confirmation: migrates legacy credits
app/api/bootstrap/route.ts - Portal bootstrap → D1 database: reads portal data
app/api/bootstrap/route.ts - Member → Registration APIs: requests a place
README.md - Registration APIs → Seat allocation: handles registration
- Seat allocation → Scheduling rules: checks match phase
app/lib/registrations.ts - Seat allocation → D1 database: reads and writes registrations
app/lib/registrations.ts - Seat allocation → Notifications: queues notices
app/lib/registrations.ts - Match APIs → Scheduling rules: serves match schedule
- Scheduling rules → Vietnam time rules: uses HCM timestamps
app/lib/schedule.ts - Scheduling rules → D1 database: reads and creates matches
app/lib/schedule.ts - Community view → Member insights: summarizes member history
app/api/community/route.ts - Community view → D1 database: reads community data
app/api/community/route.ts - Admin match API → Seat allocation: reconciles match
app/api/admin/matches/[id]/route.ts - Admin match API → Team accounting: records pitch costs
app/api/admin/matches/[id]/route.ts - Admin match API → D1 database: reads and updates match
app/api/admin/matches/[id]/route.ts - Admin fund API → D1 database: reads and writes fund records
app/api/admin/fund/route.ts - Admin fund API → Sessions and server: checks admin access
app/api/admin/fund/route.ts - Member → Payment proofs: submits payment proof
README.md - Payment proofs → OpenAI vision: analyzes bill image
README.md - SePay service → SePay reconciliation: sends transactions
README.md - SePay reconciliation → Payment confirmation: confirms matched payment
app/api/admin/sepay/route.ts - Payment confirmation → Match credits: credits verified top-up
app/lib/payment-confirmation.ts - Payment confirmation → D1 database: updates payment records
app/lib/payment-confirmation.ts - Admin fund API → Team accounting: summarizes fund activity
- Backup and restore → Google Drive: stores backups
README.md - Backup and restore → D1 database: backs up and restores data
- Notifications → Web Push: delivers web push
README.md - Sessions and server → D1 database: stores session hashes
app/lib/server.ts - Admin → Match rounds: records match results
- Admin → Match timers: manages match timers