How p47d4/imvinci-coat-custom works
Project Type and Purpose
• This is a client-focused Single-Page Application (SPA) built with:
• Vite & React (TypeScript)
• Tailwind CSS & shadcn-ui for styling/UI components
• It uses Supabase as a Backend-as-a-Service (BaaS) for authentication, database (PostgreSQL), and storage.
• The app offers e-commerce & quote-generation features (shop, cart, quotes, profile management, blog, personalization).
File Structure for Architectural Layers
• Presentation Layer (src/pages, src/components): UI pages and reusable components.
• State & Business Logic Layer (src/contexts, src/hooks, src/services):
• AuthContext & CartContext manage global state.
• Hooks like useCart, useToast.
• Services (cartService, cartMigrationService) encapsulate domain logic.
• Data Access Layer (src/integrations/supabase + src/lib/utils):
• Supabase client & types.
• Utilities for transforming/syncing data.
• Static Assets (public/, index.html): Logos, robots.txt, Vite entry point.
• Deployment Config: vite.config.ts, supabase/config.toml, migrations under supabase/.
Review README for Additional Context
• Confirms tech stack and deployment via Lovable or custom hosting.
• No custom backend code—everything routes through Supabase.
Relationships & Data Flows
• User → Browser: Initiates navigation, form submissions.
• Browser (React SPA) → Supabase Auth:
• ProtectedRoute component checks JWT via AuthContext.
• Browser → Supabase Database:
• Queries for products (src/data or fetched via RPC), blog posts, quotes.
• Writes to carts, orders, quotes.
• Browser → Supabase Storage:
• File uploads (if supported).
• Browser → External API:
• WhatsApp messaging for support/contact.
Architectural Patterns & Principles
• Component-based UI: shadcn-ui primitives + custom components.
• Context for State: AuthContext & CartContext for app-wide state.
• Service Abstraction: cartService decouples UI from storage details.
• Hexagonal-ish Layers: UI ↔ Services ↔ Integrations.
• API-First: All backend operations go through Supabase.
Final Checklist
• [ ] All major components are present and labeled.
• [ ] Technologies & frameworks are annotated (React, Vite, Supabase, Tailwind, shadcn-ui).
• [ ] External integrations (WhatsApp API) are shown as separate clouds.