How thestartupdeveloper10/theboardfc works
Project type and purpose
• This is a full-stack web application whose public UI is built with React (TypeScript/TSX), Vite, Tailwind CSS, PostCSS and which uses Supabase as its backend (Auth, Database, Storage, Edge Functions).
• It provides a public facing “fan” site (pages like Home, Fixtures, News, FanZone, PlayerStats, Contact) and an authenticated admin console (Dashboard, content and player/match/notification management).
• It also integrates with an external email service via EmailJS for contact forms and notification delivery.
File structure
Top-level directories
• src/ – React entry point (main.tsx), components, pages, hooks, context, config, lib, services (API queries and mutations), assets, styles, types
• public/ + index.html – static entry, images & favicon
• supabase/ – database config (config.toml), edge functions (send-team-notification)
• docs/ – operational docs (email setup, etc.)
• config files – vite.config.ts, tailwind.config.js, tsconfig.json, postcss.config.js
• package.json + lock – project dependencies & scripts
Key patterns
• Component-based UI with a shared ui/ library (buttons, dialogs, cards) and layout & ProtectedRoute wrapper
• Client-side routing with page components under src/pages (public vs admin sub-folder)
• API layer in src/services interacting with Supabase client in src/lib/supabase.ts
• AuthContext providing user session state & ProtectedRoute enforcing admin access
• Supabase Edge Function for sending notifications to subscribed users
Architecture notes (from README or docs)
• development-plan.md may hint at deployment or staging environments
a. Main components
– Web Client (React SPA)
– Static hosting/CDN (e.g., Netlify, Vercel, S3+CloudFront)
– Supabase Backend
• Auth service (signup, sign-in, session management)
• Database (tables for users, players, matches, news, contacts, stats)
• Storage (images, assets)
• Edge Functions (send-team-notification)
– External Email Service (EmailJS)
b. Relationships and data flow
1. Browser → Static Hosting → serves React bundle and assets
2. React SPA → Supabase Auth for login/sign-up
3. React SPA → Supabase Database via client-side API (queries & mutations)
4. React SPA → Supabase Storage for image uploads (e.g., merch, fan photos)
5. React SPA → EmailJS (contact form posting)
6. Database triggers or admin actions → Supabase Edge Function → sends notifications via EmailJS or other provider
c. Architectural patterns and principles
• Single Page Application (SPA) with clear public vs protected (admin) routes
• Separation of concerns: UI components, layout, data services, context for cross-cutting concerns (auth, theme, toast)
• Client-side state minimal; rely on Supabase for real-time updates or fetch-on-render
• Serverless backend using managed services (Supabase + Edge Functions)
d. Key technologies and frameworks
• React (TSX), Vite (bundler), Tailwind CSS (styling)
• Supabase (PostgreSQL, Auth, Storage, Edge Functions)
• EmailJS (SMTP/email API)
• TypeScript for type safety across client & serverless functions
• PostCSS, Tailwind config for styling pipeline