How shubhamjain000/crm works
Unstop CRM is a sales, cadence, and customer-success platform. The documented workflow moves leads through deal pipelines, schedules cadence follow-ups as tasks, and exposes activity and completion metrics in BI; Zia can also act on CRM work. The repository contains both a Next.js/Prisma application and a substantial Django backend. The README documents product capabilities, while source-index references and excerpts establish only selected internal calls; unsampled subsystem links are omitted.
Main entry points: detail-routes.ts CRM API routes · tasks/models.py CSM cadence · db.ts Prisma database · deals/models.py Deals and pipelines
Components 20
Identity and tenancy
- Session management
src/lib/auth/session.ts - Tenant resolution
src/lib/auth/tenant.ts - Audit logging
src/lib/auth/audit.ts
CRM and pipelines
- CRM API routes
src/lib/crm/detail-routes.ts - Tenant CRM handler
src/lib/crm/handler.ts - Accounts, contacts, leads
backend/accounts/models.py - Deals and pipelines
backend/deals/models.py - Pipeline stages
backend/deals/models_pipeline.py - Custom fields
src/lib/crm/custom-fields.ts
Cadence and productivity
- CSM cadence
backend/tasks/models.py
AI and analytics
- Cadence and sales BI
backend/analytics/services.py - Zia assistant
backend/zia_chatbot/services.py
Platform services
- Prisma database
src/lib/db.ts - Tenant-scoped data
backend/api/managers.py - Approvals
backend/approvals/models.py - Blueprint execution
backend/blueprint/services.py - Validation rules
backend/validation_rules/services.py - CRM activity services
backend/crm_ux/services.py - Notifications
backend/notifications/services.py
Other components
- Sales user
Connections 22
- Sales user → CRM API routes: manages records
- CRM API routes → Session management: authenticates with
src/lib/crm/detail-routes.ts - CRM API routes → Tenant resolution: resolves tenant
src/lib/crm/detail-routes.ts - CRM API routes → Tenant CRM handler: delegates updates
src/lib/crm/detail-routes.ts - CRM API routes → Custom fields: reads and writes
src/lib/crm/detail-routes.ts - CRM API routes → Prisma database: queries records
src/lib/crm/detail-routes.ts - Session management → Prisma database: reads sessions
src/lib/auth/session.ts - Tenant resolution → Prisma database: reads membership
src/lib/auth/tenant.ts - Audit logging → Prisma database: writes audit
src/lib/auth/audit.ts - Sales user → Accounts, contacts, leads: tracks prospects
- Sales user → Deals and pipelines: manages opportunities
- Deals and pipelines → Pipeline stages: uses stages
backend/deals/models_pipeline.py - Sales user → CSM cadence: records next steps
- CSM cadence → Cadence and sales BI: reports cadence metrics
- Sales user → Zia assistant: requests CRM actions
- Zia assistant → CSM cadence: sets next steps
- CSM cadence → Notifications: creates follow-up tasks
- Tenant-scoped data → Tenant-scoped data: scopes queries
backend/api/managers.py - CRM activity services → Notifications: fans out alerts
backend/feed/signals.py - Approvals → CRM activity services: logs approval activity
backend/approvals/signals.py - Deals and pipelines → Blueprint execution: starts execution
- Accounts, contacts, leads → Validation rules: validates records
backend/validation_rules/signals.py