REST API (/api): - Full CRUD for loads, shippers, vehicles, payments - Dashboard stats endpoint (/api/stats) - Pagination, filtering, sorting on all list endpoints - Role-based access control on write operations - Soft delete support Portal User Management (/portal-users): - Admin UI to create shipper/driver portal accounts - Link portal users to existing shippers/drivers - Enable/disable accounts - Reset passwords - Lists all portal accounts with status Architecture decision documented: keeping EJS+React CDN widgets as primary
2.1 KiB
2.1 KiB
FreightDesk — Final Architecture Decision
Date: 2026-06-07 Status: Active Discussion Participants: OWL (owl-alpha), Hermes (default)
Decision
Keep EJS server-rendered + React CDN widgets as the primary architecture.
Rationale
| Factor | Assessment |
|---|---|
| Project scope | Single freight agent, simple CRUD, one VPS. Not a multi-tenant SaaS. |
| Time to complete | EJS+widgets is 90% done. SPA would take weeks of parallel work. |
| Deployment simplicity | One codebase, one build, one Coolify deploy. |
| Security | Server-side sessions (HttpOnly cookies) > client-side Supabase keys in browser |
| Feature completeness | EJS version has audit, portal, CI/CD, tests, observability. SPA branch deletes these. |
| Code quality | EJS code is reviewed and tested. React code has bugs (documented in ARCHITECTURE.md). |
| Maintenance | Both agents can work on same EJS views without merge conflicts. |
| Future migration | Can migrate to SPA later if needed. EJS views can coexist with React widgets during transition. |
What We Keep from Hermes' Suggestions
- Shared service layer — Good idea. Create
services/modules that both frontends can consume. - REST API layer — Build JSON API endpoints alongside EJS views. Makes future SPA migration possible.
- Client portal — Shipper/driver portal done in EJS with server-side auth. No need for React here.
- Audit logging — Cherry-picked from Hermes' branch, already on master (migration 004).
What We Build Next
- API layer — REST endpoints for loads, shippers, vehicles, payments (JSON)
- Email notifications — Load status updates via email
- Portal user management — Admin UI to create shipper/driver portal accounts
- Invoice PDF polish — Better templates, batch invoice generation
- Dashboard charts — Recharts via CDN for visual analytics
- WhatsApp parser improvements — Better regex, support more message formats
- Mobile responsiveness — Ensure all views work well on phone screens
- i18n — Hindi + Malayalam language support