# iam-veeramalla/jerney architecture

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

- Interactive diagram: https://gitdiagram.com/iam-veeramalla/jerney
- Repository: https://github.com/iam-veeramalla/jerney

## Overview

Jerney is a React blog platform backed by a Node.js/Express API and PostgreSQL. Readers browse a feed, open posts, and comment; authors can create, edit, and delete posts, while comments can also be deleted. Frontend pages call a shared API client, backend route handlers perform domain operations, and the database module initializes and accesses persistent post and comment data. The README documents the three-tier architecture and API endpoints; frontend-to-backend HTTP wiring is represented at that documented boundary.

Main entry points: [`frontend/src/App.jsx`](https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/App.jsx) (App routing), [`frontend/src/api.js`](https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/api.js) (API client), [`frontend/src/pages/PostDetail.jsx`](https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/pages/PostDetail.jsx) (Post detail), [`backend/src/index.js`](https://github.com/iam-veeramalla/jerney/blob/main/backend/src/index.js) (API server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React frontend"]
  node_app["App routing<br/>[App.jsx]"]
  node_home["Post feed<br/>[Home.jsx]"]
  node_postcard["Post card<br/>[PostCard.jsx]"]
  node_detail["Post detail<br/>[PostDetail.jsx]"]
  node_create["Create post<br/>[CreatePost.jsx]"]
  node_edit["Edit post<br/>[EditPost.jsx]"]
  node_comments_ui["Comment section<br/>[CommentSection.jsx]"]
  node_confirm["Confirm modal<br/>[ConfirmModal.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_backend["Express API"]
  node_server["API server<br/>[index.js]"]
  node_posts_api["Post routes<br/>[posts.js]"]
  node_comments_api["Comment routes<br/>[comments.js]"]
  node_db_module["Database access<br/>[db.js]"]
end

subgraph group_persistence["PostgreSQL persistence"]
  node_postgres[("PostgreSQL")]
end

node_visitor(("Blog visitor"))

node_visitor -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_detail
node_app -->|"routes to"| node_create
node_app -->|"routes to"| node_edit
node_app -->|"renders"| node_navbar
node_home -->|"fetches feed"| node_api_client
node_home -->|"renders"| node_postcard
node_detail -->|"loads and deletes"| node_api_client
node_detail -->|"renders"| node_comments_ui
node_detail -->|"renders"| node_confirm
node_create -->|"creates post"| node_api_client
node_edit -->|"loads and updates"| node_api_client
node_comments_ui -->|"creates and deletes"| node_api_client
node_api_client -->|"HTTP requests"| node_server
node_server -->|"mounts routes"| node_posts_api
node_server -->|"mounts routes"| node_comments_api
node_server -->|"initializes database"| node_db_module
node_posts_api -->|"queries"| node_db_module
node_comments_api -->|"queries"| node_db_module
node_db_module -->|"reads and writes"| node_postgres

click node_app "https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/pages/Home.jsx"
click node_postcard "https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/components/PostCard.jsx"
click node_detail "https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/pages/PostDetail.jsx"
click node_create "https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/pages/CreatePost.jsx"
click node_edit "https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/pages/EditPost.jsx"
click node_comments_ui "https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/components/CommentSection.jsx"
click node_confirm "https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/components/ConfirmModal.jsx"
click node_navbar "https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/components/Navbar.jsx"
click node_api_client "https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/api.js"
click node_server "https://github.com/iam-veeramalla/jerney/blob/main/backend/src/index.js"
click node_posts_api "https://github.com/iam-veeramalla/jerney/blob/main/backend/src/routes/posts.js"
click node_comments_api "https://github.com/iam-veeramalla/jerney/blob/main/backend/src/routes/comments.js"
click node_db_module "https://github.com/iam-veeramalla/jerney/blob/main/backend/src/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_home,node_postcard,node_detail,node_create,node_edit,node_comments_ui,node_confirm,node_navbar,node_api_client toneBlue
class node_server,node_posts_api,node_comments_api,node_db_module toneAmber
class node_postgres toneMint
class node_visitor toneIndigo
```

## Components

### React frontend

- [App routing](https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Post feed](https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Post card](https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/components/PostCard.jsx): `frontend/src/components/PostCard.jsx`
- [Post detail](https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/pages/PostDetail.jsx): `frontend/src/pages/PostDetail.jsx`
- [Create post](https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/pages/CreatePost.jsx): `frontend/src/pages/CreatePost.jsx`
- [Edit post](https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/pages/EditPost.jsx): `frontend/src/pages/EditPost.jsx`
- [Comment section](https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/components/CommentSection.jsx): `frontend/src/components/CommentSection.jsx`
- [Confirm modal](https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/components/ConfirmModal.jsx): `frontend/src/components/ConfirmModal.jsx`
- [Navigation bar](https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [API client](https://github.com/iam-veeramalla/jerney/blob/main/frontend/src/api.js): `frontend/src/api.js`

### Express API

- [API server](https://github.com/iam-veeramalla/jerney/blob/main/backend/src/index.js): `backend/src/index.js`
- [Post routes](https://github.com/iam-veeramalla/jerney/blob/main/backend/src/routes/posts.js): `backend/src/routes/posts.js`
- [Comment routes](https://github.com/iam-veeramalla/jerney/blob/main/backend/src/routes/comments.js): `backend/src/routes/comments.js`
- [Database access](https://github.com/iam-veeramalla/jerney/blob/main/backend/src/db.js): `backend/src/db.js`

### PostgreSQL persistence

- **PostgreSQL**

### Other components

- **Blog visitor**

## Connections

- Blog visitor → App routing: uses (evidence: `README.md`)
- App routing → Post feed: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Post detail: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Create post: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Edit post: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Navigation bar: renders (evidence: `frontend/src/App.jsx`)
- Post feed → API client: fetches feed (evidence: `frontend/src/pages/Home.jsx`)
- Post feed → Post card: renders (evidence: `frontend/src/pages/Home.jsx`)
- Post detail → API client: loads and deletes (evidence: `frontend/src/pages/PostDetail.jsx`)
- Post detail → Comment section: renders (evidence: `frontend/src/pages/PostDetail.jsx`)
- Post detail → Confirm modal: renders (evidence: `frontend/src/pages/PostDetail.jsx`)
- Create post → API client: creates post (evidence: `frontend/src/pages/CreatePost.jsx`)
- Edit post → API client: loads and updates (evidence: `frontend/src/pages/EditPost.jsx`)
- Comment section → API client: creates and deletes (evidence: `frontend/src/components/CommentSection.jsx`)
- API client → API server: HTTP requests (evidence: `README.md`)
- API server → Post routes: mounts routes (evidence: `backend/src/index.js`)
- API server → Comment routes: mounts routes (evidence: `backend/src/index.js`)
- API server → Database access: initializes database (evidence: `backend/src/index.js`)
- Post routes → Database access: queries (evidence: `backend/src/routes/posts.js`)
- Comment routes → Database access: queries (evidence: `backend/src/routes/comments.js`)
- Database access → PostgreSQL: reads and writes (evidence: `backend/src/db.js`)
