Files
mengyaconnect/AGENTS.md
2026-03-18 22:00:41 +08:00

39 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Repository Guidelines
## Project Structure & Module Organization
- `mengyaconnect-backend/` Go (Gin) HTTP + WebSocket SSH bridge. Most logic in `main.go`; config helpers in `config.go`. Persistent data under `data/` (`data/ssh/*.json`, `data/command/command.json`, `data/script/`).
- `mengyaconnect-frontend/` Vite + Vue 3 SPA. Entry at `index.html`; UI in `src/App.vue`; build output in `dist/`.
- `debug-logs/` local logs, not part of app runtime.
## Build, Test, and Development Commands
Backend:
- `cd mengyaconnect-backend && go run .` Run API server (default `:8080`).
- `go build -o mengyaconnect-backend` Build local binary.
- `go fmt ./...` Format Go code.
- `go test ./...` Run Go tests (if present).
Frontend:
- `cd mengyaconnect-frontend && npm install` Install dependencies.
- `npm run dev` Start Vite dev server (`http://localhost:5173`).
- `npm run build` Build production assets to `dist/`.
- `npm run preview` Preview the production build.
Optional container:
- `cd mengyaconnect-backend && docker-compose up --build` Run backend in Docker (host `2431` -> container `8080`).
## Coding Style & Naming Conventions
- Go: follow `gofmt` output; prefer `camelCase` for unexported identifiers and `PascalCase` for exported ones.
- Vue: keep 2-space indentation, double quotes, and semicolons as used in `src/App.vue`. Use `<script setup>` for new components and keep UI code in `mengyaconnect-frontend/src/`.
## Testing Guidelines
- Backend uses Gos standard testing (`*_test.go`). No dedicated lint/test tooling beyond `go test`.
- Frontend has no test runner configured; if you add one, add an npm script and document it here.
## Commit & Pull Request Guidelines
- Commit history is minimal; one commit uses Conventional Commits (`chore: ...`). Prefer `type: short summary` for consistency and keep commits scoped.
- PRs should include: a clear summary, testing notes (commands run), and screenshots for UI changes. Call out any changes to env/config or persisted data.
## Security & Configuration Tips
- Do not commit real SSH credentials or production data in `mengyaconnect-backend/data/`; sanitize sample files.
- Key env vars: backend `PORT`, `DATA_DIR`, `ALLOWED_ORIGINS`; frontend `VITE_WS_URL`/`VITE_WS_PORT`.