How bliss-tech-solutions/leadflow_crm works
LeadFlow is a real-estate CRM whose central flow captures Meta lead forms, matches them to configured projects, stores leads, then holds or capacity-assigns them for role-scoped sales work and notifications. Admins and sales staff use the Next.js workspace for leads, follow-ups, projects, documents, team, integrations and audit history. The graph includes documented capabilities whose route implementations were not sampled; those links are dashed where wiring is unverified. Other edges cite the server, service, or UI files that show the relationship.
Main entry points: server.ts Express API · leadDelivery.service.ts Hold and assignment · meta.service.ts Lead ingestion · leads.ts Lead workspace
Components 34
CRM workspace
- CRM workspace
frontend/src/app/(dashboard) - Notifications UI
frontend/src/components/Topbar.tsx - API client
frontend/src/lib/api.ts - Session storage
frontend/src/lib/auth.ts - Realtime client
frontend/src/lib/socket.ts
API and access
- Express API
backend/src/server.ts - Authentication
backend/src/routes/auth.ts - JWT and RBAC
backend/src/middleware/auth.ts
Lead operations
- Meta webhook routes
backend/src/routes/meta.ts - Lead ingestion
backend/src/services/meta.service.ts - Hold and assignment
backend/src/services/leadDelivery.service.ts - Lead workspace
backend/src/routes/leads.ts - Follow-ups
backend/src/routes/followups.ts - Notifications
backend/src/routes/notifications.ts - Socket delivery
backend/src/sockets/index.ts
Projects and documents
- Business projects
backend/src/routes/businessProjects.ts - Project documents
backend/src/routes/documents.ts - S3 signing
backend/src/services/s3.service.ts
Persistence and records
- Users and capacity
backend/src/routes/users.ts - Audit history
backend/src/routes/audit.ts - Activity and audit log
backend/src/utils/activity.ts - Lead records
backend/src/models/Lead.ts - User records
backend/src/models/User.ts - Project records
backend/src/models/BusinessProject.ts - Delivery schedule
backend/src/models/LeadDeliverySchedule.ts - Notification records
backend/src/models/Notification.ts - Activity records
backend/src/models/Activity.ts - Audit records
backend/src/models/Audit.ts - Call records
backend/src/models/Call.ts - Follow-up records
backend/src/models/FollowUp.ts
Other components
- Admin / manager
- Salesperson
- Meta Lead Ads
- AWS S3
Connections 48
- Admin / manager → CRM workspace: uses
README.md - Salesperson → CRM workspace: uses
README.md - CRM workspace → API client: requests data
frontend/src/app/(dashboard)/business/page.tsx - API client → Express API: calls API
- CRM workspace → Session storage: uses session
frontend/src/app/(dashboard)/business/page.tsx - CRM workspace → Notifications UI: renders
frontend/src/app/(dashboard)/business/page.tsx - Notifications UI → API client: loads notifications
frontend/src/components/Topbar.tsx - Notifications UI → Realtime client: listens for events
frontend/src/components/Topbar.tsx - Express API → Authentication: mounts
backend/src/server.ts - Express API → Meta webhook routes: mounts
backend/src/server.ts - Express API → Lead workspace: mounts
backend/src/server.ts - Express API → Follow-ups: mounts
backend/src/server.ts - Express API → Business projects: mounts
backend/src/server.ts - Express API → Project documents: mounts
backend/src/server.ts - Express API → Notifications: mounts
backend/src/server.ts - Express API → Audit history: mounts
backend/src/server.ts - Express API → Users and capacity: mounts
backend/src/server.ts - Express API → Socket delivery: sets up
backend/src/server.ts - Express API → Hold and assignment: schedules release
backend/src/server.ts - Authentication → User records: checks credentials
backend/src/routes/auth.ts - Authentication → JWT and RBAC: protects identity route
backend/src/routes/auth.ts - Meta Lead Ads → Meta webhook routes: sends lead webhook
README.md - Meta webhook routes → Lead ingestion: delegates ingestion
backend/src/routes/meta.ts - Lead ingestion → Meta Lead Ads: fetches lead details
backend/src/services/meta.service.ts - Lead ingestion → Project records: matches source
backend/src/services/meta.service.ts - Lead ingestion → Lead records: creates lead
backend/src/services/meta.service.ts - Lead ingestion → Hold and assignment: checks hold and capacity
backend/src/services/meta.service.ts - Hold and assignment → Delivery schedule: reads schedule
backend/src/services/leadDelivery.service.ts - Hold and assignment → Lead records: releases held leads
backend/src/services/leadDelivery.service.ts - Hold and assignment → User records: selects salesperson
backend/src/services/leadDelivery.service.ts - Hold and assignment → Notification records: creates notifications
backend/src/services/leadDelivery.service.ts - Hold and assignment → Socket delivery: emits lead event
- Lead workspace → Lead records: reads and updates
backend/src/routes/leads.ts - Lead workspace → Activity and audit log: logs activity
backend/src/routes/leads.ts - Lead workspace → Call records: uses call records
backend/src/routes/leads.ts - Lead workspace → Follow-up records: uses follow-up records
backend/src/routes/leads.ts - Activity and audit log → Activity records: writes activity
backend/src/utils/activity.ts - Activity and audit log → Audit records: writes audit
backend/src/utils/activity.ts - Business projects → Project records: manages projects
backend/src/routes/businessProjects.ts - Business projects → S3 signing: requests signed uploads
backend/src/routes/businessProjects.ts - Project documents → S3 signing: signs document access
- S3 signing → AWS S3: signs object URLs
README.md - Users and capacity → User records: manages users
- Audit history → Audit records: reads audit records
backend/src/routes/audit.ts - Lead ingestion → Activity and audit log: logs lead events
backend/src/services/meta.service.ts - Hold and assignment → Activity and audit log: logs release
backend/src/services/leadDelivery.service.ts - Lead ingestion → Notification records: creates scoped alerts
backend/src/services/meta.service.ts - Notifications → Notification records: serves inbox