How elvismutinda/mkr-sports-client-portal works
MKR Sports Client Portal is a sports participation portal for players and teams. Users can register and verify accounts, discover matches, teams, tournaments, and turfs, then manage squads and participate in competitions. The sampled match detail page fetches match data from its API; squad management fetches roster and team data. API handlers use a shared Drizzle database, and authentication also uses that database. The README provides no product detail, so several listed capabilities are represented from the file tree; their unsampled wiring is not asserted.
Main entry points: db.ts PostgreSQL data · [id]/page.tsx Match details · dashboard/page.tsx Dashboard page · squad/page.tsx Squad management
Components 27
Accounts
- Registration form
components/auth/RegisterForm.tsx - Registration action
app/(auth)/register/actions.ts - Authentication
auth.ts - Login and verification
app/(auth)
Sports discovery
- Match details
app/(landing)/matches/[id]/page.tsx - Match registration
app/(landing)/matches/(components)/RegisterMatchForm.tsx - Match actions
app/(landing)/matches/actions.ts - Match API
app/api/matches - Team discovery
app/(landing)/teams - Turf discovery
app/(landing)/turfs - Turf API
app/api/turfs/route.ts
Competition
- Team challenge
app/(landing)/teams/[id]/challenge - Challenge API
app/api/challenges/route.ts - Tournament listings
app/(landing)/tournaments - Tournament API
app/api/tournaments/route.ts - Tournament registration
app/api/tournaments/[id]/register/route.ts
Player portal
- Dashboard page
app/app/dashboard/page.tsx - Dashboard view
components/Dasboard.tsx - Squad management
app/app/squad/page.tsx - Player roster API
app/api/player/roster/route.ts - My team API
app/api/team/mine/route.ts - Player settings
app/app/settings/page.tsx
Platform services
- PostgreSQL data
lib/db/db.ts - Sports data schema
lib/db/schema.ts - Email delivery
lib/mail.ts - M-Pesa callback
app/api/mpesa/callback/route.ts
Other components
- Player
Connections 33
- Player → Registration form: registers
components/auth/RegisterForm.tsx - Registration form → Registration action: submits to
components/auth/RegisterForm.tsx - Player → Login and verification: signs in
app/(auth)/login/page.tsx - Authentication → PostgreSQL data: uses
auth.ts - Authentication → Sports data schema: adapts
auth.ts - Player → Match details: views
app/(landing)/matches/[id]/page.tsx - Match details → Match API: fetches match
app/(landing)/matches/[id]/page.tsx - Match details → Match registration: renders
app/(landing)/matches/[id]/page.tsx - Match registration → Match actions: submits to
app/(landing)/matches/(components)/RegisterMatchForm.tsx - Match API → PostgreSQL data: queries
app/api/matches/route.ts - Player → Team discovery: discovers teams
- Player → Team challenge: challenges team
- Challenge API → Authentication: authenticates
app/api/challenges/route.ts - Challenge API → PostgreSQL data: reads and updates
app/api/challenges/route.ts - Player → Tournament listings: explores tournaments
- Tournament listings → Tournament API: loads listings
- Tournament API → PostgreSQL data: queries
app/api/tournaments/route.ts - Tournament registration → PostgreSQL data: uses
- Player → Turf discovery: searches turfs
- Turf discovery → Turf API: loads results
- Turf API → PostgreSQL data: queries
app/api/turfs/route.ts - Player → Dashboard page: opens dashboard
- Dashboard page → Dashboard view: renders
app/app/dashboard/page.tsx - Dashboard page → PostgreSQL data: queries
app/app/dashboard/page.tsx - Player → Squad management: manages squad
- Squad management → Player roster API: fetches roster
app/app/squad/page.tsx - Squad management → My team API: fetches team
app/app/squad/page.tsx - Player roster API → PostgreSQL data: uses
- My team API → PostgreSQL data: uses
- Player → Player settings: updates profile
- M-Pesa callback → PostgreSQL data: updates payments
app/api/mpesa/callback/route.ts - M-Pesa callback → Email delivery: sends email
app/api/mpesa/callback/route.ts - PostgreSQL data → Sports data schema: uses schema
lib/db/db.ts