# zefeng1236/ms-rewards-auto architecture

> Architecture diagram of the GitHub repository zefeng1236/ms-rewards-auto, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zefeng1236/ms-rewards-auto
- Repository: https://github.com/zefeng1236/ms-rewards-auto

## Overview

MS Rewards Auto is a multi-account Microsoft Rewards task runner with Electron desktop and Docker/Web interfaces. Users create an isolated account, log in through a browser, configure tasks and scheduling, then run them immediately or automatically; task progress and results appear in the GUI, with optional notifications. The graph also preserves the documented vault, fingerprint-browser, achievements, goals, and cluster capabilities. Several backend modules are indexed but unsampled, so their documented subsystems are included while uncertain internal links are omitted.

Main entry points: [`src/runner.js`](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/runner.js) (Task runner), [`src/tasks.js`](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/tasks.js) (Rewards tasks), [`src-renderer/src/api/ipc.ts`](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src-renderer/src/api/ipc.ts) (Client API), [`src/account.js`](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/account.js) (Account manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interfaces"]
  node_app["App shell<br/>[App.tsx]"]
  node_appstate["UI state<br/>[useAppState.tsx]"]
  node_api["Client API<br/>[ipc.ts]"]
  node_dashboard["Dashboard and views"]
end

subgraph group_accounts["Accounts and security"]
  node_account["Account manager<br/>[account.js]"]
  node_browser["Browser and login<br/>[browser.js]"]
  node_fingerprint["Fingerprint browser"]
  node_vault["Encrypted vault<br/>[index.js]"]
  node_storage[("Account storage<br/>[storage-path.js]")]
end

subgraph group_automation["Task automation"]
  node_runner["Task runner<br/>[runner.js]"]
  node_tasks["Rewards tasks<br/>[tasks.js]"]
  node_rewards["Rewards API<br/>[rewards.js]"]
  node_scheduler["Scheduling<br/>[cron.js]"]
  node_goals["Points goals<br/>[goals.js]"]
  node_history[("Progress history<br/>[history.js]")]
end

subgraph group_runtime["Runtime services"]
  node_notify["Notifications<br/>[notify.js]"]
  node_logs[("Logs<br/>[logger.js]")]
end

subgraph group_web["Web and cluster"]
  node_server["Web server<br/>[server.js]"]
  node_webapi["Web API<br/>[web-api.js]"]
  node_cluster["Cluster service<br/>[cluster-service.js]"]
end

node_user(("User"))
node_microsoft{{"Microsoft Rewards"}}
node_notification_services{{"Notification providers"}}

node_user -->|"uses"| node_app
node_app -->|"provides state"| node_appstate
node_app -->|"renders views"| node_dashboard
node_appstate -->|"requests data"| node_api
node_dashboard -->|"initiates actions"| node_api
node_api -->|"HTTP and SSE"| node_server
node_api -.->|"IPC operations"| node_account
node_account -->|"uses login"| node_browser
node_browser -->|"selects engine"| node_fingerprint
node_account -->|"stores account data"| node_storage
node_vault -->|"stores encrypted data"| node_storage
node_runner -->|"loads accounts"| node_account
node_runner -->|"uses browser"| node_browser
node_runner -->|"dispatches tasks"| node_tasks
node_tasks -->|"calls rewards API"| node_rewards
node_runner -->|"checks goals"| node_goals
node_runner -->|"records progress"| node_history
node_runner -->|"sends outcomes"| node_notify
node_tasks -->|"sends task notices"| node_notify
node_runner -->|"writes logs"| node_logs
node_scheduler -.->|"starts scheduled runs"| node_runner
node_tasks -->|"reports activity"| node_microsoft
node_notify -->|"delivers messages"| node_notification_services
node_server -->|"creates API"| node_webapi
node_server -->|"starts service"| node_cluster

click node_app "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src-renderer/src/App.tsx"
click node_appstate "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src-renderer/src/hooks/useAppState.tsx"
click node_api "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src-renderer/src/api/ipc.ts"
click node_dashboard "https://github.com/zefeng1236/ms-rewards-auto/tree/main/src-renderer/src/views"
click node_account "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/account.js"
click node_browser "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/browser.js"
click node_fingerprint "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/fingerprint-browser.js"
click node_vault "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/vault/index.js"
click node_storage "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/storage-path.js"
click node_runner "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/runner.js"
click node_tasks "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/tasks.js"
click node_rewards "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/rewards.js"
click node_scheduler "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/cron.js"
click node_goals "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/goals.js"
click node_history "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/history.js"
click node_notify "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/notify.js"
click node_logs "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/logger.js"
click node_server "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/server.js"
click node_webapi "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/web-api.js"
click node_cluster "https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/cluster-service.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_appstate,node_api,node_dashboard,node_user toneBlue
class node_account,node_browser,node_fingerprint,node_vault,node_storage toneAmber
class node_runner,node_tasks,node_rewards,node_scheduler,node_goals,node_history toneMint
class node_notify,node_logs toneRose
class node_server,node_webapi,node_cluster,node_microsoft,node_notification_services toneIndigo
```

## Components

### User interfaces

- [App shell](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src-renderer/src/App.tsx): `src-renderer/src/App.tsx`
- [UI state](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src-renderer/src/hooks/useAppState.tsx): `src-renderer/src/hooks/useAppState.tsx`
- [Client API](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src-renderer/src/api/ipc.ts): `src-renderer/src/api/ipc.ts`
- [Dashboard and views](https://github.com/zefeng1236/ms-rewards-auto/tree/main/src-renderer/src/views): `src-renderer/src/views`

### Accounts and security

- [Account manager](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/account.js): `src/account.js`
- [Browser and login](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/browser.js): `src/browser.js`
- [Fingerprint browser](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/fingerprint-browser.js): `src/fingerprint-browser.js`
- [Encrypted vault](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/vault/index.js): `src/vault/index.js`
- [Account storage](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/storage-path.js): `src/storage-path.js`

### Task automation

- [Task runner](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/runner.js): `src/runner.js`
- [Rewards tasks](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/tasks.js): `src/tasks.js`
- [Rewards API](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/rewards.js): `src/rewards.js`
- [Scheduling](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/cron.js): `src/cron.js`
- [Points goals](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/goals.js): `src/goals.js`
- [Progress history](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/history.js): `src/history.js`

### Runtime services

- [Notifications](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/notify.js): `src/notify.js`
- [Logs](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/logger.js): `src/logger.js`

### Web and cluster

- [Web server](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/server.js): `src/server.js`
- [Web API](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/web-api.js): `src/web-api.js`
- [Cluster service](https://github.com/zefeng1236/ms-rewards-auto/blob/main/src/cluster-service.js): `src/cluster-service.js`

### Other components

- **User**
- **Microsoft Rewards**
- **Notification providers**

## Connections

- User → App shell: uses
- App shell → UI state: provides state (evidence: `src-renderer/src/App.tsx`)
- App shell → Dashboard and views: renders views (evidence: `src-renderer/src/App.tsx`)
- UI state → Client API: requests data (evidence: `src-renderer/src/hooks/useAppState.tsx`)
- Dashboard and views → Client API: initiates actions (evidence: `src-renderer/src/views/AccountDetail.tsx`)
- Client API → Web server: HTTP and SSE
- Client API → Account manager: IPC operations
- Account manager → Browser and login: uses login (evidence: `src/account.js`)
- Browser and login → Fingerprint browser: selects engine (evidence: `src/browser.js`)
- Account manager → Account storage: stores account data (evidence: `src/account.js`)
- Encrypted vault → Account storage: stores encrypted data (evidence: `src/vault/index.js`)
- Task runner → Account manager: loads accounts (evidence: `src/runner.js`)
- Task runner → Browser and login: uses browser (evidence: `src/runner.js`)
- Task runner → Rewards tasks: dispatches tasks (evidence: `src/runner.js`)
- Rewards tasks → Rewards API: calls rewards API (evidence: `src/tasks.js`)
- Task runner → Points goals: checks goals (evidence: `src/runner.js`)
- Task runner → Progress history: records progress (evidence: `src/runner.js`)
- Task runner → Notifications: sends outcomes (evidence: `src/runner.js`)
- Rewards tasks → Notifications: sends task notices (evidence: `src/tasks.js`)
- Task runner → Logs: writes logs (evidence: `src/runner.js`)
- Scheduling → Task runner: starts scheduled runs
- Rewards tasks → Microsoft Rewards: reports activity
- Notifications → Notification providers: delivers messages
- Web server → Web API: creates API (evidence: `src/server.js`)
- Web server → Cluster service: starts service (evidence: `src/server.js`)
