forked from gin/simple-template
feat: initial commit
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
# Simple Template
|
||||
|
||||
## Quick Start
|
||||
|
||||
This project contains:
|
||||
|
||||
- `backend`: Spring Boot admin API.
|
||||
- `frontend/web`: Vite + Vue 3 admin frontend.
|
||||
- `frontend/app`: Taro + Vue 3 app frontend.
|
||||
|
||||
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
|
||||
- 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`
|
||||
|
||||
You can start MySQL and Redis manually:
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
On a fresh Docker volume, Compose creates the MySQL database `agileboot_pure`.
|
||||
Import the SQL files under `backend/sql/` before starting the backend.
|
||||
|
||||
### Install Frontend Dependencies
|
||||
|
||||
```bash
|
||||
cd frontend
|
||||
pnpm install
|
||||
```
|
||||
|
||||
### Start Backend and Web Frontend
|
||||
|
||||
Start the backend:
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
./mvnw -pl agileboot-admin -am spring-boot:run
|
||||
```
|
||||
|
||||
Start the web frontend:
|
||||
|
||||
```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.
|
||||
|
||||
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.
|
||||
Reference in New Issue
Block a user