How sarwpati/note-hub works
NoteHub is a full-stack personal notes workspace. Users register or log in, then browse, search, create, edit, pin, archive, restore, and delete their notes; settings support profile and password updates. The client routes pages and keeps session state, service modules call the Express API, and backend routes dispatch through validation and authentication to controllers and MongoDB models. The README documents capabilities beyond the sampled excerpts; those subsystems are represented at their page or directory paths, with only documented or excerpt-supported links.
Main entry points: App.jsx Application routes · auth.routes.js Auth routes · note.routes.js Notes routes · DashboardPage.jsx Notes dashboard
Components 26
Client experience
- Application routes
client/src/App.jsx - Sign in and register
client/src/pages - Notes dashboard
client/src/pages/DashboardPage.jsx - Note detail
client/src/pages/NoteDetailPage.jsx - Archive view
client/src/pages/ArchivePage.jsx - Account settings
client/src/pages/SettingsPage.jsx - Navigation layout
client/src/components/layout - Note cards
client/src/components/notes/NoteCard.jsx
Client state and API
- Session state
client/src/context/AuthContext.jsx - Confirm dialogs
client/src/context/ConfirmContext.jsx - Theme state
client/src/context/ThemeContext.jsx - Auth service
client/src/services/authService.js - Notes service
client/src/services/noteService.js - HTTP client
client/src/services/api.js
API and security
- Express API
server/src/app.js - Auth routes
server/src/routes/auth.routes.js - Notes routes
server/src/routes/note.routes.js - Request validation
server/src/middleware/validate.middleware.js - Request schemas
server/src/validators - Session protection
server/src/middleware/auth.middleware.js
Domain and persistence
- Account operations
server/src/controllers/auth.controller.js - Note operations
server/src/controllers/note.controller.js - User records
server/src/models/User.js - Note records
server/src/models/Note.js
Other components
- User
- MongoDB
Connections 33
- User → Application routes: uses
README.md - Application routes → Sign in and register: routes
client/src/App.jsx - Application routes → Notes dashboard: routes
client/src/App.jsx - Application routes → Note detail: routes
client/src/App.jsx - Application routes → Archive view: routes
client/src/App.jsx - Application routes → Account settings: routes
client/src/App.jsx - Application routes → Session state: provides
client/src/App.jsx - Application routes → Theme state: provides
client/src/App.jsx - Session state → Auth service: calls
client/src/context/AuthContext.jsx - Auth service → HTTP client: requests
client/src/services/authService.js - Notes dashboard → Notes service: requests
client/src/pages/DashboardPage.jsx - Note detail → Notes service: requests
client/src/pages/NoteDetailPage.jsx - Archive view → Notes service: requests
client/src/pages/ArchivePage.jsx - Account settings → Auth service: requests
client/src/pages/SettingsPage.jsx - Notes dashboard → Navigation layout: renders
client/src/pages/DashboardPage.jsx - Notes dashboard → Note cards: renders
client/src/pages/DashboardPage.jsx - Archive view → Navigation layout: renders
client/src/pages/ArchivePage.jsx - Express API → Auth routes: mounts
server/src/app.js - Express API → Notes routes: mounts
server/src/app.js - Auth routes → Request validation: validates
server/src/routes/auth.routes.js - Notes routes → Request validation: validates
server/src/routes/note.routes.js - Auth routes → Request schemas: uses schemas
server/src/routes/auth.routes.js - Notes routes → Request schemas: uses schemas
server/src/routes/note.routes.js - Auth routes → Account operations: dispatches
server/src/routes/auth.routes.js - Notes routes → Note operations: dispatches
server/src/routes/note.routes.js - Auth routes → Session protection: protects
server/src/routes/auth.routes.js - Notes routes → Session protection: protects
server/src/routes/note.routes.js - Account operations → User records: reads and writes
server/src/controllers/auth.controller.js - Note operations → Note records: reads and writes
server/src/controllers/note.controller.js - Session protection → User records: loads user
server/src/middleware/auth.middleware.js - User records → MongoDB: persists
README.md - Note records → MongoDB: persists
README.md - HTTP client → Express API: API requests
README.md