# student_dash **Repository Path**: ftb001/student_dash ## Basic Information - **Project Name**: student_dash - **Description**: 中小学生餐食关联系统 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-05 - **Last Updated**: 2026-02-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Student Management System (Student Dash) ## Project Overview The Student Management System is a full-stack, front-end and back-end separated application built on Spring Boot and Vue 3, designed to provide schools with a comprehensive solution for managing student information. The system integrates an AI assistant feature that supports intelligent Q&A, data analysis, and report generation, enabling teachers and parents to manage student-related information more efficiently. This system primarily serves three user groups: school administrators, teachers, and parents, and features a robust role-based permission management system. Administrators can manage all user accounts and system data; teachers can view student information and meal records for their assigned classes; parents can query details about their children’s school activities. The system also introduces an AI assistant powered by OpenAI’s large language model, capable of answering diverse questions regarding student information, class schedules, and nutritional meals, providing personalized advisory services. ## Features ### User Management Module The system provides comprehensive user management functionality supporting multiple user roles: system administrator, teacher, and parent, each with distinct operational permissions. Administrators can create, modify, and delete user accounts, assign roles, and link users to classes or students. Teacher accounts can be associated with specific classes, facilitating student data queries and notification publishing. Parent accounts can be linked to their children, enabling seamless communication between home and school. User authentication employs JWT (JSON Web Token) with token expiration and explicit logout support to ensure session security. ### Student Information Management The student management module enables comprehensive management of core student information, including name, gender, date of birth, and class affiliation. Advanced querying features such as pagination and conditional filtering allow teachers and administrators to quickly locate target students. Each student record includes automatically maintained creation and update timestamps. Class relationships are designed with cascading logic: deleting a class triggers a check for associated students to prevent data inconsistency. Student data supports logical deletion, preserving historical records for future traceability and analysis. ### Class Management The class management module provides CRUD operations for class information, supporting categorization by grade and class name. Each class contains key data such as class name, grade level, and homeroom teacher information. The system establishes relationships between classes and teachers: one teacher may oversee multiple classes, and one class may have multiple subject teachers. Class data is fundamental to numerous business scenarios, including student grouping, grade statistics, and meal management. ### Meal Plan Management Meal planning is one of the system’s core modules, designed to manage daily dietary arrangements for students. Each meal plan includes details such as food name, food type, and service time, and is linked to nutritional information. The system supports querying meal plans by date, assisting cafeteria staff in ingredient preparation and helping parents understand their children’s daily diets. Each meal plan can reference multiple nutritional components to ensure balanced nutrition. Meal plans are also linked to consumption records, enabling statistical analysis of meal usage by class and time period. ### Meal Consumption Management The meal consumption module records detailed dining data for each student, including the student’s identity, meal plan, quantity consumed, and consumption time. It supports pagination and multi-condition filtering, allowing retrieval by class, student name, or date range. The system generates consumption reports to summarize meal usage over specified periods, providing intuitive visual data analytics. These reports offer valuable insights for schools to understand student dietary preferences and optimize meal services. ### Nutritional Component Management The nutritional component module manages nutritional data for food items, supporting CRUD operations. Each nutritional record includes the component name and content value and can be referenced by multiple meal plans. A junction table implements a many-to-many relationship between nutritional components and meal plans, ensuring flexible and standardized data structure. This data is utilized by the AI assistant to answer questions about dietary nutrition, helping parents and teachers monitor students’ nutritional intake. ### Food Type Management The food type module provides classification management for food items, categorizing them into types such as staples, vegetables, meats, fruits, and dairy products. Food types are linked to meal plans, improving organization and presentation of dietary information. Basic CRUD operations are supported, with deletion checks to prevent accidental deletion of food types still referenced by active meal plans. ### AI Assistant Integration The AI integrates an intelligent assistant functionality powered by large-scale AI models based on the LangChain4j architecture and Alibaba Bailian platform, providing users with intelligent consulting services. The AI assistant is built using the Spring AI framework, supporting streaming output for fast response times and an excellent user experience. The assistant integrates multiple business tools, including user information query tool, student information query tool, nutrition information query tool, dining plan query tool, and consumption record query tool. When users ask relevant questions, the AI assistant can automatically invoke the appropriate tools to retrieve real-time data and combine it with the large language model's comprehension capabilities to deliver accurate and professional responses. The AI assistant supports conversation memory functionality, storing dialogue context through Redis to enable continuous conversations. ## Technical Architecture ### Backend Stack The backend is built on Spring Boot 3.x, leveraging its auto-configuration and convention-over-configuration principles. MyBatis-Plus is used for the data access layer, simplifying SQL development with powerful condition builders and automatic field filling. MySQL serves as the primary database for core business data. Redis is employed both for caching and storing AI conversation memory. JWT (JSON Web Token) provides stateless distributed authentication. AI functionality is integrated via the Spring AI framework using OpenAI’s large language model, supporting both synchronous and streaming invocation modes. The system adopts a tool-oriented design pattern, encapsulating business queries as AI tools to enable dynamic real-time data retrieval from backend services. Global exception handling uniformly captures and processes business exceptions, returning standardized error responses. ### Frontend Stack The frontend is built on Vue 3 with Vite as the build tool, enabling fast project startup and hot module replacement. State management utilizes Pinia, replacing Vuex from Vue 2 with a more concise and intuitive API. Routing is managed by Vue Router for single-page application navigation. UI components are implemented using native HTML and CSS for maximum customization flexibility and ease of future integration with third-party UI libraries. The frontend communicates with the backend via Axios, with unified request interceptors and response handlers. Styling employs CSS variables and composite classes to enable theme customization and component reuse. The application follows a modular structure organized by functional modules, facilitating maintenance and scalability. ### Project Structure The project follows a front-end/back-end separated directory structure, with two independent subprojects under the root directory. The `backend` directory (`student_dash`) contains all backend code structured in standard Spring Boot layers: controller, service, and data access layers. The `frontend` directory (`dash_vue`) contains all frontend code organized by views, APIs, and state management. Both projects can be developed, tested, and deployed independently, communicating via RESTful APIs. ## Quick Start ### Environment Requirements The development environment requires the following software and tools: JDK 17 or higher for running Spring Boot applications; Node.js 18 or higher for building the Vue frontend; MySQL 8.0 or higher as the primary database; Redis 6.0 or higher for session caching and AI memory storage. Additionally, Maven or Gradle is required for backend dependency management, and npm or yarn for frontend package management. ### Backend Configuration Upon first use, configure database connection details. Edit the backend configuration file to update MySQL connection URL, username, and password to ensure proper database access. If using Redis caching, configure Redis connection parameters. The configuration file also includes JWT secret key and expiration settings—use secure key values in production environments. Database initialization scripts are located in the `resources` directory. Before first launch, execute the SQL scripts to create required tables and initial data. The system includes a default administrator account; initial credentials are displayed in the startup log. AI functionality requires an OpenAI API key to operate; it is recommended to inject this sensitive value via environment variables rather than hardcoding it into configuration files. ### Frontend Configuration Frontend configuration is handled via environment variable files. Set the backend API endpoint to ensure the frontend can successfully communicate with the backend service. In development, configure this as the local backend address; in production, use the actual deployed server address. The frontend supports hot reload—launch the development server to automatically refresh the page upon code changes. ### Startup Steps First, start the MySQL database and Redis cache services to ensure they are running. Then, import the backend project, compile it using Maven, and run the main application class to start the Spring Boot application. Upon successful startup, the console displays the server port—by default, the backend runs on port 8080. Next, navigate to the frontend project directory, install dependencies, and start the development server. Open your browser and visit the frontend URL to access the Student Management System homepage. ## API Documentation The system provides a rich set of RESTful APIs covering all CRUD operations for business functions. All APIs exchange data in JSON format, with responses structured into three fields: status code, message, and data. Paginated queries return total records, total pages, and data lists to facilitate frontend pagination rendering. User-related APIs require a JWT Token for authentication, transmitted via the HTTP Authorization header. Key API modules include: user login and permission management, student information management, class management, meal plan management, meal consumption management, nutritional component management, food type management, and AI chat interface. Detailed parameters and response formats are documented in code comments within the source files. ## Usage Guide ### Logging In After accessing the homepage, login is required to use system features. Enter your username and password on the login page; the system authenticates your identity and issues a JWT Token. Upon successful login, the token is stored locally and automatically included in subsequent requests for authentication. Different roles see different menu options: administrators have full access, while teachers and parents only see functions within their respective permission scopes. ### Daily Operations After login, use features via the left-side navigation menu. The User Management page allows creating, editing, and deleting accounts. The Class Management page maintains school class information. The Student Management page manages student profiles. The Meal Plan page schedules daily meals; the Nutritional Components page maintains nutritional data; the Consumption Records page logs student meal usage; the Reporting function generates analytical charts of consumption data. ### Using the AI Assistant The AI assistant appears as a floating window on the interface; click to open the chat panel. Users can ask natural language questions such as: “Show me the student list for Class 3A,” “What’s today’s meal plan?” or “What are the nutritional values of milk?” The AI assistant interprets intent, automatically invokes relevant tools to retrieve real-time data, and generates accurate responses. If the assistant cannot understand a query, try rephrasing or contact an administrator. ## Notes JWT tokens have a limited lifespan; prolonged inactivity requires re-login to obtain a new token. For data security, do not save login states on public computers—always log out after use. AI functionality depends on external API services and may be unavailable during network instability or API outages. Sensitive operations such as data deletion trigger confirmation prompts—proceed with caution. Data deletion uses logical deletion; deleted records remain in the database and can be restored upon request to an administrator. ## License This project is released under an open-source license. For full details, refer to the LICENSE file in the project root directory.