Building a WeChat Mini‑Program Dormitory Management System in 20 Minutes with Cursor AI
The author demonstrates how Cursor AI and Opus 4.7 can generate a complete campus dormitory management solution—including a Spring Boot backend, Vue 3 admin portal, and a WeChat mini‑program front‑end—within twenty minutes, and provides the source code, video tutorial, and deployment details.
Project Positioning
Undergraduate‑level campus dormitory management system that combines a web‑based admin portal and a WeChat mini‑program for student self‑service. Both front‑ends share a single Spring Boot backend and a MySQL database.
Business Functions
Admin Portal (Browser)
Dashboard shows total students, available rooms, occupancy rate, pending repairs, etc.
Statistics & Visualization includes repair‑type pie chart, 7‑day repair trend, building occupancy bar chart, hygiene level pie chart, login logs.
Core Modules cover user management, student records, building and room info, check‑in records, repair handling, hygiene inspection, announcements, visitor registration, leave/late‑return approval, room‑transfer approval, and related configuration.
Student Side (WeChat Mini‑Program)
Login and home page display personal summary, announcements, and quick links.
Repair – list, create, view details.
Announcements – list and detail view.
Leave / Late Return – list and create; date‑time format yyyy-MM-dd HH:mm:ss.
Room Transfer – list and create; requires target dormitory numeric ID.
My Profile – view personal information and logout.
Permissions & Roles
Lightweight permission model using JWT + interceptor.
Three roles: system administrator, dormitory manager, student.
Admin portal focuses on configuration and approval; mini‑program focuses on student‑side processes.
Architecture & Technology Stack
Overall Architecture
Front‑end / back‑end separation with dual front‑ends: server provides REST APIs under context path /api. client (Vue) and weixin (mini‑program) both consume the same backend.
Data layer: MySQL 8 database named db_dormitory. Schema and sample data are in server/sql/db_dormitory.sql.
File uploads stored locally at D:/uploads and exposed via /api/uploads/** (configured in server/src/main/resources/application.yml).
Backend ( server/ )
Spring Boot 4 (version 4.0.6) with JDK 17.
Spring WebMVC, MyBatis ( mybatis-spring-boot-starter 4.x) and MySQL driver.
Dependencies: jjwt for JWT, Hutool, Lombok.
Typical layered structure:
controller → service/impl → mapper + XML → entity / dto / vo.
Admin Front‑end ( client/ )
Vue 3, Vite, Vue Router, Pinia for state management.
UI libraries: Element Plus, ECharts, Axios.
During development, Vite proxies /api to backend port 8080.
WeChat Mini‑Program ( weixin/ )
Native WeChat mini‑program.
Entry file weixin/app.js sets globalData.baseUrl to http://localhost:8080/api (disable domain verification for local testing).
Run & Integration Highlights
Backend runs on default port 8080; API prefix is http://localhost:8080/api.
Admin portal development server runs on port 5173.
Database connection defaults to localhost:3308 with database name db_dormitory.
Demo environment uses a simple password policy; production should employ strong keys, HTTPS, and proper password storage.
Directory Overview
server/– Spring Boot backend; API context path /api. client/ – Vue 3 admin portal (Vite + Element Plus). weixin/ – WeChat mini‑program (student side). server/sql/db_dormitory.sql – SQL script to create schema and insert test data.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
java1234
Former senior programmer at a Fortune Global 500 company, dedicated to sharing Java expertise. Visit Feng's site: Java Knowledge Sharing, www.java1234.com
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
