Downforcedemon / MinimalHome

Apache License 2.0
0 stars 0 forks source link

Settings Service #4

Open Downforcedemon opened 2 days ago

Downforcedemon commented 2 days ago

`classDiagram class AppSettings { +id: BIGSERIAL +user_id: BIGINT +setting_key: VARCHAR +setting_value: TEXT +created_at: TIMESTAMP +updated_at: TIMESTAMP }

class SettingsService {
    +getUserSettings(userId)
    +createSetting(userId, setting)
    +updateSetting(userId, key, value)
    +deleteSetting(userId, key)
    +getSetting(userId, key)
}

class User {
    +id: BIGSERIAL
    +username: VARCHAR
    +email: VARCHAR
    +password_hash: VARCHAR
}

%% Future Features/Services that will interact with Settings
class ScreenTimeService {
    +trackAppUsage()
    +getUsageStats()
    +getSettings()
}

class NotificationService {
    +manageNotifications()
    +filterNotifications()
    +getSettings()
}

class FocusModeService {
    +enableFocusMode()
    +scheduleFocusTime()
    +getSettings()
}

%% Relationships
User "1" -- "*" AppSettings : has
SettingsService -- AppSettings : manages
ScreenTimeService ..> SettingsService : uses
NotificationService ..> SettingsService : uses
FocusModeService ..> SettingsService : uses

%% Settings Categories
note for AppSettings "Key Settings Categories:
    1. screen_time.*
    2. notifications.*
    3. focus_mode.*
    4. ui_preferences.*
    5. app_behavior.*"`
Downforcedemon commented 1 day ago

Core features

`a. Basic Operations:

b. Settings Categories:

Downforcedemon commented 1 day ago

`Layer-by-Layer Approach: a. Data Layer (Bottom)

b. Service Layer (Middle)

c. API Layer (Top)