How fjdvm/epic-crms works
CREOMS is a staff-facing commerce operations system; sign-in and session validation are delegated to the Portal. Staff use its protected pages to manage orders, returns, customer profiles, tickets, approvals, and settings, with dashboards and reports for oversight. The graph includes major feature areas and shared database, AI, and gateway layers. Several subsystems are represented by their exact feature directories because their implementation was not sampled; their relationships are shown only where the source index or excerpts provide evidence.
Main entry points: server.ts Approval workflow · crms-db.ts CREOMS database · payment-review-actions.ts Payment review · gateway.ts API gateway
Components 25
Portal access
- Portal routes
app/api/portal - Portal client
lib/portal/client.ts - Staff access
lib/portal/staff.ts - Role checks
lib/portal/roles.ts - App shell
components/layout/app-shell.tsx
Commerce operations
- Order operations
features/orders - Payment review
features/orders/payment-review-actions.ts - Returns operations
features/returns - Fulfilment
features/orders/fulfilment.ts - Approval workflow
features/approvals/server.ts - Payment proof reader
features/orders/proof-reader.ts
Customer service
- Customer profiles
features/customer-profiles - Ticket operations
features/tickets - Feedback analysis
features/feedback - Notifications
features/notifications - Service levels
features/tickets/service-level-store.ts
Insights and oversight
- Dashboard
app/(app)/dashboard/page.tsx - Operational reports
features/reports
Shared infrastructure
- CREOMS database
lib/crms-db.ts - Storefront database
lib/db.ts - Tickets database
lib/tickets-db.ts - API gateway
lib/gateway.ts - Structured AI
lib/ai/structured.ts
Other components
- Staff user
- Portal service
Connections 34
- Staff user → Portal routes: signs in
README.md - Portal routes → Portal client: exchanges code
app/api/portal/callback/route.ts - Portal client → Portal service: validates session
lib/portal/client.ts - Staff access → Portal client: checks session
lib/portal/staff.ts - Staff access → Role checks: checks role
lib/portal/staff.ts - Staff user → App shell: uses
- App shell → Staff access: guards pages
- Staff user → Order operations: manages orders
- Staff user → Payment review: reviews payments
- Staff user → Returns operations: handles returns
- Staff user → Fulfilment: manages fulfilment
- Staff user → Approval workflow: reviews requests
- Staff user → Customer profiles: manages profiles
- Staff user → Ticket operations: handles tickets
- Staff user → Feedback analysis: reviews feedback
- Staff user → Dashboard: views metrics
app/(app)/dashboard/page.tsx - Staff user → Operational reports: views reports
- Approval workflow → CREOMS database: reads and writes
features/approvals/server.ts - Approval workflow → API gateway: records audit
features/approvals/server.ts - Approval workflow → Portal service: notifies recipients
features/approvals/server.ts - Approval workflow → Order operations: decides cancellation
features/approvals/server.ts - Ticket operations → Tickets database: loads ticket data
app/(app)/tickets/page.tsx - Ticket operations → Service levels: loads targets
app/(app)/tickets/page.tsx - Service levels → CREOMS database: reads and writes
features/tickets/service-level-store.ts - Payment review → CREOMS database: reads and writes
features/orders/payment-review-actions.ts - Payment review → API gateway: records audit
features/orders/payment-review-actions.ts - Payment review → Service levels: checks settings
features/orders/payment-review-actions.ts - Payment proof reader → Structured AI: analyzes proof
features/orders/proof-reader.ts - Dashboard → CREOMS database: loads metrics
app/(app)/dashboard/page.tsx - Notifications → CREOMS database: syncs events
app/api/notifications/sync/route.ts - Notifications → Tickets database: syncs ticket events
app/api/notifications/sync/route.ts - Notifications → Storefront database: reads customer events
app/api/notifications/sync/route.ts - Order operations → API gateway: uses gateway
features/orders/payment-review-actions.ts - Returns operations → API gateway: uses gateway