How mandeepthenoncoder/themainsarkarcrm works
Project type and purpose
• This is a full-stack CRM web application for jewelry businesses, built on Next.js (React) with a TypeScript codebase, styled by Tailwind CSS and shadcn/ui, and backed by Supabase (PostgreSQL, Auth, Realtime).
• It supports three user roles (Admin, Manager, Salesperson) each with distinct dashboards and workflows for customer management, appointments, sales tracking, tasks, and analytics.
File structure
• Top-level config/deployment files (eslint.config.mjs, next.config.ts, tailwind.config.ts, tsconfig.json, DEPLOYMENT.md, SETUP.md, etc.).
• src/app/: Next.js App Router containing role-scoped subfolders (admin/, manager/, salesperson/) plus global routes (login, sales-login, api/, auth/).
• src/components/: shared UI and domain-specific components (AuthButton, ProtectedRoute, customer dialogs, cards, etc.).
• src/contexts/: React AuthContext for managing session state.
• src/lib/: database clients (Postgres, Supabase client/server/middleware), type definitions, utilities.
• supabase/: database schema migrations & seed files.
• public/: static assets.
README insights
• Tech stack: Next.js 15, React, TypeScript at frontend; Supabase for backend, Auth, RLS and Realtime features.
• Multi-role architecture with role‐based routing and RLS ensures data isolation.
• Deployment on Vercel with automatic builds and environment variables.
Detail and essential elements
• Middleware.ts enforcing auth & RBAC before page access.
• Both direct client-side Supabase interactions (realtime, CRUD) and server-side routes.
• Migration pipeline as part of CI/CD step feeding into the database.