Add project workbench MVP design

This commit is contained in:
2026-07-18 15:20:16 +08:00
commit f9135d9b13

View File

@@ -0,0 +1,253 @@
# Project Workbench MVP Design
## Purpose
Build a private-deployment personal and small-team workbench centered on projects. The product reduces scattered work materials by giving each project one place for tasks, notes, files, AI conversations, incoming items, and lightweight task distribution.
The first version is not a full collaboration suite, instant messenger, or enterprise knowledge graph. It is a project-first workspace with reliable capture, organization, search, and AI-assisted triage.
## Target Users
- Individual knowledge workers who manage many topics or projects.
- Team leads who need to organize project material and distribute tasks.
- Internal users in a private deployment who can be trusted through admin-created accounts or invite-based registration.
## Product Scope
### In Scope
- Project-centered workspace.
- Project dashboard as the default project landing page.
- Project inbox for manual capture and system events.
- Task list with status and ordering that can support a future board view.
- Unified Markdown notes/documents.
- File and link sources stored under projects.
- Project-local tags for filtering project objects.
- AI sessions grouped under each project.
- AI sessions can reference project notes and sources.
- AI-assisted inbox analysis that proposes tasks, notes, or sources.
- Global keyword and full-text search across projects.
- Task distribution to system users.
- Explicit sharing of task-related objects.
- Responsive web frontend wrapped by Tauri.
- Tauri desktop features: login persistence, drag-and-drop upload, notifications, global shortcut quick capture.
- Go Gin + Gorm backend with PostgreSQL.
- Server-local file storage.
- System AI key plus optional user-provided AI key.
### Out of Scope For MVP
- Real-time instant messaging.
- Project-level team membership and full role-based collaboration.
- Public anonymous task sharing.
- AI autonomous agent execution.
- Semantic/vector search.
- Mobile native app.
- Browser extension, email, IM, or third-party capture integrations.
- Offline editing or local-first sync.
- Advanced local desktop integrations such as startup launch, background clipboard monitoring, or file-system indexing.
## Core Information Architecture
The app has a global shell and project workspaces.
Global shell:
- Project list.
- Global search.
- Browser-style open tabs.
- User/account settings.
- AI key settings.
Project workspace:
- Dashboard.
- Inbox.
- Tasks.
- Notes and sources.
- AI sessions.
- Project settings.
The project dashboard is the default project view. It shows pending inbox items, current tasks, recent notes/sources, recent AI sessions, and recent project events.
## Primary Objects
### Project
A project is a theme workspace. It owns tasks, inbox items, notes, sources, AI sessions, project-local tags, and events.
### InboxItem
An inbox item is raw incoming material or a system event awaiting review. Sources include:
- Manual text entry.
- Pasted links.
- Uploaded files.
- AI outputs saved into the inbox.
- Internal task events, comments, and status changes.
External channels are represented through a `source_type` field but not implemented in MVP.
Inbox items remain as source records after processing. Processing can mark an item as `processed`, but it does not delete the original.
### Task
A task supports:
- Title.
- Description.
- Status.
- Sort/order field for future board views.
- Due date.
- Assignee.
- Project-local tags.
- Explicitly shared linked objects.
- Comments or activity entries.
The first UI is a list. The model leaves room for Todo/Doing/Done board columns in a future release.
### Note
Notes and documents are one unified Markdown object. Templates, length, tags, and user intent can make a note behave like a meeting note, PRD, research note, or lightweight document.
### Source
A source is original material such as an uploaded file or link. Server-local file storage is used in MVP. File-path logic should be concentrated in one backend service rather than scattered through handlers.
### AISession
An AI session belongs to one project and appears as a card in the project AI session list. Each session has its own conversation context and can reference project notes and sources.
MVP sessions are ordinary project chats, not autonomous agent runs. The model should leave space for future agent-style sessions with goals, status, outputs, and execution logs.
### Tag
Tags are project-local. They can be attached to project-owned objects for filtering within that project. Cross-project lookup uses global search instead of global tags.
### ProjectEvent
A project event records notable activity such as task assignment, comments, status changes, AI output saved to inbox, note updates, and file uploads. Events can appear in project dashboard and inbox-like streams.
### User
Users are managed in a private-deployment model. Registration is admin-created or invite-based. Public self-serve SaaS signup is outside MVP scope.
## Key Flows
### Capture To Project Inbox
The user adds text, a link, or a file to a project inbox. In Tauri, the global shortcut opens a quick capture window. If the main window has an active project, that project is the default destination; otherwise the user chooses a destination project.
The item enters inbox without automatic AI processing. The user can click Analyze/Organize when they want suggestions.
### AI-Assisted Inbox Processing
When the user clicks Analyze/Organize, the backend calls the selected AI provider. The AI returns a structured suggestion list containing candidate tasks, notes, or sources.
The user reviews a suggestion list, edits titles or basic fields, selects the candidates to create, and confirms. AI never creates official objects without confirmation. Created objects keep a reference back to the original inbox item.
### Project AI Conversation
The user opens an AI session card under a project. The session has its own message history. The user can reference project notes or sources with an @-style picker. AI responses can be saved into inbox, converted into notes, or linked to tasks.
### Task Distribution
The user assigns or shares a task with another system user. The recipient can see the task and only the explicitly shared linked objects. They do not automatically gain project-level access.
Public share links are a future capability, not part of MVP behavior.
### Global Search
The user searches across projects. MVP search covers:
- Project names.
- Task titles and descriptions.
- Note titles and Markdown bodies.
- Source titles, filenames, URLs, and extracted text where available.
- AI session titles and message text.
- Inbox text.
Search uses PostgreSQL full-text search with keyword support. Semantic search is deferred.
## AI Key Policy
The system has a configured default AI provider/key. Users may configure their own provider/key. If a user key exists, calls should use it; otherwise calls may fall back to the system key.
Because system key fallback is allowed, MVP must include:
- AI call logging.
- Basic per-user rate limiting.
- Error recording.
- Secure storage for user keys.
- Clear provider selection behavior.
## Backend Design
Backend stack:
- Go.
- Gin HTTP API.
- Gorm ORM.
- PostgreSQL.
- Server-local file storage.
Suggested backend modules:
- Auth and invitations.
- Projects.
- Inbox.
- Tasks.
- Notes and sources.
- AI sessions.
- Search.
- Files.
- Tags.
- Events.
- AI provider gateway.
The file module owns all filesystem paths and metadata rules. Handlers should not directly construct storage paths.
## Frontend And Tauri Design
The frontend is a responsive web app, desktop-first but usable on mobile browsers. Tauri wraps the same frontend for desktop.
Tauri MVP capabilities:
- Persistent login state.
- File drag-and-drop upload.
- System notifications.
- Global shortcut quick capture.
Browser-style tabs store page-level state such as open project, task detail, note, source, or AI session. Rich internal state such as scroll position is not required in MVP. Editor and AI input drafts should be saved separately to avoid data loss.
## Permissions
MVP uses conservative sharing:
- Project content is private to the owner unless explicitly shared through a task.
- Task assignees can see the task.
- Task assignees can see linked notes, sources, or files only when explicitly shared.
- Project-level membership and roles are deferred.
## Testing And Verification
Backend:
- Unit tests for AI key selection, inbox processing, task sharing visibility, tag scoping, and file metadata handling.
- Integration tests for project search, task distribution, and inbox-to-object conversion.
Frontend:
- Component tests for project dashboard, inbox suggestion confirmation, AI session list, task list, and quick capture form.
- End-to-end tests for capture, analyze, confirm, search, and task assignment flows.
Desktop:
- Manual verification for drag-and-drop upload, notification delivery, quick capture shortcut, and login persistence in Tauri.
## Risks
- The system can become too broad if project collaboration, real messaging, and autonomous agents enter MVP.
- System AI key fallback creates cost and abuse risk without logging and rate limits.
- PostgreSQL full-text search may require tuning for Chinese content.
- Server-local files are simple but require careful backup, path handling, and migration planning.
- AI suggestions must remain reviewable and reversible to avoid user distrust.
## Milestones
1. Backend foundation: auth, users, projects, PostgreSQL schema, file metadata, server-local storage.
2. Project workspace shell: project list, project dashboard, tabs, routing.
3. Inbox and capture: manual inbox, upload/link/text capture, Tauri quick capture.
4. Notes, sources, and project-local tags.
5. Task list, assignment, comments/events, explicit linked-object sharing.
6. AI sessions and @ reference picker.
7. AI inbox analysis with suggestion-list confirmation.
8. Global full-text search.
9. Tauri desktop polish: notifications, login persistence, drag-and-drop verification.