Overview
A client application for meal-prep, catering, and personal-chef workflows. The platform combines a public ordering experience, guest and registered-customer checkout, scheduled meal plans, pickup and delivery options, service requests, authenticated accounts, administrative approval flows, payments, notifications, and an operations dashboard.
Engineering Lifecycle
Completed phases are based on the project's current recorded progress.
5 of 8 phases complete
- DiscoveryComplete
- ResearchComplete
- PlanningComplete
- PrototypeComplete
- ValidationNot complete
- DocumentationComplete
- ReleaseNot complete
- MaintenanceNot complete
Current Focus
The implemented system is a Next.js modular monolith with Prisma-backed relational persistence. Current engineering work centers on strengthening automated coverage, separating complex order orchestration into testable services, improving retry behavior for notifications and submissions, and hardening operational controls without changing the shared transactional architecture.
Design Decisions
- Use a Next.js modular monolith
- Keep the public site, customer accounts, administrative dashboard, API routes, authentication, and business workflows in one deployable application with a shared transactional data model.
- Make the server authoritative for ordering
- Treat browser cart and checkout state as input only. The server reloads current catalog and meal-plan records, validates selections and scheduling, recalculates amounts, and applies capacity and approval rules before creating an order.
- Persist immutable order snapshots
- Copy the relevant item, option, meal-plan, allergen, fulfillment, and contact details into order-owned records so later catalog changes do not alter historical transactions.
- Model meal plans separately from standard menu items
- Represent weekly periods, packages, offerings, schedules, and capacity explicitly so scheduled meal-prep ordering does not overload the ordinary catalog model.
- Separate approval from fulfillment
- Track administrative approval independently from operational status so order types that require review can be approved before payment and fulfillment progress begins.
- Share one service-request workflow
- Use a typed service-request model for catering and personal-chef inquiries while preserving guarded review, quotation, approval, and payment phases.
- Recheck privileged roles from persistence
- Use authenticated sessions for identity while consulting the persisted role for administrative and owner-level authorization decisions.
- Reconcile payments through a persisted ledger
- Record payment attempts, purposes, retry identities, callback events, and refund relationships independently from the user interface, then reconcile provider callbacks against those records transactionally.
Tradeoffs
- Modular monolith versus separate services
- A single Next.js application keeps the interface, APIs, authentication, and transactional workflows together, but requires discipline to keep route handlers and domain logic from becoming tightly coupled.
- Browser-persisted cart versus server-owned cart
- Local cart and checkout state supports guest use and reload recovery, but it can become stale or be modified, so the server must revalidate every commercial decision.
- Order snapshots versus normalized catalog references
- Snapshots preserve the meaning of historical orders after catalog changes, at the cost of additional tables and duplicated values.
- Token-based sessions with persisted role checks
- Session tokens keep identity checks efficient, while database role checks keep privileged access current at the cost of an additional server-side lookup.
- Synchronous notifications versus a queued outbox
- Sending notifications directly keeps the workflow simple, but does not provide durable retry when a notification provider is unavailable.
Known Limitations
- Automated regression coverage does not yet span the full ordering, authorization, approval, payment, refund, and service-request workflows.
- Order creation currently concentrates parsing, validation, pricing, persistence, payment, and notification orchestration in one large server boundary.
- Some operational protections are scoped to a single application process rather than shared infrastructure.
- Transactional notifications do not yet use a durable retry queue.
- Initial order and service-request submissions do not have a demonstrated end-to-end idempotency contract.
- Cart and checkout drafts remain local to one browser profile.
- Account recovery and stronger privileged-authentication controls remain future work.
- Uploaded media depends on separately managed durable storage and backup procedures.
Lessons Learned
- Browser-side commerce state should be treated as an untrusted draft; availability, configuration, scheduling, and totals need to be resolved again on the server before persistence.
- Historical orders require immutable snapshots because catalog items, meal-plan offerings, options, and schedules change over time.
- Privileged authorization should be checked against persisted roles rather than relying only on session claims.
- Meal plans need their own scheduling and capacity model instead of being represented as ordinary menu items.
- Approval-required work needs a distinct payment phase so payment does not precede administrative review.
- Payment processing requires an internal ledger, idempotency, and reconciliation rather than only a checkout interface.
- Operational runbooks preserve important context, but they do not replace executable regression tests.
Future Improvements
- Add automated unit, integration, and end-to-end coverage for ordering, scheduling, authorization, approval, payments, refunds, and service-request transitions.
- Decompose order creation into testable validation, pricing, persistence, payment, and notification services without changing its transactional behavior.
- Move process-scoped operational protections to shared infrastructure where multi-instance behavior requires it.
- Add durable notification delivery and idempotency for initial order and service-request submissions.
- Strengthen account recovery and privileged authentication.
- Add structured, privacy-safe observability and explicit health checks.
- Separate schema migration execution from application compilation when the release environment supports a controlled migration phase.
- Automate backup and restore rehearsal for persisted records and uploaded media.
Future Direction
Continue maturing the existing architecture through stronger account recovery, privacy-safe observability, durable background work, shared operational safeguards, controlled schema releases, and tested recovery procedures. Separate services are not planned without evidence that a workflow needs independent scaling or ownership.