# hoangnguyen412/life-os architecture

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

- Interactive diagram: https://gitdiagram.com/hoangnguyen412/life-os
- Repository: https://github.com/hoangnguyen412/life-os

## Overview

AI Life OS is a React-and-Express personal productivity workspace. Users authenticate, then manage tasks, goals, and calendar events and review a productivity dashboard; the client calls REST services, while backend services hold feature logic and use MongoDB models. Task and goal progress are linked: task changes trigger goal progress recalculation. The README documents the feature set and architecture; source excerpts show routing and task/goal behavior, but dashboard and calendar backend internals were not sampled, so those details are left broad.

Main entry points: [`server/app.js`](https://github.com/hoangnguyen412/life-os/blob/main/server/app.js) (Express app and routes), [`client/src/services/apiClient.js`](https://github.com/hoangnguyen412/life-os/blob/main/client/src/services/apiClient.js) (API client), [`server/models`](https://github.com/hoangnguyen412/life-os/tree/main/server/models) (User, task, goal, event models), [`client/src/layouts/AppLayout.jsx`](https://github.com/hoangnguyen412/life-os/blob/main/client/src/layouts/AppLayout.jsx) (Workspace layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web workspace"]
  node_webapp["React app router<br/>[App.jsx]"]
  node_workspace["Workspace layout<br/>[AppLayout.jsx]"]
  node_taskui["Task workspace<br/>[TasksPage.jsx]"]
  node_taskdialog["Task editor<br/>[TaskDialog.jsx]"]
  node_goalui["Goal workspace<br/>[GoalsPage.jsx]"]
  node_calendarui["Calendar workspace<br/>[CalendarPage.jsx]"]
  node_dashboardui["Productivity dashboard<br/>[DashboardPage.jsx]"]
  node_clientapi["API client<br/>[apiClient.js]"]
  node_taskapi["Task API<br/>[taskApi.js]"]
  node_goalapi["Goal API<br/>[goalApi.js]"]
  node_calendarapi["Calendar API<br/>[calendarApi.js]"]
  node_dashboardapi["Dashboard API<br/>[dashboardApi.js]"]
end

subgraph group_auth["Authentication"]
  node_authui["Login and registration"]
  node_authprovider["Auth provider<br/>[AuthProvider.jsx]"]
  node_authapi["Auth API<br/>[authApi.js]"]
  node_authroutes["Auth routes and controller<br/>[authRoutes.js]"]
  node_authservice["Authentication service<br/>[authService.js]"]
end

subgraph group_server["REST backend"]
  node_express["Express app and routes<br/>[app.js]"]
  node_taskroutes["Task routes and controller<br/>[taskRoutes.js]"]
  node_goalroutes["Goal routes and controller<br/>[goalRoutes.js]"]
  node_eventroutes["Event routes and controller<br/>[eventRoutes.js]"]
  node_dashboardroutes["Dashboard route and controller<br/>[dashboardRoutes.js]"]
end

subgraph group_domain["Product services"]
  node_taskservice["Task lifecycle service<br/>[taskService.js]"]
  node_goalservice["Goal progress service<br/>[goalService.js]"]
  node_eventservice["Calendar event service<br/>[eventService.js]"]
  node_dashboardservice["Dashboard aggregation"]
end

subgraph group_data["MongoDB models"]
  node_models[("User, task, goal, event models")]
end

node_user(("User"))
node_mongo[("MongoDB")]

node_user -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_authui
node_webapp -->|"routes to"| node_workspace
node_authui -.->|"submits credentials"| node_authapi
node_authprovider -->|"requests session"| node_authapi
node_workspace -->|"renders"| node_taskui
node_workspace -->|"renders"| node_goalui
node_workspace -->|"renders"| node_calendarui
node_workspace -->|"renders"| node_dashboardui
node_taskui -->|"loads tasks"| node_taskapi
node_taskui -->|"loads goals"| node_goalapi
node_taskui -->|"opens editor"| node_taskdialog
node_taskdialog -->|"writes tasks"| node_taskapi
node_goalui -.->|"manages goals"| node_goalapi
node_calendarui -->|"manages events"| node_calendarapi
node_dashboardui -.->|"loads summary"| node_dashboardapi
node_taskapi -.->|"uses"| node_clientapi
node_goalapi -.->|"uses"| node_clientapi
node_calendarapi -.->|"uses"| node_clientapi
node_dashboardapi -.->|"uses"| node_clientapi
node_authapi -.->|"uses"| node_clientapi
node_clientapi -->|"sends REST requests"| node_express
node_express -->|"mounts"| node_authroutes
node_express -->|"mounts"| node_taskroutes
node_express -->|"mounts"| node_goalroutes
node_express -->|"mounts"| node_eventroutes
node_express -->|"mounts"| node_dashboardroutes
node_authroutes -->|"dispatches to"| node_authservice
node_taskroutes -->|"dispatches to"| node_taskservice
node_goalroutes -->|"dispatches to"| node_goalservice
node_eventroutes -->|"dispatches to"| node_eventservice
node_dashboardroutes -.->|"dispatches to"| node_dashboardservice
node_authservice -->|"reads and writes"| node_models
node_taskservice -->|"reads and writes"| node_models
node_goalservice -->|"reads and writes"| node_models
node_eventservice -->|"reads and writes"| node_models
node_taskservice -->|"recalculates progress"| node_goalservice
node_dashboardservice -.->|"summarizes records"| node_models
node_models -->|"persists records"| node_mongo

click node_webapp "https://github.com/hoangnguyen412/life-os/blob/main/client/src/App.jsx"
click node_authui "https://github.com/hoangnguyen412/life-os/tree/main/client/src/pages"
click node_authprovider "https://github.com/hoangnguyen412/life-os/blob/main/client/src/auth/AuthProvider.jsx"
click node_workspace "https://github.com/hoangnguyen412/life-os/blob/main/client/src/layouts/AppLayout.jsx"
click node_taskui "https://github.com/hoangnguyen412/life-os/blob/main/client/src/pages/TasksPage.jsx"
click node_taskdialog "https://github.com/hoangnguyen412/life-os/blob/main/client/src/components/tasks/TaskDialog.jsx"
click node_goalui "https://github.com/hoangnguyen412/life-os/blob/main/client/src/pages/GoalsPage.jsx"
click node_calendarui "https://github.com/hoangnguyen412/life-os/blob/main/client/src/pages/CalendarPage.jsx"
click node_dashboardui "https://github.com/hoangnguyen412/life-os/blob/main/client/src/pages/DashboardPage.jsx"
click node_clientapi "https://github.com/hoangnguyen412/life-os/blob/main/client/src/services/apiClient.js"
click node_authapi "https://github.com/hoangnguyen412/life-os/blob/main/client/src/services/authApi.js"
click node_taskapi "https://github.com/hoangnguyen412/life-os/blob/main/client/src/services/taskApi.js"
click node_goalapi "https://github.com/hoangnguyen412/life-os/blob/main/client/src/services/goalApi.js"
click node_calendarapi "https://github.com/hoangnguyen412/life-os/blob/main/client/src/services/calendarApi.js"
click node_dashboardapi "https://github.com/hoangnguyen412/life-os/blob/main/client/src/services/dashboardApi.js"
click node_express "https://github.com/hoangnguyen412/life-os/blob/main/server/app.js"
click node_authroutes "https://github.com/hoangnguyen412/life-os/blob/main/server/routes/authRoutes.js"
click node_authservice "https://github.com/hoangnguyen412/life-os/blob/main/server/services/authService.js"
click node_taskroutes "https://github.com/hoangnguyen412/life-os/blob/main/server/routes/taskRoutes.js"
click node_taskservice "https://github.com/hoangnguyen412/life-os/blob/main/server/services/taskService.js"
click node_goalroutes "https://github.com/hoangnguyen412/life-os/blob/main/server/routes/goalRoutes.js"
click node_goalservice "https://github.com/hoangnguyen412/life-os/blob/main/server/services/goalService.js"
click node_eventroutes "https://github.com/hoangnguyen412/life-os/blob/main/server/routes/eventRoutes.js"
click node_eventservice "https://github.com/hoangnguyen412/life-os/blob/main/server/services/eventService.js"
click node_dashboardroutes "https://github.com/hoangnguyen412/life-os/blob/main/server/routes/dashboardRoutes.js"
click node_dashboardservice "https://github.com/hoangnguyen412/life-os/blob/main/server/services/dashboardService.js"
click node_models "https://github.com/hoangnguyen412/life-os/tree/main/server/models"

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_webapp,node_workspace,node_taskui,node_taskdialog,node_goalui,node_calendarui,node_dashboardui,node_clientapi,node_taskapi,node_goalapi,node_calendarapi,node_dashboardapi,node_user toneBlue
class node_authui,node_authprovider,node_authapi,node_authroutes,node_authservice,node_mongo toneAmber
class node_express,node_taskroutes,node_goalroutes,node_eventroutes,node_dashboardroutes toneMint
class node_taskservice,node_goalservice,node_eventservice,node_dashboardservice toneRose
class node_models toneIndigo
```

## Components

### Web workspace

- [React app router](https://github.com/hoangnguyen412/life-os/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Workspace layout](https://github.com/hoangnguyen412/life-os/blob/main/client/src/layouts/AppLayout.jsx): `client/src/layouts/AppLayout.jsx`
- [Task workspace](https://github.com/hoangnguyen412/life-os/blob/main/client/src/pages/TasksPage.jsx): `client/src/pages/TasksPage.jsx`
- [Task editor](https://github.com/hoangnguyen412/life-os/blob/main/client/src/components/tasks/TaskDialog.jsx): `client/src/components/tasks/TaskDialog.jsx`
- [Goal workspace](https://github.com/hoangnguyen412/life-os/blob/main/client/src/pages/GoalsPage.jsx): `client/src/pages/GoalsPage.jsx`
- [Calendar workspace](https://github.com/hoangnguyen412/life-os/blob/main/client/src/pages/CalendarPage.jsx): `client/src/pages/CalendarPage.jsx`
- [Productivity dashboard](https://github.com/hoangnguyen412/life-os/blob/main/client/src/pages/DashboardPage.jsx): `client/src/pages/DashboardPage.jsx`
- [API client](https://github.com/hoangnguyen412/life-os/blob/main/client/src/services/apiClient.js): `client/src/services/apiClient.js`
- [Task API](https://github.com/hoangnguyen412/life-os/blob/main/client/src/services/taskApi.js): `client/src/services/taskApi.js`
- [Goal API](https://github.com/hoangnguyen412/life-os/blob/main/client/src/services/goalApi.js): `client/src/services/goalApi.js`
- [Calendar API](https://github.com/hoangnguyen412/life-os/blob/main/client/src/services/calendarApi.js): `client/src/services/calendarApi.js`
- [Dashboard API](https://github.com/hoangnguyen412/life-os/blob/main/client/src/services/dashboardApi.js): `client/src/services/dashboardApi.js`

### Authentication

- [Login and registration](https://github.com/hoangnguyen412/life-os/tree/main/client/src/pages): `client/src/pages`
- [Auth provider](https://github.com/hoangnguyen412/life-os/blob/main/client/src/auth/AuthProvider.jsx): `client/src/auth/AuthProvider.jsx`
- [Auth API](https://github.com/hoangnguyen412/life-os/blob/main/client/src/services/authApi.js): `client/src/services/authApi.js`
- [Auth routes and controller](https://github.com/hoangnguyen412/life-os/blob/main/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [Authentication service](https://github.com/hoangnguyen412/life-os/blob/main/server/services/authService.js): `server/services/authService.js`

### REST backend

- [Express app and routes](https://github.com/hoangnguyen412/life-os/blob/main/server/app.js): `server/app.js`
- [Task routes and controller](https://github.com/hoangnguyen412/life-os/blob/main/server/routes/taskRoutes.js): `server/routes/taskRoutes.js`
- [Goal routes and controller](https://github.com/hoangnguyen412/life-os/blob/main/server/routes/goalRoutes.js): `server/routes/goalRoutes.js`
- [Event routes and controller](https://github.com/hoangnguyen412/life-os/blob/main/server/routes/eventRoutes.js): `server/routes/eventRoutes.js`
- [Dashboard route and controller](https://github.com/hoangnguyen412/life-os/blob/main/server/routes/dashboardRoutes.js): `server/routes/dashboardRoutes.js`

### Product services

- [Task lifecycle service](https://github.com/hoangnguyen412/life-os/blob/main/server/services/taskService.js): `server/services/taskService.js`
- [Goal progress service](https://github.com/hoangnguyen412/life-os/blob/main/server/services/goalService.js): `server/services/goalService.js`
- [Calendar event service](https://github.com/hoangnguyen412/life-os/blob/main/server/services/eventService.js): `server/services/eventService.js`
- [Dashboard aggregation](https://github.com/hoangnguyen412/life-os/blob/main/server/services/dashboardService.js): `server/services/dashboardService.js`

### MongoDB models

- [User, task, goal, event models](https://github.com/hoangnguyen412/life-os/tree/main/server/models): `server/models`

### Other components

- **User**
- **MongoDB**

## Connections

- User → React app router: uses (evidence: `README.md`)
- React app router → Login and registration: routes to (evidence: `client/src/App.jsx`)
- React app router → Workspace layout: routes to (evidence: `client/src/App.jsx`)
- Login and registration → Auth API: submits credentials
- Auth provider → Auth API: requests session (evidence: `client/src/auth/AuthProvider.jsx`)
- Workspace layout → Task workspace: renders (evidence: `client/src/App.jsx`)
- Workspace layout → Goal workspace: renders (evidence: `client/src/App.jsx`)
- Workspace layout → Calendar workspace: renders (evidence: `client/src/App.jsx`)
- Workspace layout → Productivity dashboard: renders (evidence: `client/src/App.jsx`)
- Task workspace → Task API: loads tasks (evidence: `client/src/pages/TasksPage.jsx`)
- Task workspace → Goal API: loads goals (evidence: `client/src/pages/TasksPage.jsx`)
- Task workspace → Task editor: opens editor (evidence: `client/src/pages/TasksPage.jsx`)
- Task editor → Task API: writes tasks (evidence: `client/src/components/tasks/TaskDialog.jsx`)
- Goal workspace → Goal API: manages goals
- Calendar workspace → Calendar API: manages events (evidence: `client/src/pages/CalendarPage.jsx`)
- Productivity dashboard → Dashboard API: loads summary
- Task API → API client: uses
- Goal API → API client: uses
- Calendar API → API client: uses
- Dashboard API → API client: uses
- Auth API → API client: uses
- API client → Express app and routes: sends REST requests (evidence: `README.md`)
- Express app and routes → Auth routes and controller: mounts (evidence: `server/app.js`)
- Express app and routes → Task routes and controller: mounts (evidence: `server/app.js`)
- Express app and routes → Goal routes and controller: mounts (evidence: `server/app.js`)
- Express app and routes → Event routes and controller: mounts (evidence: `server/app.js`)
- Express app and routes → Dashboard route and controller: mounts (evidence: `server/app.js`)
- Auth routes and controller → Authentication service: dispatches to (evidence: `server/routes/authRoutes.js`)
- Task routes and controller → Task lifecycle service: dispatches to
- Goal routes and controller → Goal progress service: dispatches to
- Event routes and controller → Calendar event service: dispatches to
- Dashboard route and controller → Dashboard aggregation: dispatches to
- Authentication service → User, task, goal, event models: reads and writes (evidence: `server/services/authService.js`)
- Task lifecycle service → User, task, goal, event models: reads and writes (evidence: `server/services/taskService.js`)
- Goal progress service → User, task, goal, event models: reads and writes (evidence: `server/services/goalService.js`)
- Calendar event service → User, task, goal, event models: reads and writes (evidence: `server/services/eventService.js`)
- Task lifecycle service → Goal progress service: recalculates progress (evidence: `server/services/taskService.js`)
- Dashboard aggregation → User, task, goal, event models: summarizes records
- User, task, goal, event models → MongoDB: persists records (evidence: `README.md`)
