How toimasi21/corpseccrm-script works
Veyapuro Clean is a cleaning-service operations platform. Staff and clients enter through the REST API: the server mounts domain routes, which apply authentication and use stores to manage bookings, leads and quotes, finance, workforce, and field operations. Separate routes support client self-service, applicant review, website controls, and M-Pesa payments. Stores use local JSON persistence with PostgreSQL synchronization; the database schema and connection layer provide the relational backing. Edges follow the shown route mounts and source-index references; unsampled route internals are not expanded.
Main entry points: index.ts REST server · sync.ts Postgres synchronization · clientPortal.ts Client portal · operations.ts Field operations
Components 29
API and identity
- REST server
src/index.ts - Authentication
src/routes/auth.ts - Role authorization
src/lib/auth.ts - Session management
src/lib/session.ts
Customer lifecycle
- Booking management
src/routes/bookings.ts - Booking records
src/lib/bookingStore.ts - CRM pipeline
src/routes/crm.ts - Leads and quotes
src/lib/crmStore.ts - Client portal
src/routes/clientPortal.ts
Workforce operations
- Applicant review
src/routes/applications.ts - Applications
src/lib/applicationStore.ts - Staff management
src/routes/workforce.ts - Staff roster
src/lib/staffStore.ts - Attendance and GPS
src/routes/attendance.ts - GPS check-in
src/lib/gpsCheckIn.ts - Field operations
src/routes/operations.ts - Operations records
src/lib/opsStore.ts
Finance and platform data
- Finance and payroll
src/routes/finance.ts - Invoices and payments
src/lib/financeStore.ts - Payroll
src/lib/payrollStore.ts - M-Pesa integration
src/routes/mpesa.ts - Content management
src/routes/cms.ts - Website controls
src/routes/websiteControls.ts - Website settings
src/lib/websiteControlsStore.ts - Postgres synchronization
src/db/sync.ts - Postgres connection
src/db/index.ts - Relational schema
src/db/schema.ts
Other components
- Staff / admin
- Cleaning client
Connections 43
- Staff / admin → REST server: uses API
src/index.ts - Cleaning client → REST server: uses API
- REST server → Authentication: mounts
src/index.ts - REST server → Booking management: mounts
src/index.ts - REST server → CRM pipeline: mounts
src/index.ts - REST server → Staff management: mounts
src/index.ts - REST server → Attendance and GPS: mounts
src/index.ts - REST server → Finance and payroll: mounts
src/index.ts - REST server → M-Pesa integration: mounts
src/index.ts - REST server → Field operations: mounts
src/index.ts - REST server → Content management: mounts
src/index.ts - REST server → Applicant review: mounts
src/index.ts - REST server → Website controls: mounts
src/index.ts - REST server → Client portal: mounts
src/index.ts - Authentication → Role authorization: checks roles
src/routes/auth.ts - Role authorization → Session management: reads session
src/lib/auth.ts - Booking management → Booking records: manages bookings
src/routes/bookings.ts - CRM pipeline → Leads and quotes: manages leads
src/routes/crm.ts - Client portal → Booking records: reads bookings
src/routes/clientPortal.ts - Client portal → Leads and quotes: reads CRM
src/routes/clientPortal.ts - Client portal → Invoices and payments: reads invoices
src/routes/clientPortal.ts - Applicant review → Applications: manages applications
src/routes/applications.ts - Applicant review → Staff roster: creates staff
src/routes/applications.ts - Staff management → Staff roster: manages staff
src/routes/workforce.ts - Attendance and GPS → GPS check-in: checks location
src/routes/attendance.ts - Attendance and GPS → Operations records: records attendance
src/routes/attendance.ts - Field operations → Operations records: manages operations
src/routes/operations.ts - Field operations → Booking records: reads bookings
src/routes/operations.ts - Field operations → Staff roster: reads staff
src/routes/operations.ts - Finance and payroll → Invoices and payments: manages finance
src/routes/finance.ts - Finance and payroll → Payroll: manages payroll
src/routes/finance.ts - M-Pesa integration → Invoices and payments: records payments
src/routes/mpesa.ts - Website controls → Website settings: manages settings
src/routes/websiteControls.ts - Booking records → Postgres synchronization: syncs records
src/lib/bookingStore.ts - Leads and quotes → Postgres synchronization: syncs records
src/lib/crmStore.ts - Staff roster → Postgres synchronization: syncs records
src/lib/staffStore.ts - Operations records → Postgres synchronization: syncs records
src/lib/opsStore.ts - Invoices and payments → Postgres synchronization: syncs records
src/lib/financeStore.ts - Payroll → Postgres synchronization: syncs records
src/lib/payrollStore.ts - Applications → Postgres synchronization: syncs records
src/lib/applicationStore.ts - Website settings → Postgres synchronization: syncs records
src/lib/websiteControlsStore.ts - Postgres synchronization → Postgres connection: uses connection
src/db/sync.ts - Postgres connection → Relational schema: configures ORM
src/db/index.ts