feat: bootstrap dodo phase one

This commit is contained in:
2026-09-05 10:47:44 +08:00
commit f182c704a4
48 changed files with 4221 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
# API
Base path: `/api/v1`
## Setup / Auth
- `GET /setup/status`
- `POST /setup/initialize`
- `POST /auth/login`
- `GET /me`
## Folders
- `GET /folders`
- `POST /folders`
## Lists
- `GET /lists`
- `POST /lists`
## Tasks
- `GET /tasks`
- `POST /tasks`
- `PATCH /tasks/{task_id}` — 必须携带当前 `version`,冲突返回 409
- `DELETE /tasks/{task_id}` — 软删除
## Health
- `GET /health/live`
- `GET /health/ready`
+60
View File
@@ -0,0 +1,60 @@
# dodo 数据模型(第一阶段)
## app_state
- key
- created_at
## users
- id UUIDv7
- username
- password_hash
- timezone
- created_at
## sessions
- id UUIDv7
- token_hash
- user_id
- expires_at
- created_at
## folders
- id UUIDv7
- user_id
- name
- position
- created_at
## task_lists
- id UUIDv7
- user_id
- folder_id nullable
- name
- is_inbox
- position
- created_at
## tasks
- id UUIDv7
- user_id
- list_id
- parent_id nullable
- title
- description
- priority (0-3)
- completed
- due_at nullable
- version
- position
- created_at
- updated_at
- deleted_at nullable
## 后续阶段预留
- task_reminders
- task_recurrence_templates
- task_recurrence_exceptions
- tags / task_tags
- habits / habit_logs / habit_reminders
- attachments
- audit_logs
+26
View File
@@ -0,0 +1,26 @@
# 部署
第一阶段交付方式:单镜像 + 外部 PostgreSQL。
> 当前机器未检测到 Docker,因此本阶段先提供 Dockerfile 草案与运行参数,实际镜像构建需在有 Docker 的环境执行。
## 环境变量
```bash
DODO_DATABASE_URL=postgresql+asyncpg://dodo:password@postgres:5432/dodo
DODO_COOKIE_SECURE=true
DODO_SESSION_DAYS=30
```
## 反向代理
- HTTPS 由反向代理终止
- 应用监听 `0.0.0.0:8781`
- 健康检查:`/health/ready`
## 后续补充
- Dockerfile
- docker-compose.yml 示例
- Alembic 正式迁移目录
- Worker 启动命令