# praveenbanot/blog-application architecture

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

- Interactive diagram: https://gitdiagram.com/praveenbanot/blog-application
- Repository: https://github.com/praveenbanot/blog-application

## Overview

Blog Market is a full-stack blogging application. Readers browse and search posts, open details, and comment; signed-in users can create, edit, and delete posts, and view profiles and their own posts. The frontend routes these experiences and maintains a refetched user session, while the Express backend exposes authentication, user, post, and comment routes backed by MongoDB models. The excerpts show post-detail and session API calls; other page-to-API links are not verified here, so those connections are omitted.

Main entry points: [`Blog_app-master/frontend/src/App.jsx`](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/App.jsx) (Route application), [`Blog_app-master/backend/routes/comments.js`](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/routes/comments.js) (Comment routes), [`Blog_app-master/backend/routes/posts.js`](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/routes/posts.js) (Post routes), [`Blog_app-master/backend/index.js`](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/index.js) (API server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["Route application<br/>[App.jsx]"]
  node_home["Home and search<br/>[Home.jsx]"]
  node_homeposts["Post listings<br/>[HomePosts.jsx]"]
  node_details["Post details<br/>[PostDetails.jsx]"]
  node_commentui["Comment display<br/>[Comment.jsx]"]
  node_create["Create post<br/>[CreatePost.jsx]"]
  node_edit["Edit post<br/>[EditPost.jsx]"]
  node_myblogs["Author posts<br/>[MyBlogs.jsx]"]
  node_profile["User profile<br/>[Profile.jsx]"]
  node_profileposts["Profile listings<br/>[ProfilePosts.jsx]"]
  node_url["API and image URLs<br/>[url.js]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
  node_menu["User menu<br/>[Menu.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
  node_loader["Loading indicator<br/>[Loader.jsx]"]
end

subgraph group_identity["Identity"]
  node_login["Login<br/>[Login.jsx]"]
  node_register["Registration<br/>[Register.jsx]"]
  node_usercontext["Session context<br/>[UserContext.jsx]"]
  node_authroute["Authentication routes<br/>[auth.js]"]
  node_token["Token verification<br/>[verifyToken.js]"]
end

subgraph group_content["Posts and comments"]
  node_postsroute["Post routes<br/>[posts.js]"]
  node_commentsroute["Comment routes<br/>[comments.js]"]
  node_post[("Post records<br/>[Post.js]")]
  node_comment[("Comment records<br/>[Comment.js]")]
end

subgraph group_persistence["Backend and data"]
  node_server["API server<br/>[index.js]"]
  node_usersroute["User routes<br/>[users.js]"]
  node_user[("User records<br/>[User.js]")]
end

node_reader(("Reader or author"))

node_reader -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_details
node_app -->|"routes to"| node_create
node_app -->|"routes to"| node_edit
node_app -->|"routes to"| node_myblogs
node_app -->|"routes to"| node_profile
node_app -->|"provides session"| node_usercontext
node_home -->|"renders"| node_homeposts
node_myblogs -->|"renders"| node_homeposts
node_profile -->|"renders"| node_profileposts
node_details -->|"renders"| node_commentui
node_navbar -->|"renders"| node_menu
node_usercontext -->|"refetches session"| node_authroute
node_details -->|"fetches and deletes"| node_postsroute
node_details -->|"fetches and adds"| node_commentsroute
node_authroute -->|"reads and writes"| node_user
node_postsroute -->|"reads and writes"| node_post
node_postsroute -->|"deletes comments"| node_comment
node_commentsroute -->|"uses records"| node_comment
node_commentsroute -->|"uses records"| node_post
node_commentsroute -->|"uses records"| node_user
node_postsroute -->|"guards mutations"| node_token
node_commentsroute -->|"checks access"| node_token
node_server -->|"mounts routes"| node_authroute
node_server -->|"mounts routes"| node_usersroute
node_server -->|"mounts routes"| node_postsroute
node_server -->|"mounts routes"| node_commentsroute

click node_app "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/App.jsx"
click node_home "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/Home.jsx"
click node_homeposts "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/HomePosts.jsx"
click node_details "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/PostDetails.jsx"
click node_commentui "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/Comment.jsx"
click node_create "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/CreatePost.jsx"
click node_edit "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/EditPost.jsx"
click node_myblogs "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/MyBlogs.jsx"
click node_profile "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/Profile.jsx"
click node_profileposts "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/ProfilePosts.jsx"
click node_login "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/Login.jsx"
click node_register "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/Register.jsx"
click node_usercontext "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/context/UserContext.jsx"
click node_authroute "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/routes/auth.js"
click node_token "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/verifyToken.js"
click node_server "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/index.js"
click node_usersroute "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/routes/users.js"
click node_postsroute "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/routes/posts.js"
click node_commentsroute "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/routes/comments.js"
click node_user "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/models/User.js"
click node_post "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/models/Post.js"
click node_comment "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/models/Comment.js"
click node_url "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/url.js"
click node_navbar "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/Navbar.jsx"
click node_menu "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/Menu.jsx"
click node_footer "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/Footer.jsx"
click node_loader "https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/Loader.jsx"

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_home,node_homeposts,node_details,node_commentui,node_create,node_edit,node_myblogs,node_profile,node_profileposts,node_url,node_navbar,node_menu,node_footer,node_loader toneBlue
class node_login,node_register,node_usercontext,node_authroute,node_token toneAmber
class node_postsroute,node_commentsroute,node_post,node_comment toneMint
class node_server,node_usersroute,node_user toneRose
class node_reader toneIndigo
```

## Components

### Frontend experience

- [Route application](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/App.jsx): `Blog_app-master/frontend/src/App.jsx`
- [Home and search](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/Home.jsx): `Blog_app-master/frontend/src/pages/Home.jsx`
- [Post listings](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/HomePosts.jsx): `Blog_app-master/frontend/src/components/HomePosts.jsx`
- [Post details](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/PostDetails.jsx): `Blog_app-master/frontend/src/pages/PostDetails.jsx`
- [Comment display](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/Comment.jsx): `Blog_app-master/frontend/src/components/Comment.jsx`
- [Create post](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/CreatePost.jsx): `Blog_app-master/frontend/src/pages/CreatePost.jsx`
- [Edit post](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/EditPost.jsx): `Blog_app-master/frontend/src/pages/EditPost.jsx`
- [Author posts](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/MyBlogs.jsx): `Blog_app-master/frontend/src/pages/MyBlogs.jsx`
- [User profile](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/Profile.jsx): `Blog_app-master/frontend/src/pages/Profile.jsx`
- [Profile listings](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/ProfilePosts.jsx): `Blog_app-master/frontend/src/components/ProfilePosts.jsx`
- [API and image URLs](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/url.js): `Blog_app-master/frontend/src/url.js`
- [Navigation bar](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/Navbar.jsx): `Blog_app-master/frontend/src/components/Navbar.jsx`
- [User menu](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/Menu.jsx): `Blog_app-master/frontend/src/components/Menu.jsx`
- [Footer](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/Footer.jsx): `Blog_app-master/frontend/src/components/Footer.jsx`
- [Loading indicator](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/components/Loader.jsx): `Blog_app-master/frontend/src/components/Loader.jsx`

### Identity

- [Login](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/Login.jsx): `Blog_app-master/frontend/src/pages/Login.jsx`
- [Registration](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/pages/Register.jsx): `Blog_app-master/frontend/src/pages/Register.jsx`
- [Session context](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/frontend/src/context/UserContext.jsx): `Blog_app-master/frontend/src/context/UserContext.jsx`
- [Authentication routes](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/routes/auth.js): `Blog_app-master/backend/routes/auth.js`
- [Token verification](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/verifyToken.js): `Blog_app-master/backend/verifyToken.js`

### Posts and comments

- [Post routes](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/routes/posts.js): `Blog_app-master/backend/routes/posts.js`
- [Comment routes](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/routes/comments.js): `Blog_app-master/backend/routes/comments.js`
- [Post records](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/models/Post.js): `Blog_app-master/backend/models/Post.js`
- [Comment records](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/models/Comment.js): `Blog_app-master/backend/models/Comment.js`

### Backend and data

- [API server](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/index.js): `Blog_app-master/backend/index.js`
- [User routes](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/routes/users.js): `Blog_app-master/backend/routes/users.js`
- [User records](https://github.com/praveenbanot/blog-application/blob/main/Blog_app-master/backend/models/User.js): `Blog_app-master/backend/models/User.js`

### Other components

- **Reader or author**

## Connections

- Reader or author → Route application: uses
- Route application → Home and search: routes to (evidence: `Blog_app-master/frontend/src/App.jsx`)
- Route application → Login: routes to (evidence: `Blog_app-master/frontend/src/App.jsx`)
- Route application → Registration: routes to (evidence: `Blog_app-master/frontend/src/App.jsx`)
- Route application → Post details: routes to (evidence: `Blog_app-master/frontend/src/App.jsx`)
- Route application → Create post: routes to (evidence: `Blog_app-master/frontend/src/App.jsx`)
- Route application → Edit post: routes to (evidence: `Blog_app-master/frontend/src/App.jsx`)
- Route application → Author posts: routes to (evidence: `Blog_app-master/frontend/src/App.jsx`)
- Route application → User profile: routes to (evidence: `Blog_app-master/frontend/src/App.jsx`)
- Route application → Session context: provides session (evidence: `Blog_app-master/frontend/src/App.jsx`)
- Home and search → Post listings: renders (evidence: `Blog_app-master/frontend/src/pages/Home.jsx`)
- Author posts → Post listings: renders (evidence: `Blog_app-master/frontend/src/pages/MyBlogs.jsx`)
- User profile → Profile listings: renders (evidence: `Blog_app-master/frontend/src/pages/Profile.jsx`)
- Post details → Comment display: renders (evidence: `Blog_app-master/frontend/src/pages/PostDetails.jsx`)
- Navigation bar → User menu: renders (evidence: `Blog_app-master/frontend/src/components/Navbar.jsx`)
- Session context → Authentication routes: refetches session (evidence: `Blog_app-master/frontend/src/context/UserContext.jsx`)
- Post details → Post routes: fetches and deletes (evidence: `Blog_app-master/frontend/src/pages/PostDetails.jsx`)
- Post details → Comment routes: fetches and adds (evidence: `Blog_app-master/frontend/src/pages/PostDetails.jsx`)
- Authentication routes → User records: reads and writes (evidence: `Blog_app-master/backend/routes/auth.js`)
- Post routes → Post records: reads and writes (evidence: `Blog_app-master/backend/routes/posts.js`)
- Post routes → Comment records: deletes comments (evidence: `Blog_app-master/backend/routes/posts.js`)
- Comment routes → Comment records: uses records (evidence: `Blog_app-master/backend/routes/comments.js`)
- Comment routes → Post records: uses records (evidence: `Blog_app-master/backend/routes/comments.js`)
- Comment routes → User records: uses records (evidence: `Blog_app-master/backend/routes/comments.js`)
- Post routes → Token verification: guards mutations (evidence: `Blog_app-master/backend/routes/posts.js`)
- Comment routes → Token verification: checks access (evidence: `Blog_app-master/backend/routes/comments.js`)
- API server → Authentication routes: mounts routes (evidence: `Blog_app-master/backend/index.js`)
- API server → User routes: mounts routes (evidence: `Blog_app-master/backend/index.js`)
- API server → Post routes: mounts routes (evidence: `Blog_app-master/backend/index.js`)
- API server → Comment routes: mounts routes (evidence: `Blog_app-master/backend/index.js`)
