# arunkumar09-06/notesapp-api-backend architecture

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

- Interactive diagram: https://gitdiagram.com/arunkumar09-06/notesapp-api-backend
- Repository: https://github.com/arunkumar09-06/notesapp-api-backend

## Overview

NotesApp is a React notes workspace backed by an Express API and MongoDB. Users register or log in, then manage personal notes through active, pinned, archived, and trash views; note operations are scoped to the authenticated user. The UI routes between authentication and the dashboard, while backend routes dispatch to controllers, which persist through Mongoose models. The README also describes search and tag filtering, though frontend search/tag interactions are only partly sampled. Connections between browser fetches and API routes are documented by the README/API structure; unsampled authentication UI details are not inferred.

Main entry points: [`frontend/src/components/Dashboard.jsx`](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/components/Dashboard.jsx) (Notes dashboard), [`backend/routes/note.js`](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/routes/note.js) (Note routes), [`frontend/src/App.jsx`](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/App.jsx) (App session router), [`backend/routes/user.js`](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/routes/user.js) (User routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React workspace"]
  node_app["App session router<br/>[App.jsx]"]
  node_authui["Auth pages<br/>[AuthPage.jsx]"]
  node_dashboard["Notes dashboard<br/>[Dashboard.jsx]"]
  node_sidebar["Sidebar navigation<br/>[Sidebar.jsx]"]
  node_creator["Note creator<br/>[NoteCreator.jsx]"]
  node_card["Note cards<br/>[NoteCard.jsx]"]
  node_modal["Edit modal<br/>[NoteModal.jsx]"]
end

subgraph group_api["API and auth"]
  node_server["Express server<br/>[index.js]"]
  node_useroutes["User routes<br/>[user.js]"]
  node_noteroutes["Note routes<br/>[note.js]"]
  node_auth["JWT middleware<br/>[auth.js]"]
end

subgraph group_domain["Note operations"]
  node_usercontroller["Account controller<br/>[user.js]"]
  node_notecontroller["Notes controller<br/>[note.js]"]
end

subgraph group_persistence["MongoDB models"]
  node_usermodel["User model<br/>[user.js]"]
  node_notemodel["Note model<br/>[notes.js]"]
  node_mongo[("MongoDB")]
end

node_user(("User"))

node_user -.->|"uses"| node_app
node_app -->|"renders"| node_authui
node_app -->|"renders"| node_dashboard
node_authui -.->|"sends auth requests"| node_useroutes
node_dashboard -->|"fetches notes"| node_noteroutes
node_dashboard -->|"renders"| node_sidebar
node_dashboard -->|"renders"| node_creator
node_dashboard -->|"renders"| node_card
node_dashboard -->|"renders"| node_modal
node_app -->|"posts logout"| node_useroutes
node_server -->|"mounts"| node_useroutes
node_server -->|"mounts"| node_noteroutes
node_server -->|"connects"| node_mongo
node_useroutes -->|"dispatches"| node_usercontroller
node_noteroutes -->|"protects routes"| node_auth
node_noteroutes -->|"dispatches"| node_notecontroller
node_auth -.->|"authorizes"| node_noteroutes
node_usercontroller -->|"queries"| node_usermodel
node_notecontroller -->|"queries"| node_notemodel
node_usermodel -.->|"persists"| node_mongo
node_notemodel -.->|"persists"| node_mongo

click node_app "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/components/AuthPage.jsx"
click node_dashboard "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/components/Dashboard.jsx"
click node_sidebar "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/components/Sidebar.jsx"
click node_creator "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/components/NoteCreator.jsx"
click node_card "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/components/NoteCard.jsx"
click node_modal "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/components/NoteModal.jsx"
click node_server "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/index.js"
click node_useroutes "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/routes/user.js"
click node_noteroutes "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/routes/note.js"
click node_auth "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/middlewares/auth.js"
click node_usercontroller "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/controllers/user.js"
click node_notecontroller "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/controllers/note.js"
click node_usermodel "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/models/user.js"
click node_notemodel "https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/models/notes.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_authui,node_dashboard,node_sidebar,node_creator,node_card,node_modal,node_user toneBlue
class node_server,node_useroutes,node_noteroutes,node_auth toneAmber
class node_usercontroller,node_notecontroller toneMint
class node_usermodel,node_notemodel,node_mongo toneRose
```

## Components

### React workspace

- [App session router](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth pages](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/components/AuthPage.jsx): `frontend/src/components/AuthPage.jsx`
- [Notes dashboard](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/components/Dashboard.jsx): `frontend/src/components/Dashboard.jsx`
- [Sidebar navigation](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/components/Sidebar.jsx): `frontend/src/components/Sidebar.jsx`
- [Note creator](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/components/NoteCreator.jsx): `frontend/src/components/NoteCreator.jsx`
- [Note cards](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/components/NoteCard.jsx): `frontend/src/components/NoteCard.jsx`
- [Edit modal](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/frontend/src/components/NoteModal.jsx): `frontend/src/components/NoteModal.jsx`

### API and auth

- [Express server](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/index.js): `backend/index.js`
- [User routes](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/routes/user.js): `backend/routes/user.js`
- [Note routes](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/routes/note.js): `backend/routes/note.js`
- [JWT middleware](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/middlewares/auth.js): `backend/middlewares/auth.js`

### Note operations

- [Account controller](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/controllers/user.js): `backend/controllers/user.js`
- [Notes controller](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/controllers/note.js): `backend/controllers/note.js`

### MongoDB models

- [User model](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/models/user.js): `backend/models/user.js`
- [Note model](https://github.com/arunkumar09-06/notesapp-api-backend/blob/main/backend/models/notes.js): `backend/models/notes.js`
- **MongoDB**

### Other components

- **User**

## Connections

- User → App session router: uses (evidence: `README.md`)
- App session router → Auth pages: renders (evidence: `frontend/src/App.jsx`)
- App session router → Notes dashboard: renders (evidence: `frontend/src/App.jsx`)
- Auth pages → User routes: sends auth requests (evidence: `README.md`)
- Notes dashboard → Note routes: fetches notes (evidence: `frontend/src/components/Dashboard.jsx`)
- Notes dashboard → Sidebar navigation: renders (evidence: `frontend/src/components/Dashboard.jsx`)
- Notes dashboard → Note creator: renders (evidence: `frontend/src/components/Dashboard.jsx`)
- Notes dashboard → Note cards: renders (evidence: `frontend/src/components/Dashboard.jsx`)
- Notes dashboard → Edit modal: renders (evidence: `frontend/src/components/Dashboard.jsx`)
- App session router → User routes: posts logout (evidence: `frontend/src/App.jsx`)
- Express server → User routes: mounts (evidence: `backend/index.js`)
- Express server → Note routes: mounts (evidence: `backend/index.js`)
- Express server → MongoDB: connects (evidence: `backend/index.js`)
- User routes → Account controller: dispatches (evidence: `backend/routes/user.js`)
- Note routes → JWT middleware: protects routes (evidence: `backend/routes/note.js`)
- Note routes → Notes controller: dispatches (evidence: `backend/routes/note.js`)
- JWT middleware → Note routes: authorizes (evidence: `backend/routes/note.js`)
- Account controller → User model: queries (evidence: `backend/controllers/user.js`)
- Notes controller → Note model: queries (evidence: `backend/controllers/note.js`)
- User model → MongoDB: persists (evidence: `README.md`)
- Note model → MongoDB: persists (evidence: `README.md`)
