|
|
@@ -1,127 +1,76 @@
|
|
|
# Simple Template
|
|
|
|
|
|
-## Quick Start
|
|
|
+本项目包含以下模块:
|
|
|
|
|
|
-This project contains:
|
|
|
+- `backend`:[Agileboot-Back-End](https://github.com/valarchie/AgileBoot-Back-End) 管理后台 API。
|
|
|
+- `frontend/web`:[Agileboot-Front-End](https://github.com/valarchie/AgileBoot-Front-End) 管理后台前端。
|
|
|
+- `frontend/app`:[Taro](https://docs.taro.zone/docs/) + Vue 3 小程序前端。
|
|
|
|
|
|
-- `backend`: Spring Boot admin API.
|
|
|
-- `frontend/web`: Vite + Vue 3 admin frontend.
|
|
|
-- `frontend/app`: Taro + Vue 3 app frontend.
|
|
|
+本地开发流程通常是先使用 Docker 启动 MySQL 和 Redis,然后在本地启动后端服务,Web 前端或小程序端。
|
|
|
|
|
|
-The local development flow starts MySQL and Redis with Docker, then runs the
|
|
|
-backend and web frontend locally.
|
|
|
-
|
|
|
-### Requirements
|
|
|
+## 环境要求
|
|
|
|
|
|
- JDK 8+
|
|
|
-- Docker Desktop or Docker Engine with Compose
|
|
|
+- Docker
|
|
|
+- Docker Compose
|
|
|
- Node.js
|
|
|
- pnpm
|
|
|
|
|
|
-### Start Infrastructure
|
|
|
-
|
|
|
-The development backend is configured to use the same defaults as
|
|
|
-`backend/docker-compose.yml`:
|
|
|
-
|
|
|
-- MySQL: `localhost:3306`, user `root`, password `root123`
|
|
|
-- Redis: `localhost:6379`, password `redis123`
|
|
|
-- Database name: `agileboot_pure`
|
|
|
+## Git Hooks
|
|
|
|
|
|
-You can start MySQL and Redis manually:
|
|
|
+本仓库使用 `.githooks` 作为统一的 Git hooks 入口。
|
|
|
|
|
|
```bash
|
|
|
-cd backend
|
|
|
-docker compose up -d
|
|
|
+git config core.hooksPath .githooks
|
|
|
```
|
|
|
|
|
|
-The compose configuration mounts `backend/sql/agileboot.sql` into the MySQL
|
|
|
-container as `/docker-entrypoint-initdb.d/01-agileboot.sql`.
|
|
|
-The official MySQL image only runs files in `/docker-entrypoint-initdb.d` when
|
|
|
-the database directory is empty, during the first initialization of the
|
|
|
-`mysql_data` volume.
|
|
|
+## 启动基础服务
|
|
|
|
|
|
-If MySQL has already been started before, the `mysql_data` volume already
|
|
|
-contains data and `docker compose up -d` will not import the SQL again. To
|
|
|
-reinitialize the local database, remove the volumes first:
|
|
|
+启动 MySQL 和 Redis:
|
|
|
|
|
|
```bash
|
|
|
cd backend
|
|
|
-docker compose down -v
|
|
|
-docker compose up -d
|
|
|
-```
|
|
|
|
|
|
-Warning: `docker compose down -v` deletes the local MySQL and Redis volumes,
|
|
|
-including existing database data and Redis data.
|
|
|
+# 启动 MySQL 和 Redis
|
|
|
+docker compose up -d
|
|
|
|
|
|
-If you do not want to delete the volumes, import the SQL manually:
|
|
|
+# 停止 MySQL 和 Redis
|
|
|
+docker compose down
|
|
|
|
|
|
-```bash
|
|
|
-cd backend
|
|
|
-docker exec -i mysql-server mysql -uroot -proot123 agileboot_pure < sql/agileboot.sql
|
|
|
+# 使用 -v 参数可以删除数据卷
|
|
|
+docker compose down -v
|
|
|
```
|
|
|
|
|
|
-### Install Frontend Dependencies
|
|
|
-
|
|
|
-```bash
|
|
|
-cd frontend
|
|
|
-pnpm install
|
|
|
-```
|
|
|
+Docker Compose 配置会将 `backend/sql/agileboot.sql` 挂载到 MySQL 容器内的 `/docker-entrypoint-initdb.d/01-agileboot.sql`,MySQL 服务启动后会自动创建数据库和执行 `agileboot.sql` 文件。
|
|
|
|
|
|
-### Start Backend and Web Frontend
|
|
|
+## 启动项目
|
|
|
|
|
|
-Start the backend:
|
|
|
+启动后端:
|
|
|
|
|
|
```bash
|
|
|
cd backend
|
|
|
./mvnw -pl agileboot-admin spring-boot:run
|
|
|
```
|
|
|
|
|
|
-Start the web frontend:
|
|
|
+启动 Web 前端:
|
|
|
|
|
|
```bash
|
|
|
cd frontend
|
|
|
pnpm dev:web
|
|
|
```
|
|
|
|
|
|
-- Backend: `http://localhost:8080`
|
|
|
-- Frontend: Vite output, usually `http://localhost:80/`
|
|
|
-
|
|
|
-The frontend development proxy maps `/dev-api` to `http://localhost:8080`.
|
|
|
-
|
|
|
-Optional app commands:
|
|
|
+启动小程序端:
|
|
|
|
|
|
```bash
|
|
|
cd frontend
|
|
|
-pnpm dev:app:weapp
|
|
|
-pnpm dev:app:h5
|
|
|
-```
|
|
|
-
|
|
|
-## Git Hooks
|
|
|
-
|
|
|
-This repository uses `.githooks` as the single Git hooks entrypoint.
|
|
|
-
|
|
|
-```bash
|
|
|
-git config core.hooksPath .githooks
|
|
|
-```
|
|
|
|
|
|
-The frontend workspace uses pnpm:
|
|
|
-
|
|
|
-```bash
|
|
|
-cd frontend
|
|
|
-pnpm install
|
|
|
-pnpm dev:web
|
|
|
-pnpm build:web
|
|
|
+# 启动微信小程序
|
|
|
pnpm dev:app:weapp
|
|
|
-pnpm build:app:weapp
|
|
|
-pnpm lint
|
|
|
-pnpm typecheck
|
|
|
-```
|
|
|
|
|
|
-## Frontend
|
|
|
-
|
|
|
-`frontend` is a pnpm workspace:
|
|
|
-
|
|
|
-- `web`: Vite + Vue 3 admin frontend.
|
|
|
-- `app`: Taro + Vue 3 app frontend.
|
|
|
+# 启动 h5
|
|
|
+pnpm dev:app:h5
|
|
|
+```
|
|
|
|
|
|
-Shared engineering configuration lives in `frontend` root. Subprojects should extend the shared TypeScript, ESLint, Stylelint, Prettier, commitlint, and lint-staged configuration instead of duplicating it.
|
|
|
+- 后端:`http://localhost:8080`
|
|
|
+- 前端:`http://localhost:80`,用户(admin),密码(admin123)
|
|
|
+- 使用对应的小程序开发者工具打开 `frontend/app` 目录
|