How prithvi2004/graphify-fe works
Project type and purpose
• This is a single-page application (SPA) built with React, TypeScript, Vite, Tailwind CSS, and shadcn-ui.
• It serves as a front-end client that authenticates users (via Supabase Auth) and reads/writes data to a Supabase backend.
File structure
• Top level:
• public/ (static assets: robots.txt, video)
• src/ (application source code)
• supabase/ (Supabase config)
• config files: tsconfig, vite.config.ts, tailwind.config.ts, eslint.config.js
• src/ hierarchy:
• components/ (UI primitives, auth, hero, home sections)
• hooks/ (custom React hooks)
• integrations/ (Supabase client & types)
• lib/ (utility functions)
• pages/ (Routable views: Index, Generate, NotFound)
• main.tsx & index.html (app entry point)
README
• Confirms tech stack: React + TypeScript, Vite, shadcn-ui, Tailwind CSS
• Deployment & editing via Lovable platform
• No custom backend in this repo—Supabase provides authentication and database
Main components
a. Client-side React App (SPA)
• UI layer (shadcn-ui components, Tailwind styling)
• React Router pages (Index, Generate, NotFound)
• State management & hooks (e.g., useToast, useMobile)
b. Vite Development Server / Build
• Serves index.html, bundles src/ to static assets
c. Static Hosting / CDN
• Hosts the built assets (HTML, JS, CSS, media)
• Either Lovable’s hosting or custom domain
d. User Authentication & Database (Supabase)
• AuthProvider + GoogleAuthButton → Supabase Auth
• Supabase client (src/integrations/supabase/client.ts)
• Supabase DB (tables, real-time subscriptions)
e. External Services
• Lovable platform (CI/CD, auto-deploy)
• Optional custom domain / DNS
Relationships and data flows
• Browser → (HTTPS) → Static Hosting → serves index.html & bundle
• React App → (Supabase SDK calls) → Supabase Auth & REST/Realtime APIs
• User actions (Generate page) → calls DB functions or edge functions via Supabase
• Vite dev server (dev mode) proxies API calls if configured
Architectural patterns & design principles
• SPA architecture: clear separation of UI components vs. data integration
• “Presentational vs. Container” components:
• UI primitives (components/ui/*) for look & feel
• Functional components (pages, integrations) for business logic
• Context providers (AuthProvider, ThemeProvider) for cross-cutting concerns
• Modular directory structure: by feature (auth, hero, home) & by layer (ui, hooks, lib)
• Clear, concise labels (component name + file path)