How kevin-khoamai/endorse-flow-nexus works
Project type and purpose
• This is a full-stack single-page application (SPA) built with React, Vite, and TypeScript that relies on Supabase as a backend-as-a-service (BaaS) for authentication, database, and storage.
• The README confirms it’s a “Lovable” project scaffolded for rapid front-end development and integrated with Supabase.
File structure
• Top-level:
• package.json, vite.config.ts, tsconfig.* → build and compile the React/TypeScript app with Vite.
• public/ + index.html → static assets and HTML shell.
• src/ → UI code (pages, components, hooks, contexts, integrations).
• src/integrations/supabase → client.ts & types.ts encapsulate Supabase API usage.
• supabase/ → local Supabase config.toml and SQL migrations.
• Patterns: component-driven UI under src/components, shared state via src/contexts/AuthContext.tsx, data hooks in src/hooks/use*.
• No custom backend code—Supabase handles auth, Postgres, and file storage.
README
• Confirms tech stack (Vite, TypeScript, React, Tailwind, shadcn-ui).
• No custom serverless functions—everything runs in the browser and talks directly to Supabase.
Main components of the system
a. Frontend (React SPA)
• Pages: Auth, Index (dashboard), NotFound
• UI Components: dashboards, dialogs, cards, grids
• State Management: React Context (AuthContext), custom hooks (useCampaigns, useVideos, etc.)
b. Build/Deployment
• Vite dev server for local dev
• CI/CD via GitHub/Lovable auto-publish
c. Backend services (Supabase)
• Authentication service (email/password, OAuth)
• Postgres database (tables created via migrations)
• Storage (for video uploads)
d. Repository & Infrastructure as Code
• Git repo with migrations under supabase/migrations
• Supabase config.toml for local emulation
Relationships and interactions
• Browser → (HTTP/WebSocket) → Vite dev server or static hosting → serves index.html + JS/CSS
• React app → (Supabase client) → Supabase Auth / Postgres / Storage
• User actions (upload video, fetch campaigns) invoke hooks → integrations/supabase/client.ts → Supabase
• Migrations define DB schema; config.toml ensures local Supabase match prod.
Architectural patterns & design principles
• Component-driven UI with shadcn-ui primitives (atomic design).
• Separation of concerns: UI, state (contexts/hooks), data integration (supabase client).
• BaaS: no custom API server—client communicates directly with Supabase.
• Infrastructure as code: supabase migrations tracked in repo.