3.5 KiB
3.5 KiB
Product UI And Deploy Hygiene Plan
For agent: Execute directly against the existing implementation. Do not rebuild the stack from scratch.
Goal: Lift the current document cleaning system from an internal-tool baseline to a more professional product interface, tighten the local-to-server deployment workflow, and make Dify dataset model selection automatic instead of relying on manual console completion.
Architecture: Keep the current FastAPI + worker + Vue SPA + Docker Compose structure. Improve only the frontend experience, Dify integration defaults, and deployment packaging boundaries.
Current Findings
- The core business flow is already usable end to end on the server.
- The frontend still reads as an engineering utility rather than a finished product surface.
- Server deployments were previously syncing non-runtime content such as
project-governanceand test artifacts. - Dify dataset creation succeeded, but embedding and rerank model assignment was not being written by the API layer.
Execution Tracks
Track 1: Productize the frontend
Files:
- Modify:
frontend/src/style.css - Modify:
frontend/src/App.vue - Modify:
frontend/src/views/LoginView.vue - Modify:
frontend/src/views/WorkspaceView.vue - Modify:
frontend/src/views/AdminView.vue - Modify as needed:
frontend/src/components/* - Modify as needed:
frontend/src/lib/i18n.ts
Steps:
- Introduce a clearer visual direction with stronger surfaces, hierarchy, spacing, and global polish.
- Keep the existing route structure and API contract intact.
- Add bilingual UI support and a global language switch without introducing new dependencies.
- Improve the admin configuration experience so Dify defaults feel like product settings, not raw system fields.
Track 2: Automate Dify model selection
Files:
- Modify:
backend/app/services/dify_service.py - Modify:
backend/app/tasks.py - Modify:
backend/app/models.py - Modify:
backend/app/schemas.py - Modify:
backend/app/serializers.py - Modify:
backend/app/api/admin.py - Modify:
backend/app/services/bootstrap_service.py - Modify:
backend/app/config.py - Create:
backend/migrations/versions/20260328_0002_dify_model_defaults.py - Modify tests under
backend/tests/
Steps:
- Query the live Dify model catalog for embedding and rerank providers/models.
- Apply a deterministic automatic choice when admin settings leave model fields empty.
- Expose available models and automatic defaults in the admin API.
- Allow explicit override from the admin UI while keeping automatic selection as the default path.
Track 3: Tighten deployment boundaries
Files:
- Modify as needed: deployment packaging commands/scripts
- Keep on server only runtime files and secrets
Steps:
- Exclude governance docs, tests, caches, local databases, and built artifacts from server syncs.
- Remove already-synced non-runtime directories from the server deployment tree.
- Rebuild only affected services after frontend/backend changes.
Verification
- Run targeted backend tests for admin settings and Dify task flows.
- Run full backend
pytestonce the backend changes settle. - Run frontend
npm run build. - Rebuild the changed Docker services on the server.
- Execute a real server smoke test for login, upload, conversion, markdown download, Dify sync, and delete with
delete_dify=true. - Confirm through the Dify API that new datasets carry embedding/rerank model settings and that remote documents return
404after delete.