How ulasnazim/cn-crm works
CN CRM is a multi-tenant legal-firm CRM organized around the matter record. A firm user signs in, opens a matter, and works across its parties, notes, calendar, tasks, information, finance, and documents; firm-wide views expose shared records. The README also identifies contacts, AI assistance and document generation, reporting, and administration as product capabilities. The graph preserves those branches, plus external messaging and cloud-drive integrations. Several feature paths are unsampled, so their connections are shown as unverified; source-index references support the cited internal calls and data access.
Main entry points: matters.ts Matter services · documents.ts Document services · db.ts Tenant database · tasks.ts Tasks and reminders
Components 22
Access and tenancy
- Sign-in and account
src/app/(auth) - Session and auth
src/lib/auth.ts - Tenant permissions
src/lib/tenancy.ts - Tenant database
src/lib/db.ts
Matter work
- Matter workspace
src/app/(app)/matters - Matter services
src/server/matters.ts - Contacts
src/app/(app)/contacts - Tasks and reminders
src/server/tasks.ts - Calendar and agenda
src/app/(app)/calendar/page.tsx - Notes
src/app/(app)/notes
Documents and AI
- Document workspace
src/app/(app)/documents - Document services
src/server/documents.ts - Document storage
src/server/document-storage.ts - AI documents
src/server/ai-docs.ts - AI assistant
src/server/assistant.ts
Firm operations
- Finance and billing
src/app/(app)/finance/page.tsx - Reports and export
src/app/(app)/reports - Administration
src/app/(app)/admin
External integrations
- Google Drive
- Google Gmail
Other components
- Firm user
Connections 26
- Firm user → Sign-in and account: signs in
README.md - Sign-in and account → Session and auth: authenticates
- Firm user → Matter workspace: works matters
README.md - Matter workspace → Matter services: loads matter data
- Matter services → Tenant permissions: checks scope
src/server/matters.ts - Matter services → Tenant database: queries matters
src/server/matters.ts - Firm user → Contacts: manages contacts
README.md - Firm user → Tasks and reminders: manages tasks
README.md - Tasks and reminders → Matter services: scopes matter tasks
src/server/tasks.ts - Tasks and reminders → Tenant database: reads and writes
src/server/tasks.ts - Firm user → Calendar and agenda: uses calendar
README.md - Firm user → Notes: writes notes
README.md - Firm user → Document workspace: manages documents
README.md - Document workspace → Document services: downloads documents
src/app/(app)/documents/[id]/download/route.ts - Document services → Document storage: stores document bytes
- Document services → Tenant database: uses tenant data
- Firm user → AI documents: generates documents
README.md - Firm user → AI assistant: requests assistance
README.md - Firm user → Finance and billing: manages billing
README.md - Firm user → Reports and export: views reports
README.md - Reports and export → Matter services: loads firm finance
src/app/(app)/reports/export/route.ts - Reports and export → Tenant database: reads tenant data
- Firm user → Administration: configures firm
README.md - Google Drive → Document services: mirrors files
- Google Gmail → Administration: connects account
- WhatsApp → Administration: configures messaging