Steadii Docs

Data Model

Cấu trúc dữ liệu trong Steadii

Habit (Thói quen)

interface Habit {
  id: string;        // "read", "create", "custom_xyz"
  name: string;      // Tên hiển thị
  icon: string;      // Material Symbol icon
  target: number;    // Mục tiêu (GIÂY, 1800 = 30 phút)
  color: string;     // Hex color ("#E8A838")
  enabled: boolean;  // Đang bật hay tắt
}

DayRecord (Dữ liệu ngày)

// Key = YYYY-MM-DD, Value = { habitId → giây đã tập }
Record<string, { [habitId: string]: number }>

// Ví dụ:
{ "2026-03-29": { "read": 1845, "create": 3600, "move": 0 } }

JournalEntry (Nhật ký phiên)

interface JournalEntry {
  date: string;       // "2026-03-29"
  habitName: string;  // "Đọc / Học"
  mood: string;       // "great" | "good" | "okay"
  note: string;       // Max 280 ký tự
  seconds: number;    // Thời gian phiên (giây)
  timestamp: number;  // Unix timestamp (ms)
}

AppState (Zustand Store)

FieldTypePersist?Sync?
onboardingCompletedboolean
habitsHabit[]
daysRecord
remindersReminders
customQuotesstring[]
themestring
localestring
focusSettingsFocusSettings
journalsJournalEntry[]
subscriptionSubscription❌ (API fetch)
jwtstring❌ (memory)
syncStatusstring❌ (memory)

Persisted to localStorage key: du-deu-storage-v4

On this page