How sms03/sharksenz works
Project Overview
• SharkSenz is a full-stack SaaS platform for startup founders, built as a single-page application (SPA) with React/Vite on the frontend and Supabase (PostgreSQL + Auth + Edge Functions) as the backend, hosted on Vercel. It integrates with the Cashfree payment gateway for subscriptions and multi-currency billing.
Main Components
a. Frontend (src/)
• UI Layer: React 18 + TypeScript, Vite build.
• Components:
– src/components/ui (shadcn/ui primitives)
– src/components/analytics (calculators)
– src/components (ContentCard, PitchSimulator, AuthButton, etc.)
– src/layouts (MainLayout)
• Pages & Routing: src/pages (Index, AnalyticsDashboard, Pricing, Auth, ProfilePage, etc.)
• State & Data Fetching: React Contexts (src/contexts/AuthContext), TanStack Query, custom hooks (src/hooks).
• Static Assets: public/assets served by Vercel.
b. Backend Services
• Supabase Auth & Database: PostgreSQL tables for users, content library, subscription plans, analytics data.
• Supabase Edge Functions (supabase/functions):
– create-cashfree-order (generates payment order)
– verify-cashfree-payment (webhook to confirm payment)
• Supabase Client Integration: src/integrations/supabase/client.ts connects frontend to Supabase APIs.
c. External Services
• Cashfree Payment Gateway: payment routing, multi-currency, GST compliance.
• (Possible AI Service) for Pitch Simulator feedback (implied by “AI-powered analysis”).
d. Deployment & Hosting
• Vercel: hosts static frontend, runs Supabase Edge Functions (via Supabase).
Interactions & Data Flows
• User -> React SPA (served from Vercel CDN)
• SPA <-> Supabase Auth (login, tokens)
• SPA <-> Supabase Database (content library, analytics data) via Supabase JS client + TanStack Query
• SPA -> Edge Function "create-cashfree-order" -> Cashfree API
• Cashfree -> Edge Function "verify-cashfree-payment" (webhook) -> update subscription status in DB -> SPA notified (via real-time or refetch)
• SPA -> (optional) AI API for pitch analysis
Architectural Patterns & Design Principles
• SPA + REST/Realtime backend
• Serverless Functions for payment orchestration
• Role-based access: ProtectedRoute components gate premium content
• Modular UI with atomic design (shadcn/ui primitives + custom components)
• Separation of concerns: components, hooks, contexts, integrations directories
• Infrastructure as code: supabase/config.toml for migrations
• Clear, descriptive labels on all nodes