How arman-miaa/order-nest works
1. This is a Next.js App Router repository for a restaurant operations platform, likely covering admin/manager/staff/kitchen workflows. The app is organized as a multi-role UI rather than a single generic site.
2. The top-level architectural boundary is the src/app route tree. Route groups split the experience into defaultLayout for public/home pages, auth for login and password recovery, and dashboardLayout for authenticated role-based application areas.
3. The dashboard is subdivided by role and function:
- manager for analytics, floor/table management, menu admin, orders, settings, alerts, and user management
- staff for taking orders, table/service workflows, ready-to-serve queues, and staff dashboard views
- kitchen for kitchen dashboard, order queue, item status, stations, and display views
- admin for a separate admin dashboard entry point
These are distinct feature surfaces, each with its own route pages and feature components.
4. The components/ directory contains most of the real implementation. Pages in src/app are thin route shells that compose domain components from components/dashboard/..., components/module/..., and components/shared/.... This separation indicates a “route as composition layer, components as feature layer” design.
5. State and server data are centralized through Redux and RTK Query. redux/store.ts, redux/features/*, and redux/api/* provide the global client state and API integration. Separate API slices exist for auth, events, members, notifications, restaurant data, uploads, and users, which suggests the app depends heavily on backend CRUD plus live operational data.
6. Authentication is a first-class subsystem. There is a NextAuth route under src/app/api/auth/[...nextauth], a NextAuthSessionProvider, and dedicated auth components for login, signup, OTP verification, password reset, and password change. Authorization is likely role-driven, reinforced by components/shared/role-route-page.tsx and the dashboard segmentation.
7. The restaurant domain models and transformations are isolated in shared types and utilities. components/dashboard/shared/types/restaurant.types.ts, src/types/*, and normalization helpers in src/utils/api-normalize.ts and src/utils/restaurant-normalize.ts indicate a boundary between raw API payloads and UI-friendly models.
8. Real-time or near-real-time operations appear important. The presence of src/utils/socket.ts, queue/order feeds, kitchen alerts, and live dashboard widgets implies websocket or socket-based updates for orders, status changes, and operational notifications.
9. There is a reusable UI foundation underneath the feature screens. components/ui/* and components/ui/core/* provide primitive controls and higher-order widgets such as tables, modals, image uploaders, and custom selects. This looks like a shared design system layered on top of app-specific features, likely using shadcn-style component patterns.
10. Forms are standardized through components/form/* and feature-specific form hooks. Validation schemas live under src/schema/*, while form controls are wrapped in reusable inputs/selects/date pickers. This suggests form-heavy CRUD flows for menu, tables, users, settings, and order creation.
11. The main user workflows are:
- staff creates and tracks orders from menu/table context
- kitchen consumes those orders in queues and station views
- managers inspect analytics, floor status, menus, alerts, and table operations
- authenticated users navigate through role-specific dashboards after login
The architecture supports a pipeline from order capture to kitchen fulfillment to serving/status updates.
12. Visual and layout concerns are separated from business logic. Shared layout elements such as navbar, sidebar, footer, loading states, and banner components sit outside the role features, while each dashboard area has its own cards, feeds, charts, and panels. This keeps navigation chrome and content modules decoupled.
13. Operationally, the project is a standard Next.js app with client-side Redux, app-router layouts, and API integration rather than a microservice repository. The important architecture diagram should show src/app as route composition, components/ as feature/UI implementation, redux/ as client data layer, and src/utils/src/hooks as supporting cross-cutting concerns.
Main entry points: store.ts Redux store · manager Manager routes · layout.tsx Dashboard layout · utils Runtime utils
Components 21
App routes
Next.js App Router boundaries and route composition layers.
- Root layout · Global app shell and providers entry point.
src/app/layout.tsx - Public layout · Default public/home route group.
src/app/(defaultLayout)/layout.tsx - Dashboard layout · Authenticated dashboard route group shell.
src/app/(dashboardLayout)/layout.tsx - Auth routes · Login, register, password reset, and OTP flows.
src/app/(auth) - Manager routes · Manager dashboards for analytics, floor, menu, orders, settings, alerts, and users.
src/app/(dashboardLayout)/manager - Staff routes · Staff workflows for new orders, service, tables, and fulfillment.
src/app/(dashboardLayout)/staff - Kitchen routes · Kitchen views for queues, items, stations, and display pages.
src/app/(dashboardLayout)/kitchen
Feature components
Role-based screens and domain workflows composed by routes.
- Auth pages · Login, signup, forgot/reset password, OTP, and change-password screens.
components/module/Auth - Manager dashboard · Live stats, revenue, active orders, and breakdown panels.
components/dashboard/manager/dashboard - Floor management · Table grid, floor map, and table detail interactions.
components/dashboard/manager/floor-view - Menu manager · Menu and category administration with CRUD flows.
components/dashboard/manager/menu - Order admin · Active, VIP, and historical order oversight.
components/dashboard/manager/orders - Staff ops · Order capture, staff dashboard, tables, and ready-to-serve views.
components/dashboard/staff - Kitchen ops · Queue processing, item status, stations, and kitchen dashboard.
components/dashboard/kitchen
State and data
Redux, RTK Query, auth, normalization, and real-time support.
- Redux store · Global store, slices, provider, and RTK Query integration.
redux/store.ts - API slices · Auth, events, members, notifications, restaurant, uploads, and users endpoints.
redux/api - Domain models · Restaurant types and data normalization boundaries.
components/dashboard/shared/types/restaurant.types.ts - Runtime utils · Socket, cookie, decoding, upload, and normalization helpers.
src/utils
Shared foundation
Reusable UI primitives, forms, layout chrome, hooks, and utilities.
- UI kit · Shared primitives and higher-order UI components.
components/ui - Form system · Reusable inputs, selects, date pickers, and form wrappers.
components/form - App chrome · Navbar, sidebar, footer, loading, banner, and role routing guard.
components/shared
Connections 29
- Root layout → Public layout: wraps · Root layout delegates public routes to the default layout.
- Root layout → Dashboard layout: wraps · Root layout delegates authenticated areas to the dashboard layout.
- Root layout → Auth routes: hosts · Root app tree includes the auth route group.
- Public layout → App chrome: uses · Public pages share common navigation and footer chrome.
- Dashboard layout → Manager routes: hosts · Dashboard layout contains manager surfaces.
- Dashboard layout → Staff routes: hosts · Dashboard layout contains staff surfaces.
- Dashboard layout → Kitchen routes: hosts · Dashboard layout contains kitchen surfaces.
- Auth routes → Auth pages: renders · Auth route pages compose dedicated auth modules.
- Manager routes → Manager dashboard: renders · Manager dashboard route shells compose analytics views.
- Manager routes → Floor management: renders · Floor-view routes compose table management views.
- Manager routes → Menu manager: renders · Menu routes compose catalog admin views.
- Manager routes → Order admin: renders · Order routes compose manager oversight views.
- Staff routes → Staff ops: renders · Staff routes compose order taking and service workflows.
- Kitchen routes → Kitchen ops: renders · Kitchen routes compose queue and station workflows.
- Auth pages → Redux store: auth state · Auth flows rely on client state and session persistence.
- Manager dashboard → Redux store: reads · Dashboard widgets consume global state and RTK Query data.
- Staff ops → Redux store: reads · Staff workflows depend on shared client state and API data.
- Kitchen ops → Redux store: reads · Kitchen workflows depend on shared client state and API data.
- Redux store → API slices: queries · Store integrates RTK Query API slices.
- Redux store → Domain models: models · State and API payloads are normalized into restaurant models.
- Domain models → Runtime utils: normalizes · Utilities transform raw payloads into UI-friendly shapes.
- UI kit → Form system: builds on · Forms are assembled from shared UI primitives.
- App chrome → UI kit: composes · Shared navigation and layout pieces use the UI kit.
- App chrome → Redux store: connects · Role-based navigation and guards depend on auth/state.
- Runtime utils → Redux store: supports · Socket and data helpers feed the client data layer.
- Manager dashboard → Runtime utils: live data · Analytics and operational views consume live/normalized data.
- Kitchen ops → Runtime utils: live queue · Kitchen queue and alert views depend on near-real-time updates.
- Staff ops → Form system: forms · Order creation and service flows use standardized forms.
- Menu manager → Form system: forms · Menu administration uses reusable CRUD form controls.