AI Usage Dashboard Docs

Architecture

Objective

Ship a desktop AI usage dashboard that reaches Windows without depending on macOS-only internals.

Why Not Build Directly on a Fork

Forking a macOS-first project is useful for reference and fast experiments, but not as the long-term base:

The final product should reuse ideas, not inherit all trust boundaries unchanged.

Target Structure

ai_usage_dashboard/
  README.md
  docs/
    architecture.md
    roadmap.md
  apps/
    desktop/
      src/
      src-tauri/
  packages/
    core/
    providers/
    platform/

Layer Model

1. Core

Responsibilities:

Key rules:

2. Providers

Responsibilities:

Key rules:

3. Platform

Responsibilities:

Platform adapters:

4. Desktop Shell

Responsibilities:

The shell consumes core and providers through typed interfaces only.

Credential Boundary

Credential handling is the main design constraint.

Rules:

Proposed interfaces:

type CredentialHandle =
  | { kind: "oauth"; accessToken: string; refreshToken?: string }
  | { kind: "apiKey"; apiKey: string }

interface CredentialStore {
  load(providerId: string): Promise<CredentialHandle | null>
  save(providerId: string, credential: CredentialHandle): Promise<void>
  clear(providerId: string): Promise<void>
}

OS Strategy

macOS

Use:

Avoid locking app behavior to:

Windows

Use:

Design constraint:

Local API Strategy

Default:

If later enabled:

Telemetry Strategy

Default:

If later enabled:

Updater Strategy

Default for early development:

Release requirement:

Testing Strategy

Core

Providers

Desktop

First Build Decision

Start on the final layered architecture immediately, even if the first runnable app is macOS-only.

That keeps Windows as an additive shell task instead of a rewrite.