文档: 新增 Docusaurus 官网与双语文档,README 切换为英文默认 (#39)

- 新建 docs-site/ Docusaurus 项目,支持 en + zh-Hans 双语
- 从 README 迁移内容为独立文档页面:
  - Getting Started(安装、快速开始)
  - Deployment(Docker、裸机、Nginx、配置参考)
  - Features(备份类型、存储后端、SAP HANA、多节点集群、通知)
  - Reference(API、CLI)
  - Development(开发、贡献)
- 自定义 BackupX 主题色、logo、落地页组件
- 新增 .github/workflows/docs.yml,Actions 自动构建并发布到 GitHub Pages
- README.md 切换为英文,中文版挪到 README.zh-CN.md,两者均精简为导航型
- 配置站点 URL:https://awuqing.github.io/BackupX/
This commit is contained in:
Wu Qing
2026-04-17 13:19:41 +08:00
committed by GitHub
parent 757b0fa5ed
commit bc3d03de7e
55 changed files with 22429 additions and 901 deletions

View File

@@ -0,0 +1,41 @@
---
sidebar_position: 2
title: Contributing
description: How to report issues, propose changes, and submit PRs.
---
# Contributing
BackupX is open-source under Apache License 2.0. Issues and pull requests are welcome.
## Reporting bugs
Open an issue at [github.com/Awuqing/BackupX/issues](https://github.com/Awuqing/BackupX/issues). Please include:
- BackupX version (`backupx --version`)
- Your deployment mode (Docker / bare metal / from source)
- Relevant backup task type and storage backend
- Steps to reproduce
- Stdout / `backupx.log` excerpt for the window around the problem
## Proposing changes
For significant features or refactors, open an issue first to align on scope before investing in a PR.
## Pull requests
1. Fork and create a topic branch (e.g. `fix/windows-path-escape`)
2. Run `make test` and make sure everything passes
3. Keep changes focused — one concern per PR
4. Write commit messages in Chinese following `类型: 简要描述` — examples:
- `功能: 新增审计日志模块`
- `修复: 目录浏览器无法进入子目录`
- `重构: 简化存储目标解密逻辑`
- Types: `功能` / `修复` / `重构` / `文档` / `构建` / `测试`
5. PR title and body in Chinese too. Describe the why and how, not just the what.
## Coding guidelines
- **Go** — handle every error (no `_ = err`); use the existing logger (`zap`); no `fmt.Println` in production paths
- **TypeScript** — strict mode, no implicit any, follow existing ESLint/Prettier configs
- **Commit scope** — one logical change per commit; don't mix drive-by cleanups with feature work

View File

@@ -0,0 +1,83 @@
---
sidebar_position: 1
title: Development Setup
description: Get a BackupX dev environment running — backend, frontend, tests.
---
# Development Setup
**Requirements:** Go ≥ 1.25, Node.js ≥ 20, npm.
## Clone & install
```bash
git clone https://github.com/Awuqing/BackupX.git && cd BackupX
cd web && npm install && cd ..
```
## Dev servers
Run the backend and the Vite dev server in two terminals:
```bash
# Terminal 1: backend on :8340
make dev-server
# Terminal 2: Vite with HMR on :5173
make dev-web
```
The Vite config proxies `/api` to `http://127.0.0.1:8340` so you can open the UI at `http://localhost:5173`.
## Tests
```bash
make test # runs Go + Web test suites
make test-server # Go only
make test-web # Vitest only
```
## Production build
```bash
make build # server/bin/backupx + web/dist
make docker # Docker image
make docker-cn # Docker image with mainland China mirrors
```
## Tech stack
| Component | Stack |
|-----------|-------|
| **Backend** | Go · Gin · GORM · SQLite · robfig/cron · rclone |
| **Frontend** | React 18 · TypeScript · ArcoDesign · Vite · Zustand · ECharts |
| **Storage** | rclone (70+ backends) · AWS SDK v2 · Google Drive API v3 |
| **Security** | JWT · bcrypt · AES-256-GCM |
## Project layout
```
BackupX/
├── server/ # Go backend
│ ├── cmd/backupx/ # Entry point + subcommands (agent, backint, reset-password)
│ ├── internal/
│ │ ├── agent/ # Agent CLI logic
│ │ ├── app/ # Wiring (repositories → services → handlers)
│ │ ├── backup/ # Backup runners (file / mysql / postgres / sqlite / saphana)
│ │ ├── backint/ # SAP HANA Backint protocol
│ │ ├── http/ # HTTP handlers + router
│ │ ├── model/ # GORM models
│ │ ├── repository/ # DB access
│ │ ├── service/ # Business logic
│ │ └── storage/ # Storage providers (rclone + direct SDKs)
│ └── pkg/ # Generic utilities
├── web/ # React frontend (Vite)
│ └── src/
│ ├── components/
│ ├── pages/
│ ├── services/
│ └── types/
├── docs-site/ # This documentation site (Docusaurus)
├── deploy/ # install.sh, systemd unit, nginx config
└── Makefile
```