How ncfventurestudio-ship-it/nvfs-crm works
This repository is a Next.js enterprise operations platform spanning workforce, finance, CRM, inventory, legal, and other business areas. The visible workflow is an authenticated user working through the app interface and its API routes; routes apply domain services and shared persistence. Sampled source supports the employee, task, operations, and automation paths, plus shared authentication and event handling. Other product areas are present in the tree but their internal wiring was not sampled, so their links are omitted rather than inferred.
Main entry points: route.ts Employee API · auth.ts Session auth · db.ts Prisma database · workflow-engine.service.ts Workflow engine
Components 24
App experience
- App interface
src/app/app/layout.tsx
Business domains
- Employee API
src/app/api/employees/route.ts - Task API
src/app/api/tasks/route.ts - Operations API
src/app/api/operations/route.ts - Calendar API
src/app/api/calendar/route.ts - Finance
src/app/api/finance/overview/route.ts - CRM
src/app/api/crm/clients/route.ts - Inventory
src/app/api/inventory/overview/route.ts - HR and payroll
src/app/api/hr/leaves/route.ts - Legal
src/app/api/legal/cases/route.ts - Task service
src/services/task.service.ts - Operations service
src/services/operation.service.ts
Shared platform
- Session auth
src/lib/auth.ts - Offline auth
src/lib/offline-auth.ts - Employee store
src/lib/employee-store.ts - Access control
src/services/rbac.service.ts - Prisma database
src/lib/db.ts - API responses
src/lib/api-response.ts - Audit service
src/services/audit.service.ts
Automation
- Workflow engine
src/services/workflow-engine.service.ts - Event bus
src/services/event-bus.service.ts - Escalation engine
src/services/escalation-engine.service.ts - AI services
src/services/ai/ai.service.ts
Other components
- Business user
Connections 25
- Business user → App interface: uses
- App interface → Employee API: requests
- Employee API → Session auth: authenticates
src/app/api/employees/route.ts - Employee API → Prisma database: queries
src/app/api/employees/route.ts - Employee API → Employee store: uses fallback
src/app/api/employees/route.ts - Employee API → Access control: checks access
src/app/api/employees/route.ts - Employee API → API responses: formats response
src/app/api/employees/route.ts - Task API → Session auth: authenticates
src/app/api/tasks/route.ts - Task API → Task service: delegates
src/app/api/tasks/route.ts - Task API → API responses: formats response
src/app/api/tasks/route.ts - Operations API → Session auth: authenticates
src/app/api/operations/route.ts - Operations API → Operations service: delegates
src/app/api/operations/route.ts - Calendar API → Session auth: authenticates
src/app/api/calendar/route.ts - Calendar API → API responses: formats response
src/app/api/calendar/route.ts - Session auth → Prisma database: loads session
src/lib/auth.ts - Session auth → Offline auth: falls back
src/lib/auth.ts - Offline auth → Employee store: looks up employees
src/lib/offline-auth.ts - Workflow engine → Prisma database: reads and writes
src/services/workflow-engine.service.ts - Workflow engine → Event bus: publishes events
src/services/workflow-engine.service.ts - Workflow engine → Escalation engine: executes escalation
src/services/workflow-engine.service.ts - Workflow engine → Audit service: logs mutations
src/services/workflow-engine.service.ts - Event bus → Prisma database: writes notifications
src/services/event-bus.service.ts - Event bus → Audit service: logs events
src/services/event-bus.service.ts - Escalation engine → Event bus: publishes notice
src/services/escalation-engine.service.ts - Escalation engine → Prisma database: resolves targets
src/services/escalation-engine.service.ts