Commit Graph

16 Commits

Author SHA1 Message Date
3313811d2f Document public reverse proxy deployment
- Add README instructions for deploying the full report system through local Docker port 4002, frpc, Nginx Proxy Manager, and sstwbg.example.com.

- Document required HTTPS, WebSocket, request-size, timeout, health-check, login, AI, video-frame, and speech verification steps.

- Add TRUST_PROXY support so secure session cookies work behind public HTTPS reverse proxies.

- Preserve upstream X-Forwarded-Proto through the container Nginx API proxy.

- Allow Docker Compose session and trust-proxy variables to be overridden for public deployments.

- Update deployment and Docker docs with the same public reverse-proxy guidance.
2026-05-08 16:27:12 +08:00
5d936832da Complete Docker compose deployment setup
- Add an API container entrypoint that waits for PostgreSQL, runs Prisma migrations, seeds demo data, and then starts NestJS.

- Keep Prisma CLI and seed dependencies available in the API runtime image and copy seed source dependencies into the container.

- Add Docker Compose healthchecks and health-based startup ordering for PostgreSQL, API, and Nginx web services.

- Add Docker initialization environment switches for migrations, seed, and startup retries.

- Add a dedicated Docker deployment guide covering services, ports, initialization, HTTPS, production variables, backup, restore, and troubleshooting.

- Update README, AGENTS, installation, deployment, progress, and environment example docs for the Dockerized workflow.
2026-05-02 05:38:03 +08:00
2cabe7e4fd Preserve frame position order for auto insertion
- Allow system frame position percentages to keep two decimal places without reordering saved values.

- Stop frontend and backend settings normalization from sorting framePositions on load or save.

- Capture automatic video frames in timeline order while retaining each configured position index.

- Insert automatically selected frames into report placeholders according to the configured percentage order.

- Add frame position utilities and unit coverage for two-decimal rounding, clamping, order preservation, and timeline capture planning.

- Update README, AGENTS, feature, requirement, report editor, system settings, progress, and testing docs for the new frame ordering behavior.
2026-05-02 05:10:39 +08:00
3774657ef5 Refresh AI region list after editor content loads
- Extract AI region scanning into a reusable utility with unit coverage.

- Refresh AI region dropdown state after drafts, reports, default templates, and selected templates write HTML into the editor.

- Keep the existing MutationObserver path for later DOM edits and inserted AI regions.

- Add E2E coverage for existing template AI regions appearing on initial report editor load.

- Update README, AGENTS, report editor, progress, and testing docs for AI region synchronization behavior.
2026-05-02 04:57:00 +08:00
558498a4bb Revert "Prioritize doctor instructions in AI report prompts"
This reverts commit 55622368e3.
2026-05-02 04:44:17 +08:00
55622368e3 Prioritize doctor instructions in AI report prompts
- Extract AI prompt construction into a tested utility for report editor generation.

- Make doctor instructions and structured report fields higher priority than old template body and target-region HTML.

- Tell the AI not to carry over default gallbladder or liver descriptions when the doctor asks for another procedure or body part.

- Limit old full-report context length to reduce anchoring on default template content.

- Update README, AGENTS, report editor, design, progress, and testing docs for the AI prompt priority model.

- Add unit tests covering AI prompt priority and old-content truncation.
2026-05-02 04:39:18 +08:00
44decaa396 Include field library metadata in template exports
- Add fieldLibrary metadata to HTML template packages, including form fields, custom time formats, multi-select options, and anesthesia options.

- Restore imported template field metadata into local compatibility caches and the backend field library API when available.

- Preserve legacy JSON template import compatibility while keeping user-facing exports on HTML packages.

- Prevent template field saves from overwriting stored multi-select and anesthesia options with empty values.

- Update README, AGENTS, feature, requirement, design, module, progress, component, and testing docs for complete template export behavior.

- Extend template export tests to cover field library metadata round-tripping.
2026-05-02 04:27:08 +08:00
03b54fe18b Remove frontend JSON export actions
- Remove user-visible JSON export options from report editor, report management, template management, bulk template export, and AI debug logs.

- Keep HTML template package and PDF/browser print exports as the supported frontend export formats.

- Change per-template export to generate reusable HTML template packages.

- Preserve legacy JSON template import compatibility without exposing new JSON export buttons.

- Update README, AGENTS, feature, requirement, design, module, API contract, progress, and testing docs for the export policy change.
2026-05-02 04:21:08 +08:00
b346b7e194 Add HTTPS demo entry for microphone access
- Add a self-signed HTTPS Nginx entrypoint on Docker port 4443 so browser microphone APIs can run in demo mode.

- Keep the existing HTTP port 4002 unchanged while exposing container port 443 and generating the demo certificate during image build.

- Update CORS defaults and Compose environment for the HTTPS frontend origin.

- Clarify the report editor microphone message with localhost, HTTPS, and browser trusted-origin demo options.

- Document the browser HTTP microphone limitation, HTTPS demo URL, and Chrome/Edge insecure-origin workaround in README and docs.
2026-05-02 03:34:31 +08:00
2a86d9f5e4 Raise report upload request size limits
- Configure NestJS with an explicit JSON and urlencoded body parser limit controlled by API_BODY_LIMIT.

- Set the default API body limit to 100mb for report HTML, key frames, template images, and Data URL file uploads.

- Add a matching Nginx client_max_body_size 100m limit so Docker web proxy no longer rejects large report saves first.

- Document the new request body limit in README, deployment docs, progress notes, environment example, and AGENTS context.

- Rebuild and verify Docker web/api with a large report save through the Nginx /api proxy.
2026-05-02 03:29:46 +08:00
911b96b883 Add demo mode factory reset
- Align the backend seeded default surgery template with the report editor's default report content.

- Add backend demo defaults for the default template, Kimi provider, and Xunfei speech proxy configuration.

- Change system reset into a super-admin demo mode factory reset that clears reports, audit logs, files, custom templates, and non-default users.

- Keep only the default admin, manager, doctor, and default surgery template after demo reset.

- Replace the old local-only reset all data button with a two-confirmation backend reset flow.

- Add tests covering demo default alignment and database-backed demo reset behavior.

- Update docs to describe demo mode reset semantics and production credential cautions.
2026-05-02 02:52:30 +08:00
bc235b2358 Document frontend component structure
- Add docs/component-structure.md covering the current React component hierarchy, page routes, public components, API/Auth/Utils boundaries, and data flow.

- Document the internal responsibilities and split risks for large pages including ReportEditor and TemplateManage.

- Link the new component structure guide from README, docs index, AGENTS file tree, and progress notes.
2026-05-02 02:36:55 +08:00
e67763fa82 Add installation and initial setup documentation
- Add docs/installation.md covering prerequisites, port usage, Docker startup, local development setup, default accounts, first-run validation, and common setup issues.

- Link the installation guide from the project README and docs index.

- Point deployment documentation to the installation guide for first-time setup.

- Update AGENTS.md and progress documentation to include the new installation guide.
2026-05-02 02:30:08 +08:00
7c6449b7bd Standardize SurClaw ports away from defaults
- Change the API default listen port from 3000 to 3100 and include the Docker frontend origin in default CORS.

- Point Vite's default API proxy, Docker API container port, and Nginx upstream to 3100.

- Keep Docker host ports on 4002 for web, 3002 for API, and 5433 for PostgreSQL.

- Update environment examples and documentation to remove stale localhost:3000 guidance.
2026-05-02 02:17:07 +08:00
750cf4129d Add audit log UI and backend API seeded E2E
- Add Auth Context route role guards so doctors cannot directly enter template management, user management, or audit logs.

- Add Audit Logs page, sidebar entry, frontend audit API client, and API client test.

- Add backend audit log query endpoint with super/admin visibility rules and query filtering.

- Extend PostgreSQL integration tests to cover audit log query permissions.

- Move Playwright E2E away from localStorage seed data to real backend API login and seed helpers.

- Add E2E coverage for route guards and audit log visibility.

- Run Playwright backend on port 3100 and proxy Vite API requests there to avoid local port conflicts.

- Make server:dev use the compiled NestJS server path, avoiding tsx parameter-property injection issues.

- Update README, AGENTS, feature, testing, security, deployment, progress, API, backendization, and auth/user module docs.
2026-05-02 02:04:56 +08:00
014aca8619 Initialize backendized SurClaw report system
- Add React/Vite frontend for login, dashboard, reports, templates, users, settings, AI, speech, and media workflows.

- Add NestJS/Prisma/PostgreSQL backend with auth, dashboard stats, reports, templates, users, departments, settings, files, AI, speech, audit logs, and HTML sanitization.

- Add Prisma schema, migrations, seed data, persistent app sessions, Docker/Nginx deployment files, and upload volume configuration.

- Add Vitest, Playwright, backend integration tests, and project documentation for requirements, design, permissions, API contracts, testing, deployment, security, and progress.

- Configure production local fallback switch and remove unused Gemini direct dependency/env wiring.
2026-05-02 01:41:57 +08:00