How rishi2600/crm works
CRM supports an Indian sales team through a lifecycle of lead intake and qualification, follow-up scheduling, conversion into deals, and pipeline progression, alongside contact and task management. Its app pages expose these workflows; API routes implement the domain operations and persist records through Prisma to PostgreSQL. Dashboard, analytics, and insights provide separate views of sales outcomes and activity. The tree and README establish the product capabilities; sampled routes support the listed data and scope responsibilities, while unsampled page-to-route wiring is not asserted.
Main entry points: prisma.ts Prisma client · scope.ts Access scoping · dashboard/page.tsx Dashboard · leads/page.tsx Lead desk
Components 26
Sales workspace
- Lead desk
src/app/(app)/leads/page.tsx - Lead history
src/app/(app)/leads/[id]/page.tsx - Contacts
src/app/(app)/contacts/page.tsx - Follow-ups
src/app/(app)/follow-ups/page.tsx - Deal pipeline
src/app/(app)/deals/page.tsx - Tasks
src/app/(app)/tasks/page.tsx - Dashboard
src/app/(app)/dashboard/page.tsx - Analytics
src/app/(app)/analytics/page.tsx - Login
src/app/(auth)/login/page.tsx
Sales operations
- Lead operations
src/app/api/leads/route.ts - Lead detail and status
src/app/api/leads/[id]/route.ts - Lead CSV import
src/app/api/leads/bulk/route.ts - Contact operations
src/app/api/contacts/route.ts - Follow-up operations
src/app/api/follow-ups/route.ts - Deal creation
src/app/api/deals/route.ts - Deal stage changes
src/app/api/deals/[id]/stage/route.ts - Task operations
src/app/api/tasks/route.ts
Reporting and insights
- Dashboard data
src/app/api/dashboard/route.ts - Sales analytics
src/app/api/analytics/dashboard/route.ts - Lead and follow-up insights
src/app/api/insights/summary/route.ts - Insight trends
src/app/api/insights/trends/route.ts
Access and data
- Login and logout
src/app/api/auth/login/route.ts - Access scoping
src/lib/scope.ts - Prisma client
src/lib/prisma.ts
Other components
- Sales team
- PostgreSQL
Connections 41
- Sales team → Login: signs in
- Login → Login and logout: submits credentials
- Sales team → Lead desk: works leads
- Sales team → Contacts: views contacts
- Sales team → Follow-ups: manages calls
- Sales team → Deal pipeline: moves deals
- Sales team → Tasks: tracks tasks
- Sales team → Dashboard: reviews activity
- Sales team → Analytics: reviews performance
- Lead desk → Lead operations: manages leads
- Lead desk → Lead CSV import: imports CSV
- Lead history → Lead detail and status: views and updates
- Contacts → Contact operations: manages contacts
- Follow-ups → Follow-up operations: schedules and updates
- Deal pipeline → Deal creation: creates deals
- Deal pipeline → Deal stage changes: changes stage
- Tasks → Task operations: manages tasks
- Dashboard → Dashboard data: loads summary
- Dashboard → Lead and follow-up insights: loads KPI insights
- Dashboard → Insight trends: loads trends
- Analytics → Sales analytics: loads metrics
- Lead operations → Access scoping: resolves visibility
- Lead detail and status → Access scoping: checks ownership
- Follow-up operations → Access scoping: resolves visibility
- Task operations → Access scoping: resolves visibility
- Sales analytics → Access scoping: resolves visibility
- Lead and follow-up insights → Access scoping: resolves visibility
- Lead operations → Prisma client: queries records
- Lead detail and status → Prisma client: reads and updates
- Lead CSV import → Prisma client: creates leads
- Contact operations → Prisma client: queries and creates
- Follow-up operations → Prisma client: reads and creates
- Deal creation → Prisma client: creates deals
- Deal stage changes → Prisma client: updates stages
- Task operations → Prisma client: reads and creates
- Dashboard data → Prisma client: aggregates records
- Sales analytics → Prisma client: aggregates records
- Lead and follow-up insights → Prisma client: aggregates activity
- Insight trends → Prisma client: queries trends
- Prisma client → PostgreSQL: reads and writes
- Login and logout → Prisma client: looks up users