How ntgx/expo-bot-messenger works
Main Components
a. External Services Layer:
• Facebook Messenger Platform
• API.ai (now Dialogflow) for NLP
• MongoDB (for data storage)
b. Application Core:
• Message Handler System
• Menu System
• Expo Information System
• Database Interface
c. Data Storage:
• JSON Data Store (static content)
• MongoDB (dynamic content)
User Interface Layer
• Facebook Messenger at the top
• Bidirectional connection to the application's webhook
Application Core (Middle Layer)
• Message Handling System:
• Handlers/ directory components (message.js, nlp.js, postback.js, start.js)
• To Menu System (menus/ directory)
• Expo Information System:
• Expo/ directory components as separate modules
• Exhibitors, events, schedule, speakers, sponsors modules
• Database Interface:
• Db/ directory components
• To MongoDB
Data Layer
• JSON files from data/ directory
• MongoDB connection
Use these specific visual elements:
• Blue: External services (Facebook, API.ai, MongoDB)
• Green: Core application components
• Yellow: Data storage
• Gray: Utility functions
• Double lines: Data flow
Important Implementation Details to Include:
Environment Configuration
• Config.js connection to external services
• Environment variables integration
Key Workflows
• User message processing flow
• NLP integration flow
• Data retrieval flow
• Lotto registration flow
Integration Points
• Facebook Messenger webhook
• API.ai NLP service
• MongoDB connection
• Static JSON data loading
Special Considerations:
1. Modular structure of the expo/ directory, as it contains the core business logic
Menu system's integration with the main application flow
Level of Detail:
• Keep the high-level architecture clear and visible
• Use subdiagrams for complex components (like the expo/ directory structure)
• Notes for important configuration requirements