# DEPLOYMENT (Windows Intranet)

## 1) Machine Requirements
- Windows Server / Windows 10+
- Node.js 20+
- LAN access to the selected model endpoints (official or relay)

## 2) Install
```powershell
cd <project-root>
copy .env.example .env
npm install
```

Edit `.env`:
- `SESSION_SECRET`
- `ADMIN_USERNAME`
- `ADMIN_PASSWORD`
- 技能资源会随交付包自动加载，无需手动配置明文技能目录
- provider defaults (OpenAI/Gemini models and base URL)

## 3) Build & Run
```powershell
npm run build
npm run start
```
Default port: `3010`

## 4) Keep Process Running (Recommended)
Use `pm2` or NSSM service wrapper in production.

## 5) Firewall
Allow LAN inbound TCP to app port (e.g., `3010`).

## 6) Data & TTL
- Runtime data folder defaults to `.\data`
- Generated text/image records are temporary and auto-cleaned on a rolling 90-day retention window.
- Commercial license state is also stored on the deployment machine under the local data directory / app data fallback path, not inside the release zip.
- When updating, keep the local data directory intact so activation survives version upgrades.

## 7) Verify Checklist
- Login works (admin).
- Upload image works.
- 5 output modes can be generated.
- OpenAI and Gemini can both run using UI-specified API key/base URL.
- Detail images return exactly 6 files.


