Development and Build Scripts
The generated project root contains two scripts: dev.sh for development and build.sh for building and checks.
dev.sh
Section titled “dev.sh”./dev.sh start # Default; install dependencies and start frontend and backend./dev.sh stop # Stop services./dev.sh restart # Restart./dev.sh install # Install dependencies onlystart will:
- Run
install: frontendnpm install; Python backenduv sync; Java backend dependencies managed automatically by Maven. - Start the backend:
- Python:
uv run uvicorn app.main:app --reload --host 0.0.0.0 --port 8088 - Java:
mvn spring-boot:run
- Python:
- Start the frontend:
npm run dev(port 5173). - Print the access addresses and wait (
wait).
The script uses trap cleanup EXIT INT TERM to terminate both the backend and frontend processes on exit.
Automatically Generating the JWT Key
Section titled “Automatically Generating the JWT Key”When you choose the Python backend and neither the JWT_SECRET_KEY environment variable nor backend/.env is set, dev.sh will:
export JWT_SECRET_KEY="$(openssl rand -base64 48)"and warn that “JWT_SECRET_KEY is not set; a random key was generated automatically for local development (logins will be invalid after a restart)” (未设置 JWT_SECRET_KEY,已为本地开发自动生成随机密钥(重启后登录会失效)).
build.sh
Section titled “build.sh”./build.shRuns in order:
- Frontend build:
cd frontend && npm run build - Backend check:
- Python:
uv run ruff check . - Java:
mvn spotless:check
- Python:
If any step fails, the script exits immediately due to set -e.