How suecalystegia00/susan-next works
Main Components
• FrontEnd Web Application:
• Next.js application that serves the LIFF (LINE Front-end Framework) web interface and exposes API routes (using Next.js API Routing).
• Mention the UI components, page routing (pages folder), and hooks/contexts that manage state.
• BackEnd API Server:
• PHP-based API found in the “back” directory (with controllers for bot communication, questions, users, and LINE webhook endpoints).
• That this part acts as a pseudo REST API built in PHP 5.6 and that environment configuration is managed with .env files and Composer.
• Database:
• External Services:
• External integration with LINE Messaging API. Indicate how the chatbot service interacts with LINE’s webhook endpoints.
• Dialogflow, which is used to manage intents. Show how the system uses its service account keys (provided via the .env) for processing natural language inputs.
• Docker & Containerization:
• Incorporate the Docker components – containers for front, back, and MySQL – coordinated with docker-compose (docker-compose.yml).
Relationships and Data Flows
• Front end sending requests to the backend API:
• How the backend communicates with the MySQL database for CRUD operations.
• Integration with external services:
• Interactions between the LIFF client (browser) and the API endpoints hosted on Vercel (in production) or via Docker (development).
Architectural Patterns and Design Principles
• Separation of concerns between the frontend (UI/LIFF and webhook handling) and backend (REST API) – a common full-stack pattern.
• That even though the backend is “vanilla” PHP, it is organized into controllers (e.g., for bot, line, questions, etc.) following an MVC-like approach.
• Use of environment variables (.env files) and container orchestration using Docker, which are critical for deployment and local development.
Final Recommendations
• Be as detailed as possible by breaking the system down into all its significant components.
• Incorporate any necessary environmental or configuration aspects, emphasizing the usage of .env files and Docker containerization.