Date: March 19, 2026 Progress: Phase 4 (Detailed Design) Complete · Phase 5 (Dev Environment Setup) Complete Previous log: Day 2 (Phase 1~3 complete)


✅ Today's Summary

Item Status
Phase 4 — Full API endpoint spec ✅ Done
Phase 4 — DB table DDL + index strategy ✅ Done
Phase 4 — QStash scheduler detailed design ✅ Done
Phase 4 — FastAPI service layer core logic ✅ Done
Phase 5 — Local dev environment setup ✅ Done
Phase 5 — Security file classification + .gitignore ✅ Done
Phase 5 — Full environment variable definition ✅ Done
Phase 5 — Dockerfile + docker-compose ✅ Done
Phase 5 — GitHub Actions CI/CD pipeline ✅ Done
Phase 5 — First GitHub push ✅ Done
Phase 5 — CI/CD test passed ✅ Done

1. Phase 4 — Detailed Design

Full API Endpoint Spec

Endpoints by domain

Domain Count Key features
Auth 5 Register, login, social login, token refresh, logout
Medications 5 List, create, update, delete, toggle active
Schedules 1 Today's medication schedule (home screen)
Dose Logs 4 Confirm, skip, history, stats
Notifications 3 Device token register, QStash webhook, notification log

Common error codes

Code HTTP Meaning
AUTH_REQUIRED 401 Missing or expired token
FORBIDDEN 403 No permission
NOT_FOUND 404 Resource not found
VALIDATION_ERROR 422 Invalid input
SERVER_ERROR 500 Internal server error

Key API spec example — Today's schedule

// GET /v1/schedules/today
// Response 200
{
  "date": "2026-03-19",
  "total": 3,
  "done": 1,
  "rate": 33,
  "items": [
    {
      "schedule_id": "uuid",
      "medication_name": "Metformin 500mg",
      "scheduled_time": "08:00",
      "color_tag": "#1D9E75",
      "status": "done",
      "taken_at": "2026-03-19T08:12:00Z"
    }
  ]
}

DB Table Definition + Index Strategy

6 tables DDL finalized

Table Key constraints Index
users email UNIQUE, soft delete
medications user_id FK, soft delete (user_id) WHERE deleted_at IS NULL
schedules medication_id FK (medication_id)
dose_logs UNIQUE(schedule_id, log_date) (user_id, log_date DESC)
notification_logs schedule_id + user_id FK (user_id, sent_at DESC)
device_tokens token UNIQUE (user_id)