# ameerkalash/tarmeez-api-js-project architecture

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

- Interactive diagram: https://gitdiagram.com/ameerkalash/tarmeez-api-js-project
- Repository: https://github.com/ameerkalash/tarmeez-api-js-project

## Overview

This is a browser-based social-posts client backed by the Tarmeez Academy API. Users browse a paginated feed, open posts to read and submit comments, and view user profiles and their posts; authenticated users can register, log in, and create, edit, or delete posts. The JavaScript directly renders page content and uses browser local storage for login state. Source excerpts establish the API and helper calls shown below; HTML wiring and other unsampled behavior are not verified.

Main entry points: [`mainLogic.js`](https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/mainLogic.js) (Auth and post actions), [`main.js`](https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/main.js) (Feed loading), [`postDerails.js`](https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/postDerails.js) (Post and comments), [`profile.js`](https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/profile.js) (Profile and posts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages["Social pages"]
  node_home["Feed page<br/>[index.html]"]
  node_detailpage["Post detail page<br/>[postDetails.html]"]
  node_profilepage["Profile page<br/>[profile.html]"]
end

subgraph group_features["Post features"]
  node_feed["Feed loading<br/>[main.js]"]
  node_detail["Post and comments<br/>[postDerails.js]"]
  node_profile["Profile and posts<br/>[profile.js]"]
end

subgraph group_identity["Identity and state"]
  node_shared["Auth and post actions<br/>[mainLogic.js]"]
end

node_visitor(("Visitor"))
node_api["Tarmeez API"]
node_browser["Browser local storage"]

node_visitor -.->|"opens"| node_home
node_visitor -.->|"opens"| node_detailpage
node_visitor -.->|"opens"| node_profilepage
node_feed -->|"fetches feed"| node_api
node_feed -->|"uses helpers"| node_shared
node_detail -->|"fetches post"| node_api
node_detail -->|"submits comment"| node_api
node_detail -->|"uses helpers"| node_shared
node_profile -->|"fetches profile"| node_api
node_profile -->|"fetches posts"| node_api
node_profile -->|"uses helpers"| node_shared
node_shared -->|"auth and post requests"| node_api
node_shared -->|"reads and writes"| node_browser
node_feed -->|"stores page metadata"| node_browser

click node_home "https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/index.html"
click node_feed "https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/main.js"
click node_detailpage "https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/postDetails.html"
click node_detail "https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/postDerails.js"
click node_profilepage "https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/profile.html"
click node_profile "https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/profile.js"
click node_shared "https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/mainLogic.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_home,node_detailpage,node_profilepage toneBlue
class node_feed,node_detail,node_profile,node_browser toneAmber
class node_shared,node_api toneMint
class node_visitor toneIndigo
```

## Components

### Social pages

- [Feed page](https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/index.html): `index.html`
- [Post detail page](https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/postDetails.html): `postDetails.html`
- [Profile page](https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/profile.html): `profile.html`

### Post features

- [Feed loading](https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/main.js): `main.js`
- [Post and comments](https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/postDerails.js): `postDerails.js`
- [Profile and posts](https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/profile.js): `profile.js`

### Identity and state

- [Auth and post actions](https://github.com/ameerkalash/tarmeez-api-js-project/blob/main/mainLogic.js): `mainLogic.js`

### Other components

- **Visitor**
- **Tarmeez API**
- **Browser local storage**

## Connections

- Visitor → Feed page: opens
- Visitor → Post detail page: opens
- Visitor → Profile page: opens
- Feed loading → Tarmeez API: fetches feed (evidence: `main.js`)
- Feed loading → Auth and post actions: uses helpers (evidence: `main.js`)
- Post and comments → Tarmeez API: fetches post (evidence: `postDerails.js`)
- Post and comments → Tarmeez API: submits comment (evidence: `postDerails.js`)
- Post and comments → Auth and post actions: uses helpers (evidence: `postDerails.js`)
- Profile and posts → Tarmeez API: fetches profile (evidence: `profile.js`)
- Profile and posts → Tarmeez API: fetches posts (evidence: `profile.js`)
- Profile and posts → Auth and post actions: uses helpers (evidence: `profile.js`)
- Auth and post actions → Tarmeez API: auth and post requests (evidence: `mainLogic.js`)
- Auth and post actions → Browser local storage: reads and writes (evidence: `mainLogic.js`)
- Feed loading → Browser local storage: stores page metadata (evidence: `main.js`)
