How trekkateer/usports works
USports is a campus pickup-sports app: students sign in, discover and filter games, host games, and join or leave them; profiles and push notifications support that workflow. The client manages screens and shared event/profile state, calls the server API, and persists sessions locally. The server routes requests through authentication and domain services to Supabase-backed data access. The README establishes the product capabilities; edges are limited to relationships visible in excerpts or SOURCE INDEX references, so some unsampled screen and notification wiring is omitted.
Main entry points: app.ts HTTP application · eventRoutes.ts Event routes · index.ts Event data access · client.ts Supabase client
Components 29
Mobile client
- Game screens
client/src/app/(tabs)/index.tsx - Game detail
client/src/app/event/[id].tsx - Host game
client/src/app/host.tsx - Sign-in screen
client/src/app/sign-in.tsx - Profile screen
client/src/app/(tabs)/profile.tsx - Event state
client/src/context/EventContext.tsx - Profile state
client/src/context/ProfileContext.tsx - Event API
client/src/api/events.ts - Auth API
client/src/api/auth.ts - Profile API
client/src/api/profile.ts - Session storage
client/src/api/session.ts - Push registration
client/src/notifications/usePushNotifications.ts
API and domain
- HTTP application
server/src/app.ts - Event routes
server/src/routes/eventRoutes.ts - Auth routes
server/src/routes/authRoutes.ts - Profile routes
server/src/routes/profileRoutes.ts - Push-token routes
server/src/routes/pushTokenRoutes.ts - Auth service
server/src/services/authService.ts - Event service
server/src/services/eventService.ts - Profile service
server/src/services/profileService.ts - Push-token service
server/src/services/pushTokenService.ts - Push delivery
server/src/services/pushService.ts
Persistence and integrations
- Event repository
server/src/repositories/eventRepository.ts - Event data access
server/src/db/index.ts - Notification data
server/src/db/notifications.ts - Supabase client
server/src/db/client.ts
Client utilities
- Event filters
client/src/utils/filterEvents.ts
Other components
- Student
- Supabase
Connections 36
- Student → Game screens: browses games
- Student → Host game: hosts games
- Student → Sign-in screen: signs in
- Student → Profile screen: manages profile
- Game screens → Event state: reads state
client/src/app/(tabs)/index.tsx - Game detail → Event state: reads state
client/src/app/event/[id].tsx - Event state → Event API: fetches and mutates
client/src/context/EventContext.tsx - Game screens → Event filters: filters games
client/src/app/(tabs)/index.tsx - Sign-in screen → Auth API: authenticates
client/src/app/sign-in.tsx - Profile state → Profile API: loads and updates
client/src/context/ProfileContext.tsx - Profile state → Session storage: reads and writes
client/src/context/ProfileContext.tsx - Push registration → Profile state: uses identity
client/src/notifications/usePushNotifications.ts - Push registration → Push-token routes: registers token
- Event API → Event routes: HTTP requests
- Auth API → Auth routes: HTTP requests
- Profile API → Profile routes: HTTP requests
- HTTP application → Event routes: mounts routes
server/src/app.ts - HTTP application → Auth routes: mounts routes
server/src/app.ts - HTTP application → Profile routes: mounts routes
server/src/app.ts - HTTP application → Push-token routes: mounts routes
server/src/app.ts - Event routes → Event service: dispatches operations
server/src/routes/eventRoutes.ts - Event routes → Event repository: updates and deletes
server/src/routes/eventRoutes.ts - Auth routes → Auth service: dispatches auth
server/src/routes/authRoutes.ts - Profile routes → Profile service: dispatches profile
server/src/routes/profileRoutes.ts - Push-token routes → Push-token service: dispatches tokens
server/src/routes/pushTokenRoutes.ts - Event service → Event repository: uses repository
server/src/services/eventService.ts - Event repository → Event data access: queries event data
server/src/repositories/eventRepository.ts - Auth service → Supabase client: uses auth client
server/src/services/authService.ts - Auth service → Event data access: ensures user row
server/src/services/authService.ts - Profile service → Event data access: reads and updates profile
server/src/services/profileService.ts - Push-token service → Notification data: stores tokens
server/src/services/pushTokenService.ts - Push-token service → Push delivery: requests delivery
server/src/services/pushTokenService.ts - Push delivery → Notification data: uses notifications
server/src/services/pushService.ts - Event data access → Supabase client: queries through
server/src/db/index.ts - Notification data → Supabase client: queries through
server/src/db/notifications.ts - Supabase client → Supabase: connects
server/src/db/client.ts