English | 简体中文
Internal task workflow system: Go API + React workbench + Mongo persistence.
create → assign → start → submit → approve/reject → close
Intranet MVP / pilot-candidate. Maintenance mode — not enterprise production.
flowchart LR
W[Browser / nginx :8081] --> API[Go API :8080]
API --> S[(Mongo / memory)]
W -.->|JWT| API
K[Agent] -.->|API key| API
- Explicit task state machine with role-constrained actions — not a generic CRUD list
- Dual persistence (Mongo + memory) and a JWT-session vs API-key boundary for humans vs unattended callers
Local compose walkthrough (login → task list → submitted task → audit → approve dialog).
| Login | Task list |
|---|---|
![]() |
![]() |
Login plus the owner workbench: four demo tasks across open / assigned / submitted.
| Task detail | Audit |
|---|---|
![]() |
![]() |
Same submitted task: collaboration records plus an append-only audit trail.
| Approve | Users |
|---|---|
![]() |
![]() |
Approve dialog for a submitted task; users page covers accounts and API keys.
Media notes: docs/demo/README.md. Screenshots are a local stack, not a live intranet deploy.
- Explicit task state machine with role-constrained actions
- Backend returns
available_actions; the UI prefers that and keeps a fallback matrix - JWT login, refresh rotation, password reset, account disable, session revoke
- API keys for unattended / agent callers
- Collaboration records + audit log on each task
- Health / ready / live / metrics, structured logs, optional OTLP
- Mongo + memory dual persistence, migrations, bootstrap, backup scripts
- Same-origin nginx workbench: list, detail, create, users, profile
Needs Go 1.25.12.
go test ./...
DEV_MODE=true \
TASK_REPOSITORY_DRIVER=memory \
JWT_SECRET=change-me-change-me-change-me-123 \
go run ./cmd/serverDev-mode seed users (local only):
u_test_001/creator-pass-123u_test_002/assignee-pass-123u_agent_001/agent-pass-123
Needs Node 22. Start the API first:
cd web
npm ci
VITE_API_PROXY_TARGET=http://localhost:8080 npm run devOpen http://127.0.0.1:5173. The Vite server proxies /api to the backend.
docker compose --profile full up -d --build
bash scripts/compose_smoke.sh
bash scripts/nginx_smoke.sh- API:
http://127.0.0.1:8080 - Web:
http://127.0.0.1:8081 - Mongo on the host:
127.0.0.1:27018
Compose bootstrap users come from the mounted users file (often scripts/users.intranet.json locally, scripts/users.example.json in the repo). Do not commit real passwords.
taskflow/
├── cmd/ # server, migrate, bootstrap
├── internal/ # domain, handlers, services, repos
├── web/ # React + Vite workbench
├── docs/demo/ # README screenshots + walkthrough
├── scripts/ # smoke, rollout, audits
├── deploy/ # local observability config
└── reports/ # release / security notes
Public:
POST /auth/login— body field isid, notusernamePOST /auth/refreshPOST /auth/password-reset/requestPOST /auth/password-reset/confirmPOST /userswhen public registration is enabled
Authenticated:
GET /meGET /usersPOST /users/:id/disablePOST /users/:id/revoke-sessionsPOST /tasksGET /tasksGET /tasks/:idPATCH /tasks/:idDELETE /tasks/:idPOST /tasks/:id/{assign,start,submit,reject,approve,close,cancel,reactivate}GET /tasks/:id/recordsGET /tasks/:id/audit_logs
System: GET /health · GET /livez · GET /readyz · GET /metrics
go test ./...
go vet ./...
cd web
npm ci
npm run lint
npm run test
npm run buildHelpers: scripts/compose_smoke.sh, scripts/web_build_smoke.sh, scripts/web_acceptance_smoke.sh, scripts/nginx_smoke.sh, scripts/intranet_acceptance.sh, scripts/security_audit.sh.
DEPLOYMENT.mdMIGRATIONS.mdINTRANET_RELEASE_CHECKLIST.mdINTRANET_RUNBOOK.mdINTRANET_OPS.mdACCEPTANCE_TESTING.mddocs/团队收尾.md
Production should use DEV_MODE=false, STRICT_PRODUCTION_CONFIG=true, TASK_REPOSITORY_DRIVER=mongo, and a real PASSWORD_RESET_WEBHOOK_URL. Mongo write paths that use transactions need a replica set member or mongos.






