How irfanb22/bears-prediction-app works
Bears Prediction Tracker lets fans authenticate, make and review Chicago Bears season predictions, and view community results. Its central workflow runs from the web app through prediction questions and user picks to Supabase-backed summaries; authentication gates personal activity. The product also includes an admin surface for email campaigns and lifecycle automations, with edge functions for dispatch, unsubscribe handling, and delivery events. The README is only a project name, and sampled source is partial, so uncertain UI-to-function wiring is omitted.
Main entry points: App.tsx Application routes · PredictionContext.tsx Prediction state · auth.tsx Auth provider · index.ts Campaign dispatch
Components 24
Web experience
- Application routes
src/App.tsx - Sign-in and registration
src/components/AuthForm.tsx - Auth callback
src/components/AuthCallback.tsx
Prediction domain
- Prediction interface
src/components/PredictionInterface.tsx - Fan dashboard
src/components/Dashboard.tsx - Leaderboard
src/components/Leaderboard.tsx - Season recap
src/components/SeasonRecap.tsx - Prediction state
src/lib/PredictionContext.tsx
Email operations
- Email admin
src/components/AdminEmailDashboard.tsx - Email composer
src/lib/emailComposer.ts - Campaign dispatch
supabase/functions/dispatch-campaign/index.ts - Email sending
supabase/functions/send-brevo-email/index.ts - Lifecycle automation
supabase/functions/run-lifecycle/index.ts - Unsubscribe handler
supabase/functions/unsubscribe-email/index.ts - Delivery events
supabase/functions/ses-events/index.ts
Backend services
- Auth provider
src/lib/auth.tsx - Supabase client
src/lib/supabase.ts - SES mailer
supabase/functions/_shared/ses.ts - Analytics
src/lib/analytics.ts
Other components
- Fan
- Administrator
- Scheduler
- Supabase
- Email service
Connections 36
- Fan → Application routes: uses
- Administrator → Application routes: uses
- Application routes → Sign-in and registration: presents
- Application routes → Auth callback: routes to
- Application routes → Prediction interface: routes to
- Application routes → Fan dashboard: routes to
- Application routes → Leaderboard: routes to
- Application routes → Season recap: routes to
- Sign-in and registration → Auth provider: invokes
- Auth callback → Auth provider: uses
- Auth provider → Supabase client: calls
- Supabase client → Supabase: connects
- Prediction interface → Prediction state: uses
- Fan dashboard → Prediction state: uses
- Leaderboard → Prediction state: uses
- Season recap → Prediction state: uses
- Prediction state → Auth provider: reads user
- Prediction state → Supabase client: fetches and updates
- Email admin → Email composer: edits content
- Scheduler → Campaign dispatch: triggers
- Administrator → Campaign dispatch: dispatches
- Administrator → Email sending: requests send
- Scheduler → Lifecycle automation: triggers
- Administrator → Lifecycle automation: runs
- Campaign dispatch → Supabase: reads and updates
- Email sending → Supabase: reads recipients
- Lifecycle automation → Supabase: claims and records
- Campaign dispatch → SES mailer: sends mail
- Lifecycle automation → SES mailer: sends mail
- SES mailer → Email service: delivers via
- Email sending → Email service: sends via
- Email service → Delivery events: reports events
- Delivery events → Supabase: records events
- Fan → Unsubscribe handler: requests unsubscribe
- Unsubscribe handler → Supabase: updates preferences
- Auth provider → Analytics: identifies user