How hoangson27/intern-project works
Main Components
• Frontend: Located in the "frontend" directory, this is built using Vue.js (with single-file components like App.vue, Admin.vue, Home.vue, etc.). It handles user interactions and renders views for both customers and administrative roles.
• Backend: Found in the "backend" directory and clearly built as a Node.js (likely Express-based) application. It has a modular structure with controllers (billdetails.js, booktable.js, food.js, etc.), models (BillDetailsModel.js, UserModel.js, etc.), routes (routes.js), and configuration files (database.js).
• Database: Although not explicitly defined in a separate directory, the existence of a “db_restaurant.sql” file in the frontend resources suggests that the project uses a relational database (perhaps MySQL) which stores restaurant data, user orders, table reservations, and food-related info.
• External dependencies & configuration management: Various configuration files like .gitignore, package.json (for both backend and frontend), and deployment-related configurations (vue.config.js, babel.config.js) indicate environment management and build pipeline details.
Relationships and Interactions
• The frontend communicates with the backend via HTTP APIs. The Vue application makes API calls (likely using the axios instance defined in src/axios.js) to the Node service.
• The backend follows a Model-View-Controller (MVC) separation:
• Routes receive requests and delegate responsibility to controllers.
• Controllers interact with models to execute business logic or database operations.
• Data flows from the backend to the database and vice versa. The SQL file helps establish schema requirements for the restaurant’s data.
Architectural Patterns
• Client-Server Architecture: The separation between the Vue-powered frontend and Node.js backend encourages clear separation of concerns.
• Modularization: The division of components in both frontend and backend into distinct directories highlights a modular approach.