2.2 KiB
2.2 KiB
Repository Guidelines
Project Structure & Module Organization
mengyaconnect-backend/Go (Gin) HTTP + WebSocket SSH bridge. Most logic inmain.go; config helpers inconfig.go. Persistent data underdata/(data/ssh/*.json,data/command/command.json,data/script/).mengyaconnect-frontend/Vite + Vue 3 SPA. Entry atindex.html; UI insrc/App.vue; build output indist/.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-backendBuild local binary.go fmt ./...Format Go code.go test ./...Run Go tests (if present).
Frontend:
cd mengyaconnect-frontend && npm installInstall dependencies.npm run devStart Vite dev server (http://localhost:5173).npm run buildBuild production assets todist/.npm run previewPreview the production build.
Optional container:
cd mengyaconnect-backend && docker-compose up --buildRun backend in Docker (host2431-> container8080).
Coding Style & Naming Conventions
- Go: follow
gofmtoutput; prefercamelCasefor unexported identifiers andPascalCasefor 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 inmengyaconnect-frontend/src/.
Testing Guidelines
- Backend uses Go’s standard testing (
*_test.go). No dedicated lint/test tooling beyondgo 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: ...). Prefertype: short summaryfor 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; frontendVITE_WS_URL/VITE_WS_PORT.