Backend: - Add dashboard API (today stats, inbox count, law alerts, pipeline status) - Add /api/documents/tree endpoint for sidebar domain/sub_group tree - Migrate auth to HttpOnly cookie for refresh token (XSS defense) - Add /api/auth/logout endpoint (cookie cleanup) - Register dashboard router in main.py Frontend (SvelteKit + Tailwind CSS v4): - api.ts: fetch wrapper with refresh queue pattern, 401 single retry, forced logout on refresh failure - Auth store: login/logout/refresh with memory-based access token - UI store: toast system, sidebar state - Login page with TOTP support - Dashboard with 4 stat widgets + recent documents - Document list with hybrid search (debounce, URL query state, mode select) - Document detail with format-aware viewer (markdown/PDF/HWP/Synology/fallback) - Metadata panel (AI summary, tags, processing history) - Inbox triage UI (batch select, confirm dialog, domain override) - Settings page (password change, TOTP status) Infrastructure: - Enable frontend service in docker-compose - Caddy path routing (/api/* → fastapi, / → frontend) + gzip Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
78 lines
1.8 KiB
YAML
78 lines
1.8 KiB
YAML
services:
|
|
postgres:
|
|
image: pgvector/pgvector:pg16
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
- ./migrations:/docker-entrypoint-initdb.d
|
|
environment:
|
|
POSTGRES_DB: pkm
|
|
POSTGRES_USER: pkm
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
ports:
|
|
- "15432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U pkm"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
kordoc-service:
|
|
build: ./services/kordoc
|
|
ports:
|
|
- "3100:3100"
|
|
volumes:
|
|
- ${NAS_SMB_PATH:-/Volumes/Document_Server}:/documents:ro
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "fetch('http://localhost:3100/health').then(r=>{process.exit(r.ok?0:1)}).catch(()=>process.exit(1))"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
restart: unless-stopped
|
|
|
|
fastapi:
|
|
build: ./app
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- ${NAS_SMB_PATH:-/Volumes/Document_Server}:/documents
|
|
- ./config.yaml:/app/config.yaml:ro
|
|
- ./scripts:/app/scripts:ro
|
|
- ./logs:/app/logs
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
kordoc-service:
|
|
condition: service_healthy
|
|
env_file:
|
|
- credentials.env
|
|
environment:
|
|
- DATABASE_URL=postgresql+asyncpg://pkm:${POSTGRES_PASSWORD}@postgres:5432/pkm
|
|
- KORDOC_ENDPOINT=http://kordoc-service:3100
|
|
restart: unless-stopped
|
|
|
|
frontend:
|
|
build: ./frontend
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
- fastapi
|
|
restart: unless-stopped
|
|
|
|
caddy:
|
|
image: caddy:2
|
|
ports:
|
|
- "8080:80"
|
|
- "9443:443"
|
|
volumes:
|
|
- ./Caddyfile:/etc/caddy/Caddyfile
|
|
- caddy_data:/data
|
|
depends_on:
|
|
- fastapi
|
|
- frontend
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
pgdata:
|
|
caddy_data:
|