How liliwqt/e-menu-web works
E-Menu Portal is the restaurant-facing TouchOrders product: staff sign in, select a branch, observe live restaurant data, and use deterministic analytics and recommendations to guide operations. For AI features, computed context goes from the frontend through an authenticated FastAPI gateway to OpenAI for interpretation; the gateway is documented as stateless with respect to restaurant data. The repository also contains backend order, payment, and lifecycle capabilities. Some frontend and backend modules were not sampled, so those areas are represented at subsystem level and only documented or indexed relationships are shown.
Main entry points: BranchDataContext.jsx Branch data context · app.py FastAPI application · aiAnalystService.js AI request client · ai.py AI routes
Components 27
Restaurant portal
- Portal routing
src/App.jsx - Identity and workspace
src/context/AuthContext.jsx - Plan and AI access
src/hooks/useAiAccess.js - Operations dashboard
src/pages/DashboardPage.jsx - Inventory workflows
src/pages/InventoryPage.jsx - Subscription state
src/context/SubscriptionContext.jsx - Analytics and reports
src/pages/AnalyticsPage.jsx - Public pages
src/pages/PublicPage.jsx
Restaurant operations
- Branch data context
src/context/BranchDataContext.jsx - Firebase client
src/lib/firebase.js - Sales analytics
src/lib/analyticsApi.js - Inventory and menu
src/lib/menuApi.js
AI intelligence
- Executive presentation
src/components/ai/ExecutivePresentation.jsx - AI request client
src/lib/aiAnalystService.js - AI analyst surfaces
src/components/ai/AIAnalystDrawer.jsx - Backend transport
src/lib/backendFetch.js
Gateway and services
- FastAPI application
agent-core/src/touchorders_core/api/app.py - AI routes
agent-core/src/touchorders_core/api/routes/ai.py - Token verification
agent-core/src/touchorders_core/api/auth.py - AI context shaping
agent-core/src/touchorders_core/api/ai_context.py - LLM gateway
agent-core/src/touchorders_core/llm/gateway.py - Order services
agent-core/src/touchorders_core/api/orders.py - Payment services
agent-core/src/touchorders_core/api/payments.py - Lifecycle services
agent-core/src/touchorders_core/api/lifecycle.py
Other components
- Restaurant staff
- Realtime Database
- OpenAI
Connections 31
- Restaurant staff → Portal routing: uses
README.md - Portal routing → Identity and workspace: renders
src/App.jsx - Identity and workspace → Firebase client: authenticates through
src/context/AuthContext.jsx - Identity and workspace → Realtime Database: loads workspace data
src/context/AuthContext.jsx - Portal routing → Branch data context: scopes branch
src/App.jsx - Branch data context → Firebase client: sets branch context
src/context/BranchDataContext.jsx - Branch data context → Sales analytics: subscribes to
src/context/BranchDataContext.jsx - Branch data context → Inventory and menu: subscribes to
src/context/BranchDataContext.jsx - Firebase client → Realtime Database: reads and writes
README.md - Operations dashboard → Branch data context: consumes
src/pages/DashboardPage.jsx - Operations dashboard → Sales analytics: computes metrics with
src/pages/DashboardPage.jsx - Inventory workflows → Branch data context: uses live data
README.md - Analytics and reports → Sales analytics: presents metrics
README.md - Subscription state → Firebase client: watches entitlements
src/context/SubscriptionContext.jsx - Plan and AI access → Subscription state: checks plan
src/hooks/useAiAccess.js - Operations dashboard → AI request client: requests interpretation
src/pages/DashboardPage.jsx - Executive presentation → AI request client: requests narration
src/components/ai/ExecutivePresentation.jsx - AI analyst surfaces → AI request client: requests analysis
- AI request client → Backend transport: posts analysis
src/lib/aiAnalystService.js - Backend transport → FastAPI application: sends AI request
README.md - FastAPI application → AI routes: registers routes
agent-core/src/touchorders_core/api/app.py - AI routes → Token verification: verifies identity
README.md - AI routes → AI context shaping: builds request context
- AI routes → LLM gateway: dispatches analysis
- LLM gateway → OpenAI: requests explanation
README.md - OpenAI → AI request client: returns structured insights
README.md - FastAPI application → Order services: registers routes
agent-core/src/touchorders_core/api/app.py - FastAPI application → Payment services: registers routes
agent-core/src/touchorders_core/api/app.py - FastAPI application → Lifecycle services: registers routes
agent-core/src/touchorders_core/api/app.py - Inventory and menu → Realtime Database: observes inventory
README.md - Public pages → Restaurant staff: presents product information
README.md