# igorberezkin/nextday architecture

> Architecture diagram of the GitHub repository igorberezkin/nextday, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/igorberezkin/nextday
- Repository: https://github.com/igorberezkin/nextday

## Overview

Next Day is a local Windows day planner. The main workflow is to plan tomorrow, track tasks during the day, then assemble and seal a board of results for history. Goals add a topic-map stage whose tasks can be scheduled into plans; an optional local MCP server lets AI clients read history and work with goals. The graph combines documented capabilities with sampled imports and calls; several backend and UI connections are omitted or shown as unverified where source excerpts do not establish their wiring.

Main entry points: [`src-tauri/src/logic.rs`](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/logic.rs) (Day logic), [`src/App.tsx`](https://github.com/igorberezkin/nextday/blob/main/src/App.tsx) (App navigation), [`src-tauri/src/goals.rs`](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/goals.rs) (Goal engine), [`src-tauri/src/store.rs`](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/store.rs) (Local JSON store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Planning and daily use"]
  node_app["App navigation<br/>[App.tsx]"]
  node_day_views["Today and tomorrow"]
  node_plan_wizard["Plan wizard<br/>[PlanWizard.tsx]"]
  node_clock_view["Task clock<br/>[ClockScreen.tsx]"]
end

subgraph group_review["Results and history"]
  node_board_view["Results board<br/>[BoardScreen.tsx]"]
  node_board_model["Board model<br/>[model.ts]"]
  node_insights["History insights<br/>[insights.rs]"]
end

subgraph group_goals["Goal planning"]
  node_goal_views["Goals and map"]
  node_goal_kit["Goal UI helpers<br/>[goalKit.tsx]"]
  node_goal_engine["Goal engine<br/>[goals.rs]"]
end

subgraph group_backend["Application backend"]
  node_api["Frontend API<br/>[api.ts]"]
  node_commands["App commands<br/>[commands.rs]"]
  node_logic["Day logic<br/>[logic.rs]"]
  node_clock["Day and time<br/>[clock.rs]"]
  node_store[("Local JSON store<br/>[store.rs]")]
  node_model["Domain model<br/>[model.rs]"]
  node_scheduler["Notifications and scheduling<br/>[scheduler.rs]"]
  node_updater["Updater<br/>[updater.rs]"]
end

subgraph group_mcp["AI integration"]
  node_mcp_server["MCP server<br/>[mcp.rs]"]
  node_ai_guide["AI guide resource<br/>[ai_guide.rs]"]
  node_ai_client(("MCP client"))
end

node_user(("Planner"))

node_user -->|"uses"| node_app
node_app -->|"loads overview"| node_api
node_app -->|"routes to"| node_day_views
node_app -->|"routes to"| node_clock_view
node_app -->|"routes to"| node_board_view
node_app -->|"routes to"| node_goal_views
node_user -->|"plans tomorrow"| node_plan_wizard
node_plan_wizard -.->|"requests changes"| node_api
node_user -->|"views schedule"| node_clock_view
node_api -.->|"invokes commands"| node_commands
node_commands -.->|"dispatches"| node_logic
node_logic -->|"reads and writes"| node_store
node_logic -->|"uses time rules"| node_clock
node_logic -->|"uses goal planning"| node_goal_engine
node_logic -->|"uses domain types"| node_model
node_user -->|"assembles results"| node_board_view
node_board_view -->|"loads board"| node_api
node_board_view -->|"parses board data"| node_board_model
node_board_view -.->|"persists board"| node_store
node_user -->|"edits goal map"| node_goal_views
node_goal_views -->|"uses helpers"| node_goal_kit
node_goal_views -.->|"requests goal data"| node_api
node_goal_engine -->|"reads and writes"| node_store
node_goal_engine -->|"plans ahead"| node_logic
node_goal_engine -->|"uses date rules"| node_clock
node_goal_engine -->|"uses domain types"| node_model
node_store -->|"stores records"| node_model
node_user -.->|"reviews history"| node_insights
node_ai_client -->|"requests data"| node_mcp_server
node_mcp_server -->|"serves guide"| node_ai_guide
node_mcp_server -->|"reads history"| node_insights
node_mcp_server -->|"edits goals"| node_goal_engine
node_mcp_server -.->|"reads data"| node_store
node_scheduler -.->|"checks day state"| node_logic
node_updater -->|"reads settings"| node_store

click node_app "https://github.com/igorberezkin/nextday/blob/main/src/App.tsx"
click node_day_views "https://github.com/igorberezkin/nextday/tree/main/src/screens"
click node_plan_wizard "https://github.com/igorberezkin/nextday/blob/main/src/screens/PlanWizard.tsx"
click node_clock_view "https://github.com/igorberezkin/nextday/blob/main/src/screens/ClockScreen.tsx"
click node_api "https://github.com/igorberezkin/nextday/blob/main/src/api.ts"
click node_commands "https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/commands.rs"
click node_logic "https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/logic.rs"
click node_clock "https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/clock.rs"
click node_store "https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/store.rs"
click node_board_view "https://github.com/igorberezkin/nextday/blob/main/src/board/BoardScreen.tsx"
click node_board_model "https://github.com/igorberezkin/nextday/blob/main/src/board/model.ts"
click node_insights "https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/insights.rs"
click node_goal_views "https://github.com/igorberezkin/nextday/tree/main/src/screens"
click node_goal_kit "https://github.com/igorberezkin/nextday/blob/main/src/screens/goalKit.tsx"
click node_goal_engine "https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/goals.rs"
click node_model "https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/model.rs"
click node_scheduler "https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/scheduler.rs"
click node_updater "https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/updater.rs"
click node_mcp_server "https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/mcp.rs"
click node_ai_guide "https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/ai_guide.rs"

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_day_views,node_plan_wizard,node_clock_view toneBlue
class node_board_view,node_board_model,node_insights toneAmber
class node_goal_views,node_goal_kit,node_goal_engine toneMint
class node_api,node_commands,node_logic,node_clock,node_store,node_model,node_scheduler,node_updater toneRose
class node_mcp_server,node_ai_guide,node_ai_client,node_user toneIndigo
```

## Components

### Planning and daily use

- [App navigation](https://github.com/igorberezkin/nextday/blob/main/src/App.tsx): `src/App.tsx`
- [Today and tomorrow](https://github.com/igorberezkin/nextday/tree/main/src/screens): `src/screens`
- [Plan wizard](https://github.com/igorberezkin/nextday/blob/main/src/screens/PlanWizard.tsx): `src/screens/PlanWizard.tsx`
- [Task clock](https://github.com/igorberezkin/nextday/blob/main/src/screens/ClockScreen.tsx): `src/screens/ClockScreen.tsx`

### Results and history

- [Results board](https://github.com/igorberezkin/nextday/blob/main/src/board/BoardScreen.tsx): `src/board/BoardScreen.tsx`
- [Board model](https://github.com/igorberezkin/nextday/blob/main/src/board/model.ts): `src/board/model.ts`
- [History insights](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/insights.rs): `src-tauri/src/insights.rs`

### Goal planning

- [Goals and map](https://github.com/igorberezkin/nextday/tree/main/src/screens): `src/screens`
- [Goal UI helpers](https://github.com/igorberezkin/nextday/blob/main/src/screens/goalKit.tsx): `src/screens/goalKit.tsx`
- [Goal engine](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/goals.rs): `src-tauri/src/goals.rs`

### Application backend

- [Frontend API](https://github.com/igorberezkin/nextday/blob/main/src/api.ts): `src/api.ts`
- [App commands](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/commands.rs): `src-tauri/src/commands.rs`
- [Day logic](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/logic.rs): `src-tauri/src/logic.rs`
- [Day and time](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/clock.rs): `src-tauri/src/clock.rs`
- [Local JSON store](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/store.rs): `src-tauri/src/store.rs`
- [Domain model](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/model.rs): `src-tauri/src/model.rs`
- [Notifications and scheduling](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/scheduler.rs): `src-tauri/src/scheduler.rs`
- [Updater](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/updater.rs): `src-tauri/src/updater.rs`

### AI integration

- [MCP server](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/mcp.rs): `src-tauri/src/mcp.rs`
- [AI guide resource](https://github.com/igorberezkin/nextday/blob/main/src-tauri/src/ai_guide.rs): `src-tauri/src/ai_guide.rs`
- **MCP client**

### Other components

- **Planner**

## Connections

- Planner → App navigation: uses (evidence: `README.md`)
- App navigation → Frontend API: loads overview (evidence: `src/App.tsx`)
- App navigation → Today and tomorrow: routes to (evidence: `src/App.tsx`)
- App navigation → Task clock: routes to (evidence: `src/App.tsx`)
- App navigation → Results board: routes to (evidence: `src/App.tsx`)
- App navigation → Goals and map: routes to (evidence: `src/App.tsx`)
- Planner → Plan wizard: plans tomorrow (evidence: `README.md`)
- Plan wizard → Frontend API: requests changes (evidence: `src/screens/PlanWizard.tsx`)
- Planner → Task clock: views schedule (evidence: `README.md`)
- Frontend API → App commands: invokes commands
- App commands → Day logic: dispatches
- Day logic → Local JSON store: reads and writes (evidence: `src-tauri/src/logic.rs`)
- Day logic → Day and time: uses time rules (evidence: `src-tauri/src/logic.rs`)
- Day logic → Goal engine: uses goal planning (evidence: `src-tauri/src/logic.rs`)
- Day logic → Domain model: uses domain types (evidence: `src-tauri/src/logic.rs`)
- Planner → Results board: assembles results (evidence: `README.md`)
- Results board → Frontend API: loads board (evidence: `src/board/BoardScreen.tsx`)
- Results board → Board model: parses board data (evidence: `src/board/BoardScreen.tsx`)
- Results board → Local JSON store: persists board
- Planner → Goals and map: edits goal map (evidence: `README.md`)
- Goals and map → Goal UI helpers: uses helpers (evidence: `src/screens/GoalsScreen.tsx`)
- Goals and map → Frontend API: requests goal data (evidence: `src/screens/MapScreen.tsx`)
- Goal engine → Local JSON store: reads and writes (evidence: `src-tauri/src/goals.rs`)
- Goal engine → Day logic: plans ahead (evidence: `src-tauri/src/goals.rs`)
- Goal engine → Day and time: uses date rules (evidence: `src-tauri/src/goals.rs`)
- Goal engine → Domain model: uses domain types (evidence: `src-tauri/src/goals.rs`)
- Local JSON store → Domain model: stores records (evidence: `src-tauri/src/store.rs`)
- Planner → History insights: reviews history
- MCP client → MCP server: requests data (evidence: `README.md`)
- MCP server → AI guide resource: serves guide (evidence: `src-tauri/src/mcp.rs`)
- MCP server → History insights: reads history (evidence: `src-tauri/src/mcp.rs`)
- MCP server → Goal engine: edits goals (evidence: `src-tauri/src/mcp.rs`)
- MCP server → Local JSON store: reads data (evidence: `src-tauri/src/mcp.rs`)
- Notifications and scheduling → Day logic: checks day state
- Updater → Local JSON store: reads settings (evidence: `src-tauri/src/updater.rs`)
