How adilmunawar/adigon works
Project Type and Purpose
• Full-stack/web-app front-end built with React (Vite + TypeScript + Tailwind + shadcn-ui).
• Uses Supabase for backend (Auth + Database + Migrations).
• Integrates with external AI services via src/lib/gemini.ts & src/lib/runware.ts.
File Structure
• Top-level “public” holds static assets and index.html.
• “src” subdivides into:
• components/ – UI building blocks (chat interface, 3D scene, voice input, etc.)
• ui/ – shadcn-ui primitives (buttons, dialogs, forms, etc.)
• hooks/ – custom React hooks (mobile detection, toast)
• providers/ – React Context providers (AuthProvider, ThemeProvider)
• integrations/supabase/ – Supabase client & type definitions
• lib/ – app-specific logic (AI integration, utils)
• pages/ – route views (Auth, Index, NotFound)
• main.tsx & App.tsx – entrypoint & root component
• “supabase/” holds your database config and SQL migrations.
README Insights
• Confirms tech stack.
• Deployment via Lovable platform.
• Supabase is a managed BaaS; no custom server code here.
Main Components & Their Relationships
a. Frontend Client (React App)
• Browser runs the Vite-bundled static assets.
• UI layer: components + shadcn-ui + Tailwind CSS.
• State & context: AuthProvider, ThemeProvider.
• Hooks drive device detection and global toast notifications.
b. BaaS Backend (Supabase)
• Auth API for sign-in/up (src/integrations/supabase/client.ts).
• Database API for persisting chat history, settings.
• Managed via supabase/config.toml + migrations.
c. External AI Service
• src/lib/gemini.ts & src/lib/runware.ts wrap calls to an AI/LLM endpoint.
• Fetches responses for chat interface or other AI-driven features.
d. Development & Deployment Tools
• Vite – dev server, HMR, production build.
• Lovable Platform – code editing, CI/CD, hosting & custom domains.
Interactions:
– React app ↔ Supabase (HTTP/REST calls via JS client).
– React app ↔ AI service (HTTP/gRPC calls via your lib).
– Developer pushes code → Lovable CI → static build deployed.
Architectural Patterns & Design Principles
• Component-driven UI – single responsibility React components.
• Provider pattern – centralized Auth & Theme state.
• Hook abstraction – encapsulate cross-cutting concerns (mobile, toast).
• BaaS consumption – offload backend responsibilities to Supabase.
• Modular integrations – AI logic isolated in src/lib.
Critical Details Not to Miss
• The distinction between shadcn-ui primitives (components/ui/*) vs. your domain components (components/ChatInterface.tsx, etc.).
• The build step (Vite) and hosting platform (Lovable).
• The fact that Supabase handles both Auth and Database with the same client.
• Custom hooks and providers that glue UI to data and themes.