# shashankshekhar1672007-oss/cubicnotes architecture

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

- Interactive diagram: https://gitdiagram.com/shashankshekhar1672007-oss/cubicnotes
- Repository: https://github.com/shashankshekhar1672007-oss/cubicnotes

## Overview

CubicNotes is a personal knowledge and productivity workspace. Users enter through the React app, browse notes or notebook documents, manage tasks and reminders, and reach results through the frontend API client and Express controllers, which persist application data in MongoDB. Authentication supports verified email registration and Google login; guest mode gates writes. The README also documents Gemini writing tools, Calendar sync, push alerts, dashboard analytics, and trash retention. Some feature wiring is documented but its implementation was not sampled, so those links are shown at subsystem level.

Main entry points: [`backend/server.js`](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/server.js) (Express server), [`frontend/src/App.jsx`](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/App.jsx) (React app), [`frontend/src/services/api.js`](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/services/api.js) (API client), [`backend/controllers/authController.js`](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/authController.js) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Workspace client"]
  node_app["React app<br/>[App.jsx]"]
  node_notes["Notes view<br/>[NotesPage.jsx]"]
  node_notebooks["Notebook workspace"]
  node_tasks["Tasks view<br/>[TasksPage.jsx]"]
  node_reminders["Reminders view<br/>[RemindersPage.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_settings["Settings view<br/>[SettingsPage.jsx]"]
  node_trash["Trash view<br/>[TrashBinPage.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_auth_state["Auth and guest state<br/>[AuthContext.jsx]"]
  node_login["Login view<br/>[Login.jsx]"]
end

subgraph group_content["Knowledge workspace"]
  node_notes_api["Notes and pages API<br/>[noteController.js]"]
  node_notebooks_api["Notebook API"]
  node_pages_api["Document pages API<br/>[pageController.js]"]
  node_search_api["Search API"]
end

subgraph group_productivity["Productivity services"]
  node_tasks_api["Task API<br/>[taskController.js]"]
  node_reminders_api["Reminder API"]
  node_ai_api["Gemini assistant<br/>[aiController.js]"]
  node_notifications_api["Notifications API"]
  node_calendar_helper["Calendar integration<br/>[googleCalendar.js]"]
  node_push_config["Push configuration<br/>[webPush.js]"]
end

subgraph group_identity["Identity and access"]
  node_auth_routes["Auth routes<br/>[authRoutes.js]"]
  node_auth_controller["Authentication<br/>[authController.js]"]
  node_auth_middleware["Auth guard<br/>[authMiddleware.js]"]
  node_email_helper["Email sender<br/>[sendEmail.js]"]
end

subgraph group_backend["Backend foundation"]
  node_server["Express server<br/>[server.js]"]
  node_workers["Scheduled jobs"]
end

node_person(("User"))
node_mongo[("MongoDB")]
node_gemini{{"Gemini API"}}
node_calendar{{"Google Calendar"}}
node_email{{"Email delivery"}}
node_push{{"Browser push"}}

node_person -->|"uses"| node_app
node_app -->|"routes to"| node_notes
node_app -->|"routes to"| node_notebooks
node_app -->|"routes to"| node_tasks
node_app -->|"routes to"| node_reminders
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_settings
node_app -->|"routes to"| node_trash
node_app -->|"routes to"| node_login
node_login -->|"updates session"| node_auth_state
node_notes -->|"requests data"| node_api_client
node_notebooks -->|"requests data"| node_api_client
node_tasks -->|"requests data"| node_api_client
node_reminders -->|"requests data"| node_api_client
node_dashboard -->|"requests data"| node_api_client
node_settings -->|"requests data"| node_api_client
node_trash -->|"requests data"| node_api_client
node_api_client -->|"HTTP requests"| node_server
node_server -->|"mounts routes"| node_auth_routes
node_server -->|"mounts routes"| node_notes_api
node_server -->|"mounts routes"| node_notebooks_api
node_server -->|"mounts routes"| node_pages_api
node_server -->|"mounts routes"| node_tasks_api
node_server -->|"mounts routes"| node_reminders_api
node_server -->|"mounts routes"| node_ai_api
node_server -->|"mounts routes"| node_search_api
node_server -->|"mounts routes"| node_notifications_api
node_auth_routes -->|"protects routes"| node_auth_middleware
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_controller -->|"sends OTP"| node_email_helper
node_email_helper -->|"delivers mail"| node_email
node_auth_controller -->|"starts OAuth"| node_calendar_helper
node_calendar_helper -.->|"syncs events"| node_calendar
node_auth_controller -->|"reads and writes"| node_mongo
node_notes_api -->|"reads and writes"| node_mongo
node_notebooks_api -->|"reads and writes"| node_mongo
node_pages_api -->|"reads and writes"| node_mongo
node_tasks_api -->|"reads and writes"| node_mongo
node_reminders_api -->|"reads and writes"| node_mongo
node_ai_api -->|"reads user settings"| node_mongo
node_ai_api -->|"generates text"| node_gemini
node_search_api -->|"searches records"| node_mongo
node_notifications_api -->|"stores subscriptions"| node_mongo
node_notifications_api -->|"dispatches push"| node_push_config
node_push_config -->|"sends alerts"| node_push
node_server -->|"starts jobs"| node_workers
node_workers -->|"maintains records"| node_mongo

click node_app "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/App.jsx"
click node_notes "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/NotesPage.jsx"
click node_notebooks "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/NotebookWorkspace.jsx"
click node_tasks "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/TasksPage.jsx"
click node_reminders "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/RemindersPage.jsx"
click node_dashboard "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/Dashboard.jsx"
click node_settings "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/SettingsPage.jsx"
click node_trash "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/TrashBinPage.jsx"
click node_api_client "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/services/api.js"
click node_auth_state "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/context/AuthContext.jsx"
click node_server "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/server.js"
click node_auth_routes "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/routes/authRoutes.js"
click node_auth_controller "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/authController.js"
click node_notes_api "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/noteController.js"
click node_notebooks_api "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/notebookController.js"
click node_pages_api "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/pageController.js"
click node_tasks_api "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/taskController.js"
click node_reminders_api "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/reminderController.js"
click node_ai_api "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/aiController.js"
click node_search_api "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/searchController.js"
click node_notifications_api "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/notificationController.js"
click node_workers "https://github.com/shashankshekhar1672007-oss/cubicnotes/tree/main/backend/workers"
click node_login "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/Login.jsx"
click node_auth_middleware "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/middleware/authMiddleware.js"
click node_calendar_helper "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/utils/googleCalendar.js"
click node_email_helper "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/utils/sendEmail.js"
click node_push_config "https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/config/webPush.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_notes,node_notebooks,node_tasks,node_reminders,node_dashboard,node_settings,node_trash,node_api_client,node_auth_state,node_login,node_person,node_push toneBlue
class node_notes_api,node_notebooks_api,node_pages_api,node_search_api,node_mongo toneAmber
class node_tasks_api,node_reminders_api,node_ai_api,node_notifications_api,node_calendar_helper,node_push_config,node_gemini toneMint
class node_auth_routes,node_auth_controller,node_auth_middleware,node_email_helper toneRose
class node_server,node_workers,node_calendar,node_email toneIndigo
```

## Components

### Workspace client

- [React app](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Notes view](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/NotesPage.jsx): `frontend/src/pages/NotesPage.jsx`
- [Notebook workspace](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/NotebookWorkspace.jsx): `frontend/src/pages/NotebookWorkspace.jsx`
- [Tasks view](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/TasksPage.jsx): `frontend/src/pages/TasksPage.jsx`
- [Reminders view](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/RemindersPage.jsx): `frontend/src/pages/RemindersPage.jsx`
- [Dashboard](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Settings view](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/SettingsPage.jsx): `frontend/src/pages/SettingsPage.jsx`
- [Trash view](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/TrashBinPage.jsx): `frontend/src/pages/TrashBinPage.jsx`
- [API client](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Auth and guest state](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Login view](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`

### Knowledge workspace

- [Notes and pages API](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/noteController.js): `backend/controllers/noteController.js`
- [Notebook API](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/notebookController.js): `backend/controllers/notebookController.js`
- [Document pages API](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/pageController.js): `backend/controllers/pageController.js`
- [Search API](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/searchController.js): `backend/controllers/searchController.js`

### Productivity services

- [Task API](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/taskController.js): `backend/controllers/taskController.js`
- [Reminder API](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/reminderController.js): `backend/controllers/reminderController.js`
- [Gemini assistant](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/aiController.js): `backend/controllers/aiController.js`
- [Notifications API](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/notificationController.js): `backend/controllers/notificationController.js`
- [Calendar integration](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/utils/googleCalendar.js): `backend/utils/googleCalendar.js`
- [Push configuration](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/config/webPush.js): `backend/config/webPush.js`

### Identity and access

- [Auth routes](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Authentication](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Auth guard](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`
- [Email sender](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/utils/sendEmail.js): `backend/utils/sendEmail.js`

### Backend foundation

- [Express server](https://github.com/shashankshekhar1672007-oss/cubicnotes/blob/main/backend/server.js): `backend/server.js`
- [Scheduled jobs](https://github.com/shashankshekhar1672007-oss/cubicnotes/tree/main/backend/workers): `backend/workers`

### Other components

- **User**
- **MongoDB**
- **Gemini API**
- **Google Calendar**
- **Email delivery**
- **Browser push**

## Connections

- User → React app: uses
- React app → Notes view: routes to
- React app → Notebook workspace: routes to
- React app → Tasks view: routes to
- React app → Reminders view: routes to
- React app → Dashboard: routes to
- React app → Settings view: routes to
- React app → Trash view: routes to
- React app → Login view: routes to
- Login view → Auth and guest state: updates session
- Notes view → API client: requests data
- Notebook workspace → API client: requests data
- Tasks view → API client: requests data
- Reminders view → API client: requests data
- Dashboard → API client: requests data
- Settings view → API client: requests data
- Trash view → API client: requests data
- API client → Express server: HTTP requests
- Express server → Auth routes: mounts routes
- Express server → Notes and pages API: mounts routes
- Express server → Notebook API: mounts routes
- Express server → Document pages API: mounts routes
- Express server → Task API: mounts routes
- Express server → Reminder API: mounts routes
- Express server → Gemini assistant: mounts routes
- Express server → Search API: mounts routes
- Express server → Notifications API: mounts routes
- Auth routes → Auth guard: protects routes
- Auth routes → Authentication: dispatches
- Authentication → Email sender: sends OTP
- Email sender → Email delivery: delivers mail
- Authentication → Calendar integration: starts OAuth
- Calendar integration → Google Calendar: syncs events
- Authentication → MongoDB: reads and writes
- Notes and pages API → MongoDB: reads and writes
- Notebook API → MongoDB: reads and writes
- Document pages API → MongoDB: reads and writes
- Task API → MongoDB: reads and writes
- Reminder API → MongoDB: reads and writes
- Gemini assistant → MongoDB: reads user settings
- Gemini assistant → Gemini API: generates text
- Search API → MongoDB: searches records
- Notifications API → MongoDB: stores subscriptions
- Notifications API → Push configuration: dispatches push
- Push configuration → Browser push: sends alerts
- Express server → Scheduled jobs: starts jobs
- Scheduled jobs → MongoDB: maintains records
