# ericerkz/kept architecture

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

- Interactive diagram: https://gitdiagram.com/ericerkz/kept
- Repository: https://github.com/ericerkz/kept

## Overview

Kept is a self-hosted notes product: users authenticate, capture and organize notes, then access them online or offline, with reminders, sharing and native-app integrations. The Angular client talks to the Node server; separate MCP entry points expose authenticated agent access. The graph includes documented product branches and sampled runtime connections. Some server routes and unsampled feature wiring are not shown, so those links are omitted or marked unverified.

Main entry points: [`server/server.js`](https://github.com/ericerkz/kept/blob/master/server/server.js) (HTTP server), [`src/app/services/auth.service.ts`](https://github.com/ericerkz/kept/blob/master/src/app/services/auth.service.ts) (Authentication), [`src/app/services/notes.service.ts`](https://github.com/ericerkz/kept/blob/master/src/app/services/notes.service.ts) (Notes API client), [`src/app/services/reminder.service.ts`](https://github.com/ericerkz/kept/blob/master/src/app/services/reminder.service.ts) (Reminder service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["App shell<br/>[app.component.ts]"]
  node_main["Notes workspace<br/>[main.component.ts]"]
  node_editor["Note editor<br/>[input.component.ts]"]
  node_cards["Note cards<br/>[notes.component.ts]"]
  node_authui["Account management"]
  node_settings["Settings"]
end

subgraph group_services["Client services"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_notes["Notes API client<br/>[notes.service.ts]"]
  node_offline[("Offline cache")]
  node_sync["Offline sync"]
  node_reminders["Reminder service"]
  node_push["Push notifications"]
end

subgraph group_server["Server runtime"]
  node_backend["HTTP server<br/>[server.js]"]
  node_recurrence["Reminder recurrence"]
  node_native["Native client support<br/>[native-client.js]"]
  node_oauth["OAuth and MCP bridge<br/>[oauth-mcp.js]"]
end

subgraph group_agents["Agent access"]
  node_mcpentry["MCP entry point<br/>[index.mjs]"]
  node_mcpserver["MCP tools<br/>[server.mjs]"]
  node_mcpclient["Kept API client<br/>[kept-client.mjs]"]
end

node_user(("Kept user"))
node_agent(("Agent client"))

node_user -->|"uses"| node_app
node_app -->|"authenticates with"| node_auth
node_user -->|"captures notes"| node_main
node_main -.->|"opens editor"| node_editor
node_main -.->|"shows notes"| node_cards
node_main -->|"uses"| node_notes
node_authui -.->|"manages accounts"| node_auth
node_settings -.->|"loads preferences"| node_auth
node_notes -->|"adds auth headers"| node_auth
node_notes -->|"caches notes"| node_offline
node_notes -->|"uses sync"| node_sync
node_sync -->|"reads and writes"| node_offline
node_user -->|"sets reminders"| node_reminders
node_reminders -->|"adds auth headers"| node_auth
node_reminders -->|"stores reminders"| node_offline
node_reminders -->|"uses sync"| node_sync
node_app -->|"requests permission"| node_push
node_notes -.->|"calls HTTP API"| node_backend
node_auth -.->|"calls HTTP API"| node_backend
node_reminders -.->|"calls HTTP API"| node_backend
node_backend -->|"imports"| node_recurrence
node_backend -->|"imports"| node_native
node_backend -->|"imports"| node_oauth
node_agent -->|"connects"| node_mcpentry
node_mcpentry -->|"creates server"| node_mcpserver
node_mcpentry -->|"creates client"| node_mcpclient
node_mcpserver -->|"invokes tools"| node_mcpclient
node_mcpclient -.->|"calls authenticated API"| node_backend
node_oauth -->|"integrates MCP"| node_mcpserver

click node_app "https://github.com/ericerkz/kept/blob/master/src/app/app.component.ts"
click node_main "https://github.com/ericerkz/kept/blob/master/src/app/components/main/main.component.ts"
click node_editor "https://github.com/ericerkz/kept/blob/master/src/app/components/input/input.component.ts"
click node_cards "https://github.com/ericerkz/kept/blob/master/src/app/components/notes/notes.component.ts"
click node_authui "https://github.com/ericerkz/kept/blob/master/src/app/components/auth/user-management/user-management.component.ts"
click node_settings "https://github.com/ericerkz/kept/blob/master/src/app/components/settings/settings.component.ts"
click node_auth "https://github.com/ericerkz/kept/blob/master/src/app/services/auth.service.ts"
click node_notes "https://github.com/ericerkz/kept/blob/master/src/app/services/notes.service.ts"
click node_offline "https://github.com/ericerkz/kept/blob/master/src/app/services/offline-store.service.ts"
click node_sync "https://github.com/ericerkz/kept/blob/master/src/app/services/offline-sync.service.ts"
click node_reminders "https://github.com/ericerkz/kept/blob/master/src/app/services/reminder.service.ts"
click node_push "https://github.com/ericerkz/kept/blob/master/src/app/services/push-notification.service.ts"
click node_backend "https://github.com/ericerkz/kept/blob/master/server/server.js"
click node_recurrence "https://github.com/ericerkz/kept/blob/master/server/reminder-recurrence.js"
click node_native "https://github.com/ericerkz/kept/blob/master/server/native-client.js"
click node_oauth "https://github.com/ericerkz/kept/blob/master/server/oauth-mcp.js"
click node_mcpentry "https://github.com/ericerkz/kept/blob/master/mcp/index.mjs"
click node_mcpserver "https://github.com/ericerkz/kept/blob/master/mcp/server.mjs"
click node_mcpclient "https://github.com/ericerkz/kept/blob/master/mcp/kept-client.mjs"

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_main,node_editor,node_cards,node_authui,node_settings,node_user,node_agent toneBlue
class node_auth,node_notes,node_offline,node_sync,node_reminders,node_push toneAmber
class node_backend,node_recurrence,node_native,node_oauth toneMint
class node_mcpentry,node_mcpserver,node_mcpclient toneRose
```

## Components

### Web experience

- [App shell](https://github.com/ericerkz/kept/blob/master/src/app/app.component.ts): `src/app/app.component.ts`
- [Notes workspace](https://github.com/ericerkz/kept/blob/master/src/app/components/main/main.component.ts): `src/app/components/main/main.component.ts`
- [Note editor](https://github.com/ericerkz/kept/blob/master/src/app/components/input/input.component.ts): `src/app/components/input/input.component.ts`
- [Note cards](https://github.com/ericerkz/kept/blob/master/src/app/components/notes/notes.component.ts): `src/app/components/notes/notes.component.ts`
- [Account management](https://github.com/ericerkz/kept/blob/master/src/app/components/auth/user-management/user-management.component.ts): `src/app/components/auth/user-management/user-management.component.ts`
- [Settings](https://github.com/ericerkz/kept/blob/master/src/app/components/settings/settings.component.ts): `src/app/components/settings/settings.component.ts`

### Client services

- [Authentication](https://github.com/ericerkz/kept/blob/master/src/app/services/auth.service.ts): `src/app/services/auth.service.ts`
- [Notes API client](https://github.com/ericerkz/kept/blob/master/src/app/services/notes.service.ts): `src/app/services/notes.service.ts`
- [Offline cache](https://github.com/ericerkz/kept/blob/master/src/app/services/offline-store.service.ts): `src/app/services/offline-store.service.ts`
- [Offline sync](https://github.com/ericerkz/kept/blob/master/src/app/services/offline-sync.service.ts): `src/app/services/offline-sync.service.ts`
- [Reminder service](https://github.com/ericerkz/kept/blob/master/src/app/services/reminder.service.ts): `src/app/services/reminder.service.ts`
- [Push notifications](https://github.com/ericerkz/kept/blob/master/src/app/services/push-notification.service.ts): `src/app/services/push-notification.service.ts`

### Server runtime

- [HTTP server](https://github.com/ericerkz/kept/blob/master/server/server.js): `server/server.js`
- [Reminder recurrence](https://github.com/ericerkz/kept/blob/master/server/reminder-recurrence.js): `server/reminder-recurrence.js`
- [Native client support](https://github.com/ericerkz/kept/blob/master/server/native-client.js): `server/native-client.js`
- [OAuth and MCP bridge](https://github.com/ericerkz/kept/blob/master/server/oauth-mcp.js): `server/oauth-mcp.js`

### Agent access

- [MCP entry point](https://github.com/ericerkz/kept/blob/master/mcp/index.mjs): `mcp/index.mjs`
- [MCP tools](https://github.com/ericerkz/kept/blob/master/mcp/server.mjs): `mcp/server.mjs`
- [Kept API client](https://github.com/ericerkz/kept/blob/master/mcp/kept-client.mjs): `mcp/kept-client.mjs`

### Other components

- **Kept user**
- **Agent client**

## Connections

- Kept user → App shell: uses (evidence: `README.md`)
- App shell → Authentication: authenticates with (evidence: `src/app/app.component.ts`)
- Kept user → Notes workspace: captures notes (evidence: `README.md`)
- Notes workspace → Note editor: opens editor
- Notes workspace → Note cards: shows notes
- Notes workspace → Notes API client: uses (evidence: `src/app/components/main/main.component.ts`)
- Account management → Authentication: manages accounts
- Settings → Authentication: loads preferences
- Notes API client → Authentication: adds auth headers (evidence: `src/app/services/notes.service.ts`)
- Notes API client → Offline cache: caches notes (evidence: `src/app/services/notes.service.ts`)
- Notes API client → Offline sync: uses sync (evidence: `src/app/services/notes.service.ts`)
- Offline sync → Offline cache: reads and writes (evidence: `src/app/services/offline-sync.service.ts`)
- Kept user → Reminder service: sets reminders (evidence: `README.md`)
- Reminder service → Authentication: adds auth headers (evidence: `src/app/services/reminder.service.ts`)
- Reminder service → Offline cache: stores reminders (evidence: `src/app/services/reminder.service.ts`)
- Reminder service → Offline sync: uses sync (evidence: `src/app/services/reminder.service.ts`)
- App shell → Push notifications: requests permission (evidence: `src/app/app.component.ts`)
- Notes API client → HTTP server: calls HTTP API
- Authentication → HTTP server: calls HTTP API
- Reminder service → HTTP server: calls HTTP API
- HTTP server → Reminder recurrence: imports (evidence: `server/server.js`)
- HTTP server → Native client support: imports (evidence: `server/server.js`)
- HTTP server → OAuth and MCP bridge: imports (evidence: `server/server.js`)
- Agent client → MCP entry point: connects (evidence: `README.md`)
- MCP entry point → MCP tools: creates server (evidence: `mcp/index.mjs`)
- MCP entry point → Kept API client: creates client (evidence: `mcp/index.mjs`)
- MCP tools → Kept API client: invokes tools (evidence: `mcp/server.mjs`)
- Kept API client → HTTP server: calls authenticated API
- OAuth and MCP bridge → MCP tools: integrates MCP (evidence: `server/oauth-mcp.js`)
