# sanjay-sahoo-0804/inotebook architecture

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

- Interactive diagram: https://gitdiagram.com/sanjay-sahoo-0804/inotebook
- Repository: https://github.com/sanjay-sahoo-0804/inotebook

## Overview

iNotebook is a web notebook with account registration and login, plus authenticated, user-owned notes that can be listed, added, edited, and deleted. The client provides routed pages and a notes context that makes requests to the backend; Express routes authenticate requests and use Mongoose models backed by MongoDB. The sampled sources confirm the app shell, notes workflow, API routes, and persistence structure. Authentication-page wiring and some component relationships are not shown in the excerpts, so those links are omitted.

Main entry points: [`client/src/App.jsx`](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/App.jsx) (Routed app), [`backend/routes/notes.js`](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/routes/notes.js) (Note routes), [`client/src/components/Notes.jsx`](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Notes.jsx) (Notes view), [`backend/index.js`](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/index.js) (Express server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client_ui["Client interface"]
  node_app["Routed app<br/>[App.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_about["About page<br/>[About.jsx]"]
  node_login["Login page<br/>[Login.jsx]"]
  node_signup["Signup page<br/>[Signup.jsx]"]
  node_alert["Alert display<br/>[Alert.jsx]"]
  node_notes_ui["Notes view<br/>[Notes.jsx]"]
  node_add_note["Add note form<br/>[AddNote.jsx]"]
  node_note_item["Note item<br/>[Noteitem.jsx]"]
end

subgraph group_client_state["Client state and API"]
  node_note_state["Notes state and API<br/>[NoteState.jsx]"]
  node_note_context["Notes context<br/>[noteContext.jsx]"]
end

subgraph group_backend["Backend services"]
  node_server["Express server<br/>[index.js]"]
  node_auth_routes["Account routes<br/>[auth.js]"]
  node_note_routes["Note routes<br/>[notes.js]"]
  node_auth_middleware["JWT middleware<br/>[fetchuser.js]"]
end

subgraph group_persistence["Persistence"]
  node_db_connection["Mongo connection<br/>[db.js]"]
  node_user_model["User model<br/>[User.js]"]
  node_note_model["Note model<br/>[Note.js]"]
end

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

node_user -->|"uses"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_alert
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_about
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_signup
node_app -->|"wraps"| node_note_state
node_notes_ui -->|"reads"| node_note_context
node_notes_ui -->|"renders"| node_add_note
node_notes_ui -->|"renders"| node_note_item
node_note_state -->|"provides"| node_note_context
node_note_state -->|"requests notes"| node_note_routes
node_server -->|"connects"| node_db_connection
node_server -->|"mounts routes"| node_auth_routes
node_server -->|"mounts routes"| node_note_routes
node_auth_routes -->|"queries"| node_user_model
node_auth_routes -->|"uses"| node_auth_middleware
node_note_routes -->|"authenticates"| node_auth_middleware
node_note_routes -->|"queries and writes"| node_note_model
node_db_connection -->|"connects"| node_mongodb
node_user_model -->|"stores users"| node_mongodb
node_note_model -->|"stores notes"| node_mongodb

click node_app "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/App.jsx"
click node_navbar "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Navbar.jsx"
click node_home "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Home.jsx"
click node_about "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/About.jsx"
click node_login "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Login.jsx"
click node_signup "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Signup.jsx"
click node_alert "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Alert.jsx"
click node_notes_ui "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Notes.jsx"
click node_add_note "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/AddNote.jsx"
click node_note_item "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Noteitem.jsx"
click node_note_state "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/context/notes/NoteState.jsx"
click node_note_context "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/context/notes/noteContext.jsx"
click node_server "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/index.js"
click node_auth_routes "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/routes/auth.js"
click node_note_routes "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/routes/notes.js"
click node_auth_middleware "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/middleware/fetchuser.js"
click node_db_connection "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/db.js"
click node_user_model "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/models/User.js"
click node_note_model "https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/models/Note.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_navbar,node_home,node_about,node_login,node_signup,node_alert,node_notes_ui,node_add_note,node_note_item,node_user toneBlue
class node_note_state,node_note_context,node_mongodb toneAmber
class node_server,node_auth_routes,node_note_routes,node_auth_middleware toneMint
class node_db_connection,node_user_model,node_note_model toneRose
```

## Components

### Client interface

- [Routed app](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Navigation](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Navbar.jsx): `client/src/components/Navbar.jsx`
- [Home page](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Home.jsx): `client/src/components/Home.jsx`
- [About page](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/About.jsx): `client/src/components/About.jsx`
- [Login page](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Login.jsx): `client/src/components/Login.jsx`
- [Signup page](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Signup.jsx): `client/src/components/Signup.jsx`
- [Alert display](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Alert.jsx): `client/src/components/Alert.jsx`
- [Notes view](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Notes.jsx): `client/src/components/Notes.jsx`
- [Add note form](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/AddNote.jsx): `client/src/components/AddNote.jsx`
- [Note item](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/components/Noteitem.jsx): `client/src/components/Noteitem.jsx`

### Client state and API

- [Notes state and API](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/context/notes/NoteState.jsx): `client/src/context/notes/NoteState.jsx`
- [Notes context](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/client/src/context/notes/noteContext.jsx): `client/src/context/notes/noteContext.jsx`

### Backend services

- [Express server](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/index.js): `backend/index.js`
- [Account routes](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Note routes](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/routes/notes.js): `backend/routes/notes.js`
- [JWT middleware](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/middleware/fetchuser.js): `backend/middleware/fetchuser.js`

### Persistence

- [Mongo connection](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/db.js): `backend/db.js`
- [User model](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/models/User.js): `backend/models/User.js`
- [Note model](https://github.com/sanjay-sahoo-0804/inotebook/blob/main/backend/models/Note.js): `backend/models/Note.js`

### Other components

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

## Connections

- User → Routed app: uses
- Routed app → Navigation: renders
- Routed app → Alert display: renders
- Routed app → Home page: routes to
- Routed app → About page: routes to
- Routed app → Login page: routes to
- Routed app → Signup page: routes to
- Routed app → Notes state and API: wraps
- Notes view → Notes context: reads
- Notes view → Add note form: renders
- Notes view → Note item: renders
- Notes state and API → Notes context: provides
- Notes state and API → Note routes: requests notes
- Express server → Mongo connection: connects
- Express server → Account routes: mounts routes
- Express server → Note routes: mounts routes
- Account routes → User model: queries
- Account routes → JWT middleware: uses
- Note routes → JWT middleware: authenticates
- Note routes → Note model: queries and writes
- Mongo connection → MongoDB: connects
- User model → MongoDB: stores users
- Note model → MongoDB: stores notes
