# rsavnani18/todoapp-mern-capacitor architecture

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

- Interactive diagram: https://gitdiagram.com/rsavnani18/todoapp-mern-capacitor
- Repository: https://github.com/rsavnani18/todoapp-mern-capacitor

## Overview

ToDoApp is a web and Capacitor task-and-notes workspace backed by an Express/MongoDB API. Users authenticate, then manage priority tasks and Keep-style notes/checklists, including filtering, archiving, trash, reminders, and conversions between notes and tasks. The graph follows the documented client-to-API workflow and source-indexed calls; some backend routes and UI components were not excerpted, so their links rely on the README or indexed references rather than assumptions about unsampled code.

Main entry points: [`frontend/src/App.tsx`](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/App.tsx) (App shell), [`frontend/src/screens/HomeScreen.tsx`](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/screens/HomeScreen.tsx) (Workspace screen), [`frontend/src/services/capacitor.ts`](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/services/capacitor.ts) (Native reminders), [`backend/src/app.ts`](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/app.ts) (Express API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React Client"]
  node_app["App shell<br/>[App.tsx]"]
  node_authscreen["Sign-in UI<br/>[AuthScreen.tsx]"]
  node_authcontext["Session state<br/>[AuthContext.tsx]"]
  node_theme["Theme state<br/>[ThemeContext.tsx]"]
  node_home["Workspace screen<br/>[HomeScreen.tsx]"]
  node_profile["Profile screen<br/>[ProfileScreen.tsx]"]
  node_todo_ui["Task controls<br/>[TodoSheet.tsx]"]
  node_note_ui["Note editor"]
  node_note_card["Note cards<br/>[NoteCard.tsx]"]
  node_api_client["REST client<br/>[api.ts]"]
end

subgraph group_api["API and Security"]
  node_api_app["Express API<br/>[app.ts]"]
  node_auth_routes["Auth routes<br/>[auth.routes.ts]"]
  node_todo_routes["Task routes<br/>[todo.routes.ts]"]
  node_note_routes["Note routes<br/>[note.routes.ts]"]
  node_auth_guard["JWT guard<br/>[auth.middleware.ts]"]
end

subgraph group_domain["Domain Data"]
  node_auth_controller["Auth operations<br/>[auth.controller.ts]"]
  node_todo_controller["Task operations<br/>[todo.controller.ts]"]
  node_note_controller["Note operations<br/>[note.controller.ts]"]
  node_user_store[("User records<br/>[user.model.ts]")]
  node_todo_store[("Task records<br/>[todo.model.ts]")]
  node_note_store[("Note records<br/>[note.model.ts]")]
end

subgraph group_native["Native Features"]
  node_native_service["Native reminders<br/>[capacitor.ts]"]
end

node_user(("Workspace user"))
node_native_platform{{"Capacitor platform"}}
node_mongo[("MongoDB")]

node_user -->|"uses"| node_app
node_app -->|"shows"| node_authscreen
node_app -->|"shows"| node_home
node_app -->|"shows"| node_profile
node_authscreen -->|"authenticates through"| node_authcontext
node_authcontext -->|"calls"| node_api_client
node_app -->|"reads session"| node_authcontext
node_home -->|"loads and updates"| node_api_client
node_home -->|"opens"| node_todo_ui
node_home -->|"opens"| node_note_ui
node_home -->|"renders"| node_note_card
node_profile -->|"calls"| node_api_client
node_api_client -->|"sends REST requests"| node_api_app
node_api_app -->|"mounts"| node_auth_routes
node_api_app -->|"mounts"| node_todo_routes
node_api_app -->|"mounts"| node_note_routes
node_auth_routes -->|"uses"| node_auth_guard
node_auth_routes -->|"routes to"| node_auth_controller
node_todo_routes -->|"protects routes"| node_auth_guard
node_todo_routes -->|"routes to"| node_todo_controller
node_note_routes -->|"protects routes"| node_auth_guard
node_note_routes -->|"routes to"| node_note_controller
node_auth_controller -->|"reads and writes"| node_user_store
node_todo_controller -->|"reads and writes"| node_todo_store
node_todo_controller -->|"creates converted notes"| node_note_store
node_note_controller -->|"reads and writes"| node_note_store
node_note_controller -->|"creates converted tasks"| node_todo_store
node_user_store -.->|"persists"| node_mongo
node_todo_store -.->|"persists"| node_mongo
node_note_store -.->|"persists"| node_mongo
node_note_ui -->|"schedules reminders"| node_native_service
node_todo_ui -->|"schedules reminders"| node_native_service
node_authscreen -->|"uses haptics"| node_native_service
node_theme -->|"syncs status bar"| node_native_service
node_native_service -->|"invokes plugins"| node_native_platform

click node_app "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/App.tsx"
click node_authscreen "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/screens/AuthScreen.tsx"
click node_authcontext "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/context/AuthContext.tsx"
click node_theme "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/context/ThemeContext.tsx"
click node_home "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/screens/HomeScreen.tsx"
click node_profile "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/screens/ProfileScreen.tsx"
click node_todo_ui "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/components/TodoSheet.tsx"
click node_note_ui "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/components/NoteEditorSheet.tsx"
click node_note_card "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/components/NoteCard.tsx"
click node_api_client "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/services/api.ts"
click node_api_app "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/app.ts"
click node_auth_routes "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/routes/auth.routes.ts"
click node_todo_routes "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/routes/todo.routes.ts"
click node_note_routes "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/routes/note.routes.ts"
click node_auth_guard "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/middleware/auth.middleware.ts"
click node_auth_controller "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/controllers/auth.controller.ts"
click node_todo_controller "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/controllers/todo.controller.ts"
click node_note_controller "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/controllers/note.controller.ts"
click node_user_store "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/models/user.model.ts"
click node_todo_store "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/models/todo.model.ts"
click node_note_store "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/models/note.model.ts"
click node_native_service "https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/services/capacitor.ts"

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_authscreen,node_authcontext,node_theme,node_home,node_profile,node_todo_ui,node_note_ui,node_note_card,node_api_client,node_user toneBlue
class node_api_app,node_auth_routes,node_todo_routes,node_note_routes,node_auth_guard,node_mongo toneAmber
class node_auth_controller,node_todo_controller,node_note_controller,node_user_store,node_todo_store,node_note_store toneMint
class node_native_service toneRose
class node_native_platform toneIndigo
```

## Components

### React Client

- [App shell](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Sign-in UI](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/screens/AuthScreen.tsx): `frontend/src/screens/AuthScreen.tsx`
- [Session state](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Theme state](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/context/ThemeContext.tsx): `frontend/src/context/ThemeContext.tsx`
- [Workspace screen](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/screens/HomeScreen.tsx): `frontend/src/screens/HomeScreen.tsx`
- [Profile screen](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/screens/ProfileScreen.tsx): `frontend/src/screens/ProfileScreen.tsx`
- [Task controls](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/components/TodoSheet.tsx): `frontend/src/components/TodoSheet.tsx`
- [Note editor](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/components/NoteEditorSheet.tsx): `frontend/src/components/NoteEditorSheet.tsx`
- [Note cards](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/components/NoteCard.tsx): `frontend/src/components/NoteCard.tsx`
- [REST client](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### API and Security

- [Express API](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/app.ts): `backend/src/app.ts`
- [Auth routes](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/routes/auth.routes.ts): `backend/src/routes/auth.routes.ts`
- [Task routes](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/routes/todo.routes.ts): `backend/src/routes/todo.routes.ts`
- [Note routes](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/routes/note.routes.ts): `backend/src/routes/note.routes.ts`
- [JWT guard](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/middleware/auth.middleware.ts): `backend/src/middleware/auth.middleware.ts`

### Domain Data

- [Auth operations](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/controllers/auth.controller.ts): `backend/src/controllers/auth.controller.ts`
- [Task operations](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/controllers/todo.controller.ts): `backend/src/controllers/todo.controller.ts`
- [Note operations](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/controllers/note.controller.ts): `backend/src/controllers/note.controller.ts`
- [User records](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/models/user.model.ts): `backend/src/models/user.model.ts`
- [Task records](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/models/todo.model.ts): `backend/src/models/todo.model.ts`
- [Note records](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/backend/src/models/note.model.ts): `backend/src/models/note.model.ts`

### Native Features

- [Native reminders](https://github.com/rsavnani18/todoapp-mern-capacitor/blob/master/frontend/src/services/capacitor.ts): `frontend/src/services/capacitor.ts`

### Other components

- **Workspace user**
- **Capacitor platform**
- **MongoDB**

## Connections

- Workspace user → App shell: uses (evidence: `README.md`)
- App shell → Sign-in UI: shows (evidence: `frontend/src/App.tsx`)
- App shell → Workspace screen: shows (evidence: `frontend/src/App.tsx`)
- App shell → Profile screen: shows (evidence: `frontend/src/App.tsx`)
- Sign-in UI → Session state: authenticates through (evidence: `frontend/src/screens/AuthScreen.tsx`)
- Session state → REST client: calls (evidence: `frontend/src/context/AuthContext.tsx`)
- App shell → Session state: reads session (evidence: `frontend/src/App.tsx`)
- Workspace screen → REST client: loads and updates (evidence: `frontend/src/screens/HomeScreen.tsx`)
- Workspace screen → Task controls: opens (evidence: `frontend/src/screens/HomeScreen.tsx`)
- Workspace screen → Note editor: opens (evidence: `frontend/src/screens/HomeScreen.tsx`)
- Workspace screen → Note cards: renders (evidence: `frontend/src/screens/HomeScreen.tsx`)
- Profile screen → REST client: calls (evidence: `frontend/src/screens/ProfileScreen.tsx`)
- REST client → Express API: sends REST requests (evidence: `README.md`)
- Express API → Auth routes: mounts (evidence: `backend/src/app.ts`)
- Express API → Task routes: mounts (evidence: `backend/src/app.ts`)
- Express API → Note routes: mounts (evidence: `backend/src/app.ts`)
- Auth routes → JWT guard: uses (evidence: `backend/src/routes/auth.routes.ts`)
- Auth routes → Auth operations: routes to (evidence: `backend/src/routes/auth.routes.ts`)
- Task routes → JWT guard: protects routes (evidence: `backend/src/routes/todo.routes.ts`)
- Task routes → Task operations: routes to (evidence: `backend/src/routes/todo.routes.ts`)
- Note routes → JWT guard: protects routes (evidence: `backend/src/routes/note.routes.ts`)
- Note routes → Note operations: routes to (evidence: `backend/src/routes/note.routes.ts`)
- Auth operations → User records: reads and writes (evidence: `backend/src/controllers/auth.controller.ts`)
- Task operations → Task records: reads and writes (evidence: `backend/src/controllers/todo.controller.ts`)
- Task operations → Note records: creates converted notes (evidence: `backend/src/controllers/todo.controller.ts`)
- Note operations → Note records: reads and writes (evidence: `backend/src/controllers/note.controller.ts`)
- Note operations → Task records: creates converted tasks (evidence: `backend/src/controllers/note.controller.ts`)
- User records → MongoDB: persists
- Task records → MongoDB: persists
- Note records → MongoDB: persists
- Note editor → Native reminders: schedules reminders (evidence: `README.md`)
- Task controls → Native reminders: schedules reminders (evidence: `README.md`)
- Sign-in UI → Native reminders: uses haptics (evidence: `frontend/src/screens/AuthScreen.tsx`)
- Theme state → Native reminders: syncs status bar (evidence: `frontend/src/context/ThemeContext.tsx`)
- Native reminders → Capacitor platform: invokes plugins (evidence: `frontend/src/services/capacitor.ts`)
