# mahiavi/jerney architecture

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

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

## Overview

Jerney is a React blog platform backed by an Express API and PostgreSQL. A reader browses the feed, opens a post, and can comment, edit, or delete; a writer creates a post and is taken to its detail page. Frontend pages call a shared API client, while Express routes own the post and comment operations and query the database. The README also describes a dark glassmorphism UI. Edges reflect shown calls or explicitly documented HTTP architecture; unsampled UI components are retained where their use is shown.

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

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["React experience"]
  node_app["App routes<br/>[App.jsx]"]
  node_feed["Post feed<br/>[Home.jsx]"]
  node_postcard["Post card<br/>[PostCard.jsx]"]
  node_create["Create post<br/>[CreatePost.jsx]"]
  node_detail["Post detail<br/>[PostDetail.jsx]"]
  node_edit["Edit post<br/>[EditPost.jsx]"]
  node_comments["Comment section<br/>[CommentSection.jsx]"]
  node_confirm["Confirm modal<br/>[ConfirmModal.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_client["API client<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_server["Express server<br/>[index.js]"]
  node_postroutes["Post routes<br/>[posts.js]"]
  node_commentroutes["Comment routes<br/>[comments.js]"]
  node_dbconn["DB connection<br/>[db.js]"]
end

subgraph group_data["PostgreSQL data"]
  node_postgres[("Posts and comments")]
end

node_reader(("Reader / writer"))

node_reader -.->|"uses"| node_app
node_app -->|"routes"| node_feed
node_app -->|"routes"| node_detail
node_app -->|"routes"| node_create
node_app -->|"routes"| node_edit
node_app -->|"renders"| node_navbar
node_feed -->|"fetches posts"| node_client
node_feed -->|"renders"| node_postcard
node_create -->|"creates post"| node_client
node_edit -->|"loads and updates"| node_client
node_detail -->|"loads and deletes"| node_client
node_detail -->|"renders"| node_comments
node_detail -->|"renders"| node_confirm
node_comments -->|"creates and deletes"| node_client
node_client -->|"HTTP requests"| node_server
node_server -->|"mounts"| node_postroutes
node_server -->|"mounts"| node_commentroutes
node_server -->|"initializes"| node_dbconn
node_postroutes -->|"queries"| node_dbconn
node_commentroutes -->|"queries"| node_dbconn
node_dbconn -->|"connects"| node_postgres

click node_app "https://github.com/mahiavi/jerney/blob/main/frontend/src/App.jsx"
click node_feed "https://github.com/mahiavi/jerney/blob/main/frontend/src/pages/Home.jsx"
click node_postcard "https://github.com/mahiavi/jerney/blob/main/frontend/src/components/PostCard.jsx"
click node_create "https://github.com/mahiavi/jerney/blob/main/frontend/src/pages/CreatePost.jsx"
click node_detail "https://github.com/mahiavi/jerney/blob/main/frontend/src/pages/PostDetail.jsx"
click node_edit "https://github.com/mahiavi/jerney/blob/main/frontend/src/pages/EditPost.jsx"
click node_comments "https://github.com/mahiavi/jerney/blob/main/frontend/src/components/CommentSection.jsx"
click node_confirm "https://github.com/mahiavi/jerney/blob/main/frontend/src/components/ConfirmModal.jsx"
click node_navbar "https://github.com/mahiavi/jerney/blob/main/frontend/src/components/Navbar.jsx"
click node_client "https://github.com/mahiavi/jerney/blob/main/frontend/src/api.js"
click node_server "https://github.com/mahiavi/jerney/blob/main/backend/src/index.js"
click node_postroutes "https://github.com/mahiavi/jerney/blob/main/backend/src/routes/posts.js"
click node_commentroutes "https://github.com/mahiavi/jerney/blob/main/backend/src/routes/comments.js"
click node_dbconn "https://github.com/mahiavi/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_feed,node_postcard,node_create,node_detail,node_edit,node_comments,node_confirm,node_navbar,node_client toneBlue
class node_server,node_postroutes,node_commentroutes,node_dbconn toneAmber
class node_postgres toneMint
class node_reader toneIndigo
```

## Components

### React experience

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

### Backend API

- [Express server](https://github.com/mahiavi/jerney/blob/main/backend/src/index.js): `backend/src/index.js`
- [Post routes](https://github.com/mahiavi/jerney/blob/main/backend/src/routes/posts.js): `backend/src/routes/posts.js`
- [Comment routes](https://github.com/mahiavi/jerney/blob/main/backend/src/routes/comments.js): `backend/src/routes/comments.js`
- [DB connection](https://github.com/mahiavi/jerney/blob/main/backend/src/db.js): `backend/src/db.js`

### PostgreSQL data

- **Posts and comments**

### Other components

- **Reader / writer**

## Connections

- Reader / writer → App routes: uses
- App routes → Post feed: routes (evidence: `frontend/src/App.jsx`)
- App routes → Post detail: routes (evidence: `frontend/src/App.jsx`)
- App routes → Create post: routes (evidence: `frontend/src/App.jsx`)
- App routes → Edit post: routes (evidence: `frontend/src/App.jsx`)
- App routes → Navigation: renders (evidence: `frontend/src/App.jsx`)
- Post feed → API client: fetches posts (evidence: `frontend/src/pages/Home.jsx`)
- Post feed → Post card: renders (evidence: `frontend/src/pages/Home.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`)
- 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`)
- Comment section → API client: creates and deletes (evidence: `frontend/src/components/CommentSection.jsx`)
- API client → Express server: HTTP requests (evidence: `frontend/src/api.js`)
- Express server → Post routes: mounts (evidence: `backend/src/index.js`)
- Express server → Comment routes: mounts (evidence: `backend/src/index.js`)
- Express server → DB connection: initializes (evidence: `backend/src/index.js`)
- Post routes → DB connection: queries (evidence: `backend/src/routes/posts.js`)
- Comment routes → DB connection: queries (evidence: `backend/src/routes/comments.js`)
- DB connection → Posts and comments: connects (evidence: `backend/src/db.js`)
