A complete React SaaS CRM application for insurance brokers built with modern technologies.
- Dashboard: Real-time metrics, pipeline overview, follow-up reminders, and agent leaderboard
- Leads Management: Full CRUD operations with filtering, search, and detailed lead profiles
- Kanban Pipeline: Drag-and-drop interface to manage leads through sales stages
- Reports & Analytics: Conversion rates, revenue tracking, and performance metrics
- User Management: Role-based access control (Admin, Manager, Agent)
- Authentication: Email/password and Google OAuth with Supabase
- Frontend: React 18 + TypeScript + Vite
- Styling: Tailwind CSS + shadcn/ui
- State Management: TanStack Query (React Query)
- Backend: Supabase (PostgreSQL + Auth + Realtime)
- Drag & Drop: @dnd-kit
- Charts: Recharts
- Forms: React Hook Form + Zod
- Node.js 18+
- npm or yarn
- Supabase account
- Clone the repository:
cd brokerflow-crm- Install dependencies:
npm install- Create a
.envfile with your Supabase credentials:
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key-
Set up the database by running the SQL schema in your Supabase project:
- Copy the contents of
supabase/schema.sql - Run it in Supabase SQL Editor
- Copy the contents of
-
Enable Google OAuth in Supabase:
- Go to Authentication > Providers
- Enable Google and configure your OAuth credentials
-
Start the development server:
npm run devbrokerflow-crm/
├── src/
│ ├── components/
│ │ ├── ui/ # shadcn/ui base components
│ │ ├── layout/ # Sidebar, Header, AppShell
│ │ └── dashboard/ # Dashboard widgets
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities and Supabase client
│ ├── pages/ # Route pages
│ └── types/ # TypeScript definitions
├── supabase/
│ └── schema.sql # Database schema
└── deployment/ # Deployment configurations
The application uses the following main tables:
- profiles: User profiles extending auth.users
- leads: Lead records with pipeline status
- activity_logs: Audit trail for lead interactions
- settings: Organization settings
The schema includes RLS policies for data isolation:
- Admins can view all data
- Managers can view all data
- Agents can only view their own leads
| Role | Capabilities |
|---|---|
| Admin | Full access to all features, user management, analytics |
| Manager | View all leads, analytics, override capabilities |
| Agent | View and manage own leads only |
- Prospect - Initial contact made
- Meeting - Scheduled meeting/completed
- Quote - Proposal sent
- Signed - Deal closed
- Delivered - Policy issued
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLintThe UI components are built using shadcn/ui pattern. To add new components:
# Copy a component from the UI library
npx shadcn-ui@latest add button- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables:
VITE_SUPABASE_URLVITE_SUPABASE_ANON_KEY
- Deploy
- Connect your repository
- Set build command:
npm run build - Set output directory:
dist - Add environment variables
- Deploy
- Create a new Supabase project
- Run
supabase/schema.sqlin the SQL Editor - Configure authentication providers
- Get your project URL and anon key
| Variable | Description |
|---|---|
VITE_SUPABASE_URL |
Supabase project URL |
VITE_SUPABASE_ANON_KEY |
Supabase anonymous key |
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - feel free to use this project for your own purposes.
For issues and feature requests, please create a GitHub issue.