How massdann/project-bnsp works
SM Sport Center is a court-reservation and transaction-management application. Customers register or sign in, choose a court and time, reserve a slot, pay, and track their booking; administrators manage courts, verify transactions, and review reports. The diagram includes the sampled reservation, payment, authentication, and reporting paths, plus documented-by-tree admin and profile components. Several route and action implementations were not excerpted, so some plausible connections are omitted rather than inferred.
Main entry points: db.ts Postgres database · JadwalLapangan.tsx Schedule and booking UI · ProfilClient.tsx Profile and invoice UI · reservasi.ts Reservation actions
Components 31
Reservations
- Court discovery
src/app/page.tsx - Court schedule
src/app/reservasi/page.tsx - Court booking page
src/app/reservasi/[id]/page.tsx - Schedule and booking UI
src/components/booking/JadwalLapangan.tsx - Reservation actions
src/actions/reservasi.ts - Booking profile page
src/app/profil/page.tsx - Profile and invoice UI
src/app/profil/ProfilClient.tsx - Payment countdown
src/components/ui/CountdownTimer.tsx
Identity
- Login page
src/app/login/page.tsx - Registration page
src/app/register/page.tsx - Authentication actions
src/actions/auth.ts - Credentials and sessions
src/lib/auth.ts - Auth API route
src/app/api/auth/[...nextauth]/route.ts
Administration
- Court management
src/app/admin/lapangan/page.tsx - Court editor
src/app/admin/lapangan/EditLapanganModal.tsx - Court actions
src/actions/adminLapangan.ts - Payment verification
src/app/admin/verifikasi/page.tsx - Verification actions
src/actions/adminVerifikasi.ts - Transaction report page
src/app/admin/laporan/page.tsx - Report and export UI
src/app/admin/laporan/LaporanClient.tsx - Admin dashboard
src/app/admin/page.tsx - Transaction actions
src/actions/transaksi.ts - Payment checkout
src/app/api/payments/checkout/route.ts - Reservation expiration
src/app/api/cron/expire-reservasi/route.ts
Data and realtime
- Postgres database
src/lib/db.ts - Domain tables
src/db/schema.ts - Realtime publisher
src/lib/pusher.ts - Realtime client
src/lib/pusher-client.ts
Other components
- Customer
- Administrator
- Pusher service
Connections 39
- Customer → Login page: opens
src/app/login/page.tsx - Customer → Registration page: registers
src/app/register/page.tsx - Login page → Authentication actions: submits credentials
src/app/login/page.tsx - Registration page → Authentication actions: submits registration
src/app/register/page.tsx - Authentication actions → Credentials and sessions: signs in
src/actions/auth.ts - Credentials and sessions → Postgres database: checks accounts
src/lib/auth.ts - Auth API route → Credentials and sessions: uses handlers
src/app/api/auth/[...nextauth]/route.ts - Customer → Court discovery: browses
- Court discovery → Postgres database: reads courts
src/app/page.tsx - Court schedule → Postgres database: reads courts
src/app/reservasi/page.tsx - Court booking page → Schedule and booking UI: renders
src/app/reservasi/[id]/page.tsx - Schedule and booking UI → Reservation actions: requests slot actions
src/components/booking/JadwalLapangan.tsx - Reservation actions → Postgres database: reads and writes
src/actions/reservasi.ts - Schedule and booking UI → Payment countdown: renders
src/components/booking/JadwalLapangan.tsx - Schedule and booking UI → Realtime client: subscribes
src/components/booking/JadwalLapangan.tsx - Booking profile page → Profile and invoice UI: renders
src/app/profil/page.tsx - Profile and invoice UI → Transaction actions: cancels booking
src/app/profil/ProfilClient.tsx - Profile and invoice UI → Realtime client: subscribes
src/app/profil/ProfilClient.tsx - Profile and invoice UI → Payment checkout: links to payment
- Administrator → Court management: manages courts
- Court management → Court editor: renders
src/app/admin/lapangan/page.tsx - Court editor → Court actions: submits changes
src/app/admin/lapangan/EditLapanganModal.tsx - Court management → Court actions: uses actions
src/app/admin/lapangan/page.tsx - Court actions → Postgres database: reads and writes
src/actions/adminLapangan.ts - Administrator → Payment verification: reviews payments
- Payment verification → Verification actions: uses actions
- Verification actions → Postgres database: reads and writes
src/actions/adminVerifikasi.ts - Transaction report page → Report and export UI: renders
src/app/admin/laporan/page.tsx - Transaction report page → Postgres database: reads transactions
src/app/admin/laporan/page.tsx - Administrator → Transaction report page: reviews reports
- Admin dashboard → Postgres database: reads summary data
src/app/admin/page.tsx - Transaction actions → Postgres database: reads and writes
src/actions/transaksi.ts - Payment checkout → Postgres database: reads and updates
src/app/api/payments/checkout/route.ts - Payment checkout → Realtime publisher: publishes payment
src/app/api/payments/checkout/route.ts - Reservation expiration → Postgres database: expires records
src/app/api/cron/expire-reservasi/route.ts - Reservation actions → Realtime publisher: publishes slot events
src/actions/reservasi.ts - Realtime publisher → Pusher service: sends events
- Realtime client → Pusher service: receives events
- Postgres database → Domain tables: uses schema
src/lib/db.ts