4.3 KiB
4.3 KiB
AGENTS.md — Tourism Promotion Management System
旅游宣传管理系统 — 毕业设计项目. Full-stack tourism platform with admin dashboard and user-facing web app.
Project Structure
Three independent subsystems in one repo (not a monorepo with shared packages):
| Directory | Stack | Dev Port | UI Framework |
|---|---|---|---|
tourism-server/ |
SpringBoot 4.0.6 + JDK 21 | 8080 | — |
tourism-admin/ |
Vue 3.5 + Vite 6 + TS 5.7 | 3000 | Ant Design Vue 4 |
tourism-web/ |
Vue 3.5 + Vite 6 + TS 5.7 | 3001 | Element Plus 2.9 |
Critical: tourism-admin and tourism-web use different UI frameworks. Do not swap components between them.
Development Commands
Backend (tourism-server/)
mvn install -DskipTests
mvn spring-boot:run
- Main class:
com.tourism.TourismApplication - Application config:
application.yml+application-dev.yml - Active profile:
dev - Maven uses Aliyun + HuaweiCloud + Spring Milestones/Snapshots repositories
Admin Frontend (tourism-admin/)
pnpm install # packageManager is pnpm@10.23.0
pnpm dev # port 3000
- Uses pnpm (not npm/yarn).
packageManagerfield enforces this. - Build:
pnpm build(runsvue-tsc -b && vite build) - Lint:
pnpm lint(eslint with .vue,.ts extensions)
Web Frontend (tourism-web/)
pnpm install
pnpm dev # port 3001
- Build:
pnpm build(runsvue-tsc -b && vite build) - No lint script configured
API & Auth
- Both frontends proxy
/apitohttp://localhost:8080 - Auth: Sa-Token (v1.45.0). Token sent in
tokenheader (notAuthorization) - Admin login mock: username
admin/ password123456 - Backend response format:
{ code: 200, msg: "...", data: ... } - 401 unauthenticated → redirect to login page
Backend Architecture
- Package root:
com.tourism - Modules by domain:
user/,attraction/,product/,order/,travel/,admin/,payment/,file/,common/ - Each module:
entity/,mapper/,service/,service/impl/,controller/,dto/ - ORM: MyBatis-Plus 3.5.15 with logical delete (
isDeletedfield, 0=not deleted, 1=deleted) - DB: MySQL 8.0 (
tourism_platform), init script:tourism_platform.sqlat repo root - Passwords encrypted with
spring-security-crypto(BCrypt) - File storage: RustFS (configured in
application.yml) - Payment: Alipay sandbox SDK
- JSON: Fastjson2
- DTO mapping: MapStruct 1.6.3 + Lombok (both require annotation processor in Maven)
- API docs: Knife4j (Swagger UI alternative), available when server runs
Database Setup
mysql -u root -p < tourism_platform.sql
Default credentials (override in application-dev.yml):
- URL:
jdbc:mysql://localhost:3306/tourism_platform - Username:
root - Password:
root(in base config),123456(in dev profile)
Frontend Architecture
tourism-admin
- Entry:
src/main.ts - Router:
src/router/index.ts(all routes in one file) - State: Pinia (
stores/user.ts,stores/app.ts) - Icons:
@ant-design/icons-vue(all registered globally) - Charts: ECharts + vue-echarts
- MockJS:
src/mock/index.tsprovides mock data for all admin APIs. Imported inmain.ts. - Styles: SCSS (
src/assets/styles/index.scss)
tourism-web
- Entry:
src/main.ts - Router:
src/router/index.ts - State: Pinia (
stores/user.ts,stores/cart.ts) - Icons:
@element-plus/icons-vue - Styles: SCSS (
src/assets/styles/index.scss)
Design Systems
Design specs are in design-system/ directory:
design-system/tourism-admin/MASTER.md— Purple theme (#7C3AED), Fira Code/Sans, data-dense dashboard styledesign-system/tourism-web/MASTER.md— Sky blue theme (#0EA5E9), Noto Sans Thai, motion-driven storytelling style
Important Notes
- No tests exist in any subsystem. Add tests if required.
- No CI/CD configured.
- Both frontends use
noUnusedLocals: falseandnoUnusedParameters: falsein tsconfig. - Admin uses
unplugin-auto-importandunplugin-vue-components(auto-import Vue APIs and components). - All
@/aliases resolve tosrc/. tourism_platform.sqlat repo root is the single source of truth for database schema.- This is a graduation project (毕业设计). Code may be simplified; prioritize clarity and functionality over enterprise patterns.