# ronikok/fish-blog architecture

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

- Interactive diagram: https://gitdiagram.com/ronikok/fish-blog
- Repository: https://github.com/ronikok/fish-blog

## Overview

Fish-blog is a fishing community site with a fish catalog and rating feature, plus a user forum and account profiles. Visitors browse, search, and sort fish; signed-in users can submit or remove ratings. Forum users browse and search posts, like them, and read or add replies; profiles expose account and personal-post actions. The Express server handles these API requests, using authentication helpers and a PostgreSQL connection. The README gives no further product detail, and unsampled UI and server code limit evidence for some capabilities and links.

Main entry points: [`backend/Server/helpers/db.js`](https://github.com/ronikok/fish-blog/blob/main/backend/Server/helpers/db.js) (Database connection), [`frontend/js/index.js`](https://github.com/ronikok/fish-blog/blob/main/frontend/js/index.js) (Fish catalog UI), [`frontend/js/forum.js`](https://github.com/ronikok/fish-blog/blob/main/frontend/js/forum.js) (Forum UI), [`frontend/js/profile.js`](https://github.com/ronikok/fish-blog/blob/main/frontend/js/profile.js) (Profile UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_fish_ui["Fish catalog UI<br/>[index.js]"]
  node_forum_ui["Forum UI<br/>[forum.js]"]
  node_profile_ui["Profile UI<br/>[profile.js]"]
  node_navbar["Shared navigation<br/>[navbar.js]"]
  node_fish_modal["Fish rating modal"]
  node_comments_modal["Comments modal"]
end

subgraph group_community["Community features"]
  node_fish_api["Fish ratings API<br/>[index.js]"]
  node_forum_api["Posts and replies API<br/>[index.js]"]
end

subgraph group_accounts["Accounts"]
  node_account_api["Account API<br/>[index.js]"]
  node_auth_helpers["Authentication helpers<br/>[authHjelper.js]"]
end

subgraph group_server["Server and persistence"]
  node_server_db["Database connection<br/>[db.js]"]
  node_postgres[("PostgreSQL")]
end

node_visitor(("Visitor / user"))

node_visitor -->|"browses"| node_fish_ui
node_visitor -->|"uses"| node_forum_ui
node_visitor -->|"manages account"| node_profile_ui
node_fish_ui -->|"fetches and rates"| node_fish_api
node_fish_ui -->|"loads"| node_fish_modal
node_forum_ui -->|"loads and updates"| node_forum_api
node_forum_ui -->|"loads"| node_comments_modal
node_profile_ui -->|"manages account"| node_account_api
node_profile_ui -->|"loads and deletes posts"| node_forum_api
node_navbar -.->|"shows navigation"| node_visitor
node_fish_api -->|"queries"| node_server_db
node_forum_api -->|"queries"| node_server_db
node_account_api -->|"queries"| node_server_db
node_account_api -->|"registers and authenticates"| node_auth_helpers
node_auth_helpers -->|"queries"| node_server_db
node_server_db -->|"queries"| node_postgres

click node_fish_ui "https://github.com/ronikok/fish-blog/blob/main/frontend/js/index.js"
click node_forum_ui "https://github.com/ronikok/fish-blog/blob/main/frontend/js/forum.js"
click node_profile_ui "https://github.com/ronikok/fish-blog/blob/main/frontend/js/profile.js"
click node_navbar "https://github.com/ronikok/fish-blog/blob/main/frontend/js/navbar.js"
click node_fish_modal "https://github.com/ronikok/fish-blog/blob/main/frontend/components/fishcard-modal.html"
click node_comments_modal "https://github.com/ronikok/fish-blog/blob/main/frontend/components/comments-modal.html"
click node_fish_api "https://github.com/ronikok/fish-blog/blob/main/backend/Server/index.js"
click node_forum_api "https://github.com/ronikok/fish-blog/blob/main/backend/Server/index.js"
click node_account_api "https://github.com/ronikok/fish-blog/blob/main/backend/Server/index.js"
click node_auth_helpers "https://github.com/ronikok/fish-blog/blob/main/backend/Server/helpers/authHjelper.js"
click node_server_db "https://github.com/ronikok/fish-blog/blob/main/backend/Server/helpers/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_fish_ui,node_forum_ui,node_profile_ui,node_navbar,node_fish_modal,node_comments_modal,node_visitor toneBlue
class node_fish_api,node_forum_api toneAmber
class node_account_api,node_auth_helpers toneMint
class node_server_db,node_postgres toneRose
```

## Components

### Web interface

- [Fish catalog UI](https://github.com/ronikok/fish-blog/blob/main/frontend/js/index.js): `frontend/js/index.js`
- [Forum UI](https://github.com/ronikok/fish-blog/blob/main/frontend/js/forum.js): `frontend/js/forum.js`
- [Profile UI](https://github.com/ronikok/fish-blog/blob/main/frontend/js/profile.js): `frontend/js/profile.js`
- [Shared navigation](https://github.com/ronikok/fish-blog/blob/main/frontend/js/navbar.js): `frontend/js/navbar.js`
- [Fish rating modal](https://github.com/ronikok/fish-blog/blob/main/frontend/components/fishcard-modal.html): `frontend/components/fishcard-modal.html`
- [Comments modal](https://github.com/ronikok/fish-blog/blob/main/frontend/components/comments-modal.html): `frontend/components/comments-modal.html`

### Community features

- [Fish ratings API](https://github.com/ronikok/fish-blog/blob/main/backend/Server/index.js): `backend/Server/index.js`
- [Posts and replies API](https://github.com/ronikok/fish-blog/blob/main/backend/Server/index.js): `backend/Server/index.js`

### Accounts

- [Account API](https://github.com/ronikok/fish-blog/blob/main/backend/Server/index.js): `backend/Server/index.js`
- [Authentication helpers](https://github.com/ronikok/fish-blog/blob/main/backend/Server/helpers/authHjelper.js): `backend/Server/helpers/authHjelper.js`

### Server and persistence

- [Database connection](https://github.com/ronikok/fish-blog/blob/main/backend/Server/helpers/db.js): `backend/Server/helpers/db.js`
- **PostgreSQL**

### Other components

- **Visitor / user**

## Connections

- Visitor / user → Fish catalog UI: browses
- Visitor / user → Forum UI: uses
- Visitor / user → Profile UI: manages account
- Fish catalog UI → Fish ratings API: fetches and rates (evidence: `frontend/js/index.js`)
- Fish catalog UI → Fish rating modal: loads (evidence: `frontend/js/index.js`)
- Forum UI → Posts and replies API: loads and updates (evidence: `frontend/js/forum.js`)
- Forum UI → Comments modal: loads (evidence: `frontend/js/forum.js`)
- Profile UI → Account API: manages account (evidence: `frontend/js/profile.js`)
- Profile UI → Posts and replies API: loads and deletes posts (evidence: `frontend/js/profile.js`)
- Shared navigation → Visitor / user: shows navigation
- Fish ratings API → Database connection: queries (evidence: `backend/Server/index.js`)
- Posts and replies API → Database connection: queries (evidence: `backend/Server/index.js`)
- Account API → Database connection: queries (evidence: `backend/Server/index.js`)
- Account API → Authentication helpers: registers and authenticates (evidence: `backend/Server/index.js`)
- Authentication helpers → Database connection: queries (evidence: `backend/Server/helpers/authHjelper.js`)
- Database connection → PostgreSQL: queries (evidence: `backend/Server/helpers/db.js`)
