# rohitsingh93300/mern-blog architecture

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

- Interactive diagram: https://gitdiagram.com/rohitsingh93300/mern-blog
- Repository: https://github.com/rohitsingh93300/mern-blog

## Overview

This is a MERN blogging application: readers browse and search published posts, while signed-in users manage profiles, publish and edit blogs, and discuss them through comments. The backend exposes user, blog, and comment APIs, with Mongo-backed models and Cloudinary image handling. The graph includes the documented-by-source-index frontend route surface, but frontend API calls are not shown in the excerpts, so those links are omitted; unsampled route wiring is supported only where the source index names it.

Main entry points: [`frontend/src/App.jsx`](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/App.jsx) (Route application), [`backend/controllers/blog.controller.js`](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/controllers/blog.controller.js) (Blog operations), [`backend/server.js`](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/server.js) (Express server), [`backend/routes/user.route.js`](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/routes/user.route.js) (User routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Route application<br/>[App.jsx]"]
  node_state["Redux store<br/>[Store.js]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_responsive["Responsive menu<br/>[ResponsiveMenu.jsx]"]
  node_home["Home and discovery<br/>[Home.jsx]"]
  node_blogpages["Blog browsing<br/>[Blog.jsx]"]
  node_blogview["Blog detail<br/>[BlogView.jsx]"]
  node_search["Search results<br/>[SearchList.jsx]"]
  node_create["Create blog<br/>[CreateBlog.jsx]"]
  node_update["Edit blog<br/>[UpdateBlog.jsx]"]
  node_yourblogs["Author blogs<br/>[YourBlog.jsx]"]
  node_commentsview["Comment management<br/>[Comments.jsx]"]
  node_profile["Profile<br/>[Profile.jsx]"]
  node_login["Sign in<br/>[Login.jsx]"]
  node_signup["Registration<br/>[Signup.jsx]"]
end

subgraph group_api["API routing"]
  node_server["Express server<br/>[server.js]"]
  node_userroute["User routes<br/>[user.route.js]"]
  node_blogroute["Blog routes<br/>[blog.route.js]"]
  node_commentroute["Comment routes<br/>[comment.route.js]"]
  node_mongo[("MongoDB connection<br/>[db.js]")]
end

subgraph group_content["Blog and discussion"]
  node_blogcontroller["Blog operations<br/>[blog.controller.js]"]
  node_blogstore[("Blog records<br/>[blog.model.js]")]
  node_commentcontroller["Comment operations"]
  node_commentstore[("Comment records<br/>[comment.model.js]")]
end

subgraph group_identity["Identity and media"]
  node_auth["JWT authentication<br/>[isAuthenticated.js]"]
  node_upload["File upload<br/>[multer.js]"]
  node_usercontroller["User operations<br/>[user.controller.js]"]
  node_userstore[("User records<br/>[user.model.js]")]
  node_cloudinary["Image hosting<br/>[cloudinary.js]"]
  node_datauri["Image data conversion<br/>[dataUri.js]"]
end

node_visitor(("Reader or author"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_blogpages
node_app -->|"routes to"| node_blogview
node_app -->|"routes to"| node_search
node_app -->|"routes to"| node_create
node_app -->|"routes to"| node_update
node_app -->|"routes to"| node_yourblogs
node_app -->|"routes to"| node_commentsview
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_signup
node_app -->|"renders"| node_navbar
node_navbar -->|"uses"| node_responsive
node_server -->|"connects"| node_mongo
node_server -->|"mounts"| node_userroute
node_server -->|"mounts"| node_blogroute
node_server -->|"mounts"| node_commentroute
node_userroute -->|"dispatches"| node_usercontroller
node_blogroute -->|"dispatches"| node_blogcontroller
node_commentroute -->|"dispatches"| node_commentcontroller
node_userroute -->|"guards"| node_auth
node_blogroute -->|"guards"| node_auth
node_commentroute -->|"guards"| node_auth
node_blogroute -->|"uploads"| node_upload
node_userroute -->|"uploads"| node_upload
node_usercontroller -->|"reads and writes"| node_userstore
node_blogcontroller -->|"reads and writes"| node_blogstore
node_blogcontroller -->|"deletes related"| node_commentstore
node_commentcontroller -->|"reads and writes"| node_commentstore
node_commentcontroller -->|"updates references"| node_blogstore
node_blogcontroller -->|"uploads images"| node_cloudinary
node_blogcontroller -->|"converts uploads"| node_datauri
node_usercontroller -->|"uploads images"| node_cloudinary
node_usercontroller -->|"converts uploads"| node_datauri

click node_app "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/App.jsx"
click node_state "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/redux/Store.js"
click node_navbar "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/components/Navbar.jsx"
click node_responsive "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/components/ResponsiveMenu.jsx"
click node_home "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/Home.jsx"
click node_blogpages "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/Blog.jsx"
click node_blogview "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/BlogView.jsx"
click node_search "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/SearchList.jsx"
click node_create "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/CreateBlog.jsx"
click node_update "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/UpdateBlog.jsx"
click node_yourblogs "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/YourBlog.jsx"
click node_commentsview "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/Comments.jsx"
click node_profile "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/Profile.jsx"
click node_login "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/Login.jsx"
click node_signup "https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/Signup.jsx"
click node_server "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/server.js"
click node_userroute "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/routes/user.route.js"
click node_blogroute "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/routes/blog.route.js"
click node_commentroute "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/routes/comment.route.js"
click node_auth "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/middleware/isAuthenticated.js"
click node_upload "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/middleware/multer.js"
click node_usercontroller "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/controllers/user.controller.js"
click node_userstore "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/models/user.model.js"
click node_blogcontroller "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/controllers/blog.controller.js"
click node_blogstore "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/models/blog.model.js"
click node_commentcontroller "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/controllers/comment.controller.js"
click node_commentstore "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/models/comment.model.js"
click node_cloudinary "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/utils/cloudinary.js"
click node_datauri "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/utils/dataUri.js"
click node_mongo "https://github.com/rohitsingh93300/mern-blog/blob/main/backend/database/db.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_state,node_navbar,node_responsive,node_home,node_blogpages,node_blogview,node_search,node_create,node_update,node_yourblogs,node_commentsview,node_profile,node_login,node_signup toneBlue
class node_server,node_userroute,node_blogroute,node_commentroute,node_mongo toneAmber
class node_blogcontroller,node_blogstore,node_commentcontroller,node_commentstore toneMint
class node_auth,node_upload,node_usercontroller,node_userstore,node_cloudinary,node_datauri toneRose
class node_visitor toneIndigo
```

## Components

### Web application

- [Route application](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Redux store](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/redux/Store.js): `frontend/src/redux/Store.js`
- [Navigation](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Responsive menu](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/components/ResponsiveMenu.jsx): `frontend/src/components/ResponsiveMenu.jsx`
- [Home and discovery](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Blog browsing](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/Blog.jsx): `frontend/src/pages/Blog.jsx`
- [Blog detail](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/BlogView.jsx): `frontend/src/pages/BlogView.jsx`
- [Search results](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/SearchList.jsx): `frontend/src/pages/SearchList.jsx`
- [Create blog](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/CreateBlog.jsx): `frontend/src/pages/CreateBlog.jsx`
- [Edit blog](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/UpdateBlog.jsx): `frontend/src/pages/UpdateBlog.jsx`
- [Author blogs](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/YourBlog.jsx): `frontend/src/pages/YourBlog.jsx`
- [Comment management](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/Comments.jsx): `frontend/src/pages/Comments.jsx`
- [Profile](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/Profile.jsx): `frontend/src/pages/Profile.jsx`
- [Sign in](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Registration](https://github.com/rohitsingh93300/mern-blog/blob/main/frontend/src/pages/Signup.jsx): `frontend/src/pages/Signup.jsx`

### API routing

- [Express server](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/server.js): `backend/server.js`
- [User routes](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/routes/user.route.js): `backend/routes/user.route.js`
- [Blog routes](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/routes/blog.route.js): `backend/routes/blog.route.js`
- [Comment routes](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/routes/comment.route.js): `backend/routes/comment.route.js`
- [MongoDB connection](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/database/db.js): `backend/database/db.js`

### Blog and discussion

- [Blog operations](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/controllers/blog.controller.js): `backend/controllers/blog.controller.js`
- [Blog records](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/models/blog.model.js): `backend/models/blog.model.js`
- [Comment operations](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/controllers/comment.controller.js): `backend/controllers/comment.controller.js`
- [Comment records](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/models/comment.model.js): `backend/models/comment.model.js`

### Identity and media

- [JWT authentication](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/middleware/isAuthenticated.js): `backend/middleware/isAuthenticated.js`
- [File upload](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/middleware/multer.js): `backend/middleware/multer.js`
- [User operations](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/controllers/user.controller.js): `backend/controllers/user.controller.js`
- [User records](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/models/user.model.js): `backend/models/user.model.js`
- [Image hosting](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/utils/cloudinary.js): `backend/utils/cloudinary.js`
- [Image data conversion](https://github.com/rohitsingh93300/mern-blog/blob/main/backend/utils/dataUri.js): `backend/utils/dataUri.js`

### Other components

- **Reader or author**

## Connections

- Reader or author → Route application: opens (evidence: `frontend/src/App.jsx`)
- Route application → Home and discovery: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Blog browsing: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Blog detail: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Search results: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Create blog: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Edit blog: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Author blogs: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Comment management: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Profile: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Sign in: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Registration: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Navigation: renders (evidence: `frontend/src/App.jsx`)
- Navigation → Responsive menu: uses (evidence: `frontend/src/components/Navbar.jsx`)
- Express server → MongoDB connection: connects (evidence: `backend/server.js`)
- Express server → User routes: mounts (evidence: `backend/server.js`)
- Express server → Blog routes: mounts (evidence: `backend/server.js`)
- Express server → Comment routes: mounts (evidence: `backend/server.js`)
- User routes → User operations: dispatches (evidence: `backend/routes/user.route.js`)
- Blog routes → Blog operations: dispatches (evidence: `backend/routes/blog.route.js`)
- Comment routes → Comment operations: dispatches (evidence: `backend/routes/comment.route.js`)
- User routes → JWT authentication: guards (evidence: `backend/routes/user.route.js`)
- Blog routes → JWT authentication: guards (evidence: `backend/routes/blog.route.js`)
- Comment routes → JWT authentication: guards (evidence: `backend/routes/comment.route.js`)
- Blog routes → File upload: uploads (evidence: `backend/routes/blog.route.js`)
- User routes → File upload: uploads (evidence: `backend/routes/user.route.js`)
- User operations → User records: reads and writes (evidence: `backend/controllers/user.controller.js`)
- Blog operations → Blog records: reads and writes (evidence: `backend/controllers/blog.controller.js`)
- Blog operations → Comment records: deletes related (evidence: `backend/controllers/blog.controller.js`)
- Comment operations → Comment records: reads and writes (evidence: `backend/controllers/comment.controller.js`)
- Comment operations → Blog records: updates references (evidence: `backend/controllers/comment.controller.js`)
- Blog operations → Image hosting: uploads images (evidence: `backend/controllers/blog.controller.js`)
- Blog operations → Image data conversion: converts uploads (evidence: `backend/controllers/blog.controller.js`)
- User operations → Image hosting: uploads images (evidence: `backend/controllers/user.controller.js`)
- User operations → Image data conversion: converts uploads (evidence: `backend/controllers/user.controller.js`)
