Files
LinHelp/docs/deploy/local-runbook.md
2026-07-07 17:51:26 +08:00

128 lines
2.0 KiB
Markdown

# Local Runbook
## Prerequisites
- JDK 8
- Maven
- Node.js 18+
- Docker Desktop, for MySQL, Redis, and MinIO
- WeChat DevTools, for native miniapp compile and preview
## Start Dependencies
```powershell
docker compose -f deploy/docker-compose.dev.yml up -d
```
Expected dependency URLs:
```text
MySQL: localhost:3306
Redis: localhost:6379
MinIO API: http://localhost:9000
MinIO console: http://localhost:9001
```
## Start Backend
```powershell
cd backend
mvn spring-boot:run
```
Expected local URLs:
```text
Backend API: http://localhost:8080
Knife4j docs: http://localhost:8080/doc.html
```
If Docker/MySQL are not available or port `8080` is already occupied, use the no-database demo profile:
```powershell
cd backend
mvn spring-boot:run "-Dspring-boot.run.profiles=demo"
```
Demo profile URL:
```text
Backend API: http://localhost:18080
```
The demo profile starts without MySQL and seeds product, notice, group-buy, a pending group-buy delivery order, secondhand, one goods delivery task, and one express pickup task in memory.
Demo accounts:
```text
Admin: admin / admin123
Merchant: merchant / merchant123
Rider: rider / rider123
Resident: dev miniapp login
```
## Start Admin Web
```powershell
cd admin-web
npm install
npm run dev
```
URL:
```text
http://localhost:5173
```
During local development, `/api` is proxied to `http://localhost:8080` by default. If the backend uses another port:
```powershell
$env:VITE_API_PROXY_TARGET="http://localhost:18080"
npm run dev
```
## Start Rider H5
```powershell
cd rider-h5
npm install
npm run dev
```
URL:
```text
http://localhost:5174
```
Rider H5 uses the same `/api` dev proxy behavior as the admin web.
## Open Miniapp
Use WeChat DevTools to open:
```text
miniapp/project.config.json
```
The miniapp request base URL is configured in `miniapp/miniprogram/utils/request.js`.
## Verification Commands
```powershell
cd backend
mvn test
cd ..\admin-web
npm test
npm run build
cd ..\miniapp
npm test
cd ..\rider-h5
npm test
npm run build
```