How thuykat/azure-ai-order works
Main Components
• Frontend: Represent the React application (located in frontend/voice-order). Include its core functional pages such as New Order Page, Order History Page, Edit Order Page, and Menu Scanner Page. Highlight key utilities such as voice command processing and state management.
• Backend: Include the Node.js/Express server (backend/server.js), MongoDB models (backend/models folder), and defined API endpoints (backend/routes). Also show utility scripts like the order processing and menu parsing utilities.
• Database: Indicate MongoDB as the data store that holds menu items and orders.
• Azure AI Services: Group together the various Azure services in use:
• Azure Speech Services (for real-time speech-to-text/recognition)
• Azure Language Understanding Service (for intent recognition and entity extraction)
• Azure Form Recognizer / Document Intelligence (for menu image/PDF processing)
• Azure OpenAI Service (for advanced menu interpretation and classification)
• External Integrations & Utilities: Include additional layers where GitHub Copilot has accelerated development through code generation and integration patterns.
Establish Relationships and Interactions
• The Frontend communicates with the Backend via HTTP API calls. This connection is used for sending processed speech data and receiving order confirmation or status updates.
• The Backend interacts with the MongoDB database for storing and retrieving order and menu information.
• Asynchronous process flows: after processing in the Frontend, the data flows to the Backend, which then confirms and updates order history.
• In the menu scanning process, illustrate the flow from image upload to Azure Form Recognizer to Azure OpenAI, ending with database updates.
Architectural Patterns and Design Principles
• Separation of Concerns: Clearly delineate the frontend and backend modules.
• Modular Component-Based Design in the React frontend: Represent pages, hooks, assets, and utilities as individual, inter-dependent modules.
• RESTful API Patterns: Illustrate the API routes and how they serve as a bridge between the frontend and backend.
• Cloud Service Integration: Emphasize the use of Azure AI services as microservices or external API calls integrated into both frontend and backend workflows.
• Event-driven architecture: Some components (e.g., live transcript updates and voice commands) should be depicted as event-driven (with callbacks and hooks).
Relevant Technologies
• Frontend: React, JavaScript (ES Modules), Vite as the build tool.
• Backend: Node.js, Express, MongoDB.
• Cloud/AI: Azure Speech Services, Azure Language Understanding, Azure Form Recognizer, Azure OpenAI.
• Additional: GitHub Copilot (as a note on the development acceleration role) and integration with tools like ESLint.
• Use clear, descriptive labels for each component (e.g., “New Order Page,” “Menu Scanner,” “Order API Route,” “Azure Speech Service”).
• Explicitly mark interactions like “API Call,” “Data Flow” and “Service Integration.”
• Annotations to note the development tools (e.g., GitHub Copilot) and how they influence the overall architecture.
• Detail the backend with API endpoints, data processing modules, and utility functions.
• Cloud interactions (each Azure service) and their specific roles (speaking to real-time processing, intent recognition, document processing, etc.).