Development Guide
This guide is for contributors to the HealthGuard website.
Requirements
- Node.js: >= 18.0.0
- npm: >= 9.0.0 (this repo uses npm)
Quick Start
bash
git clone https://github.com/Claud-Lu/healthguard-website.git
cd healthguard-website
npm install
npm run devThe dev server runs at http://localhost:5173 by default.
Commands
| Command | Description |
|---|---|
npm run dev | Start dev server with HMR |
npm run build | Production build to .vitepress/dist/ |
npm run preview | Preview build output (run after build) |
npm run lint | TypeScript type check (tsc --noEmit) |
Project Structure
healthguard-website/
├── .github/workflows/ # CI/CD (GitHub Actions)
├── .vitepress/
│ ├── config.ts # Site config (nav, sidebar, i18n)
│ ├── theme/
│ │ ├── index.ts # Theme entry
│ │ ├── Layout.vue # Custom layout (home / docs switch)
│ │ └── style.css # Brand style overrides
│ └── dist/ # Build output (gitignored)
├── src/
│ └── components/ # Vue components (landing page sections)
│ ├── home/ # Homepage components
│ └── shared/ # Shared components
├── zh/ # Chinese content
├── en/ # English content (mirrors zh/)
├── public/ # Static assets (logo, screenshots, OG image)
├── package.json
├── tsconfig.json
└── README.mdContent Workflow
Adding a Document
Example: adding a "Deployment Guide":
- Create
zh/guide/deployment.md - Add frontmatter:yaml
--- title: Deployment Guide description: Deploy HealthGuard with Docker Compose --- - Write the Markdown body
- Register the link in
.vitepress/config.tssidebar - Create the English version
en/guide/deployment.md - Register in the English sidebar
Editing the Homepage
Homepage components are in src/components/home/. Edit the corresponding Vue file.
Adding Images
- Place images in
public/ - Reference with
/xxx.pngin Markdown or Vue
i18n Sync Checklist
After editing any document:
- [ ] Chinese document updated
- [ ] English document synced
- [ ] Sidebars in
.vitepress/config.tssynced for both languages - [ ] Homepage text synced (if affected)
- [ ] Both language versions accessible in dev server
Commit Convention
This project uses Conventional Commits:
feat: new feature
docs: documentation update
fix: bug fix
style: style adjustment
refactor: code refactoringPre-deployment Checklist
- [ ]
npm run buildsucceeds without errors - [ ]
npm run linthas no type errors - [ ] All pages display correctly in
npm run preview - [ ] Language switching works
- [ ] Mobile view looks good
- [ ] All external links are accessible