56 lines
1002 B
Markdown
56 lines
1002 B
Markdown
# Local Setup
|
||
|
||
## Prerequisites
|
||
|
||
- Python 3.12
|
||
- Node.js 22
|
||
- Docker Desktop
|
||
|
||
## First Run
|
||
|
||
```bash
|
||
copy .env.example .env
|
||
cd infra
|
||
docker compose --env-file ../.env up --build
|
||
```
|
||
|
||
首次启动时,backend 容器会自动等待 PostgreSQL、执行数据库迁移,并初始化企业后台治理数据。
|
||
|
||
Backend:
|
||
|
||
- API: http://localhost:8000/api/docs
|
||
- Health: http://localhost:8000/api/system/health
|
||
|
||
Frontend:
|
||
|
||
- App: http://localhost:5173
|
||
|
||
默认管理员:
|
||
|
||
- 账号: `admin`
|
||
- 密码: `admin12345`
|
||
- 可通过 `.env` 中的 `DJANGO_SUPERUSER_USERNAME`、`DJANGO_SUPERUSER_PASSWORD`、`DJANGO_SUPERUSER_EMAIL` 修改。
|
||
|
||
## Backend Tests
|
||
|
||
```bash
|
||
cd backend
|
||
python -m pip install -e ".[dev]"
|
||
pytest -v
|
||
```
|
||
|
||
## Frontend Checks
|
||
|
||
```bash
|
||
cd frontend
|
||
npm install
|
||
npm run typecheck
|
||
npm run build
|
||
```
|
||
|
||
## Stage 1 API Smoke Tests
|
||
|
||
- Tickets: `GET http://localhost:8000/api/tickets`
|
||
- Ticket export: `GET http://localhost:8000/api/tickets/export`
|
||
- Solutions: `GET http://localhost:8000/api/solutions`
|