Files
gpf_pet_hospital/AGENTS.md
王子琦 f9bfb8556b add
2026-02-09 21:14:30 +08:00

2.2 KiB

Repository Guidelines

Project Structure & Module Organization

  • backend/ is a Spring Boot 2.7 (Java 17) service with MyBatis-Plus and JWT security.
    • Main code: backend/src/main/java/com/gpf/pethospital
    • Config: backend/src/main/resources/application.yml and application-dev.yml
  • frontend/ is a Vue 3 + Vite app with Pinia and TDesign.
    • Source: frontend/src/ (pages, router, store, layouts, styles)
    • Static assets: frontend/src/assets/
  • docs/ and *.drawio contain documentation and UML/ER diagrams.
  • frp/ and start_frp.sh include FRP configuration/scripts.

Build, Test, and Development Commands

Backend (from backend/):

  • mvn spring-boot:run — run the API locally.
  • mvn clean package — build a runnable jar.
  • mvn test — run Spring Boot tests (if present).

Frontend (from frontend/):

  • npm install — install dependencies.
  • npm run dev — start Vite dev server.
  • npm run build — production build.
  • npm run preview — preview the production build.

Coding Style & Naming Conventions

  • Java: 4-space indentation, standard Spring Boot conventions, packages under com.gpf.pethospital.
  • Vue/TypeScript: ES module syntax, semicolons used; follow existing file structure.
  • Use descriptive, domain-specific names (e.g., AppointmentController, appointmentService).

Testing Guidelines

  • No dedicated test directories are present yet.
  • Backend tests should go in backend/src/test/java using Spring Boot Test.
  • Frontend has no test runner configured; if adding, include a script in frontend/package.json.

Commit & Pull Request Guidelines

  • Current commit history uses short Chinese descriptions like “添加…” and “将…更改为…”.
  • Keep messages short, imperative, and meaningful; avoid placeholder commits like “1”.
  • PRs should include: a clear summary, testing performed (or “not run”), and screenshots for UI changes.

Configuration & Security Notes

  • application-dev.yml contains local MySQL defaults (user root, password password). Update credentials via environment or local overrides; do not commit real secrets.
  • JWT secrets are currently hardcoded in config; rotate for real deployments.