# kirinojuju/social-network architecture

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

- Interactive diagram: https://gitdiagram.com/kirinojuju/social-network
- Repository: https://github.com/kirinojuju/social-network

## Overview

UniConnect is a local-only social-network project. The visible workflow is a browser rendering the React app’s Explore view alongside navigation and recommendations; the backend currently exposes health/readiness checks and a PostgreSQL readiness query, rather than social-feature APIs. Login and sign-up forms exist but are not wired into the shown app entry point. AI summary UI is static, while a separate backend AI summarizer uses an OpenRouter-configured client. The README describes broader social features, but the tree and sampled code do not establish their runtime implementation or connections.

Main entry points: [`frontend/src/App.jsx`](https://github.com/kirinojuju/social-network/blob/main/frontend/src/App.jsx) (App shell), [`backend/server.js`](https://github.com/kirinojuju/social-network/blob/main/backend/server.js) (HTTP server), [`frontend/src/main.jsx`](https://github.com/kirinojuju/social-network/blob/main/frontend/src/main.jsx) (React entry), [`backend/app.js`](https://github.com/kirinojuju/social-network/blob/main/backend/app.js) (Health endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App runtime"]
  node_frontend_entry["React entry<br/>[main.jsx]"]
  node_app_shell["App shell<br/>[App.jsx]"]
  node_server["HTTP server<br/>[server.js]"]
  node_api["Health endpoints<br/>[app.js]"]
  node_db_pool["PostgreSQL pool<br/>[db.js]"]
end

subgraph group_social["Social interface"]
  node_explore["Explore search<br/>[Explore.jsx]"]
  node_navigation["Feature navigation<br/>[LeftSideBar.jsx]"]
  node_recommendations["People and groups<br/>[RightSideBar.jsx]"]
  node_login["Login form<br/>[AuthFormsLogin.jsx]"]
  node_signup["Sign-up form"]
end

subgraph group_ai["AI summary"]
  node_ai_ui["AI summary UI<br/>[AI_summary.jsx]"]
  node_summarizer["AI summarizer<br/>[summarize.js]"]
  node_ai_client["OpenRouter client<br/>[aiClient.js]"]
end

node_browser(("User browser"))
node_postgres[("PostgreSQL")]
node_openrouter(("OpenRouter API"))

node_browser -->|"opens app"| node_frontend_entry
node_frontend_entry -->|"renders"| node_app_shell
node_app_shell -->|"renders"| node_explore
node_app_shell -->|"renders"| node_navigation
node_app_shell -->|"renders"| node_recommendations
node_app_shell -->|"conditionally renders"| node_ai_ui
node_browser -.->|"uses form"| node_login
node_browser -.->|"uses form"| node_signup
node_server -->|"creates pool"| node_db_pool
node_server -->|"starts app"| node_api
node_api -->|"checks readiness"| node_postgres
node_db_pool -->|"connects to"| node_postgres
node_summarizer -->|"uses client"| node_ai_client
node_ai_client -->|"targets API"| node_openrouter

click node_frontend_entry "https://github.com/kirinojuju/social-network/blob/main/frontend/src/main.jsx"
click node_app_shell "https://github.com/kirinojuju/social-network/blob/main/frontend/src/App.jsx"
click node_explore "https://github.com/kirinojuju/social-network/blob/main/frontend/src/component/Explore.jsx"
click node_navigation "https://github.com/kirinojuju/social-network/blob/main/frontend/src/component/LeftSideBar.jsx"
click node_recommendations "https://github.com/kirinojuju/social-network/blob/main/frontend/src/component/RightSideBar.jsx"
click node_login "https://github.com/kirinojuju/social-network/blob/main/frontend/src/component/AuthFormsLogin.jsx"
click node_signup "https://github.com/kirinojuju/social-network/blob/main/frontend/src/component/AuthFormsSignUp.jsx"
click node_ai_ui "https://github.com/kirinojuju/social-network/blob/main/frontend/src/component/AI_summary.jsx"
click node_server "https://github.com/kirinojuju/social-network/blob/main/backend/server.js"
click node_api "https://github.com/kirinojuju/social-network/blob/main/backend/app.js"
click node_db_pool "https://github.com/kirinojuju/social-network/blob/main/backend/config/db.js"
click node_summarizer "https://github.com/kirinojuju/social-network/blob/main/backend/ai/summarize.js"
click node_ai_client "https://github.com/kirinojuju/social-network/blob/main/backend/ai/aiClient.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_frontend_entry,node_app_shell,node_server,node_api,node_db_pool,node_browser toneBlue
class node_explore,node_navigation,node_recommendations,node_login,node_signup,node_postgres toneAmber
class node_ai_ui,node_summarizer,node_ai_client,node_openrouter toneMint
```

## Components

### App runtime

- [React entry](https://github.com/kirinojuju/social-network/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [App shell](https://github.com/kirinojuju/social-network/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [HTTP server](https://github.com/kirinojuju/social-network/blob/main/backend/server.js): `backend/server.js`
- [Health endpoints](https://github.com/kirinojuju/social-network/blob/main/backend/app.js): `backend/app.js`
- [PostgreSQL pool](https://github.com/kirinojuju/social-network/blob/main/backend/config/db.js): `backend/config/db.js`

### Social interface

- [Explore search](https://github.com/kirinojuju/social-network/blob/main/frontend/src/component/Explore.jsx): `frontend/src/component/Explore.jsx`
- [Feature navigation](https://github.com/kirinojuju/social-network/blob/main/frontend/src/component/LeftSideBar.jsx): `frontend/src/component/LeftSideBar.jsx`
- [People and groups](https://github.com/kirinojuju/social-network/blob/main/frontend/src/component/RightSideBar.jsx): `frontend/src/component/RightSideBar.jsx`
- [Login form](https://github.com/kirinojuju/social-network/blob/main/frontend/src/component/AuthFormsLogin.jsx): `frontend/src/component/AuthFormsLogin.jsx`
- [Sign-up form](https://github.com/kirinojuju/social-network/blob/main/frontend/src/component/AuthFormsSignUp.jsx): `frontend/src/component/AuthFormsSignUp.jsx`

### AI summary

- [AI summary UI](https://github.com/kirinojuju/social-network/blob/main/frontend/src/component/AI_summary.jsx): `frontend/src/component/AI_summary.jsx`
- [AI summarizer](https://github.com/kirinojuju/social-network/blob/main/backend/ai/summarize.js): `backend/ai/summarize.js`
- [OpenRouter client](https://github.com/kirinojuju/social-network/blob/main/backend/ai/aiClient.js): `backend/ai/aiClient.js`

### Other components

- **User browser**
- **PostgreSQL**
- **OpenRouter API**

## Connections

- User browser → React entry: opens app (evidence: `frontend/src/main.jsx`)
- React entry → App shell: renders (evidence: `frontend/src/main.jsx`)
- App shell → Explore search: renders (evidence: `frontend/src/App.jsx`)
- App shell → Feature navigation: renders (evidence: `frontend/src/App.jsx`)
- App shell → People and groups: renders (evidence: `frontend/src/App.jsx`)
- App shell → AI summary UI: conditionally renders (evidence: `frontend/src/App.jsx`)
- User browser → Login form: uses form
- User browser → Sign-up form: uses form
- HTTP server → PostgreSQL pool: creates pool (evidence: `backend/server.js`)
- HTTP server → Health endpoints: starts app (evidence: `backend/server.js`)
- Health endpoints → PostgreSQL: checks readiness (evidence: `backend/app.js`)
- PostgreSQL pool → PostgreSQL: connects to (evidence: `backend/config/db.js`)
- AI summarizer → OpenRouter client: uses client (evidence: `backend/ai/summarize.js`)
- OpenRouter client → OpenRouter API: targets API (evidence: `backend/ai/aiClient.js`)
