# gauri-2044/news_portal architecture

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

- Interactive diagram: https://gitdiagram.com/gauri-2044/news_portal
- Repository: https://github.com/gauri-2044/news_portal

## Overview

NewsSphere is a small browser-based news portal. The documented user workflow is exploring stories; the sampled JavaScript fetches headline and article data from NewsAPI and renders them into page sections. The README also advertises topic search and category browsing, but their implementation and the HTML/CSS wiring were not sampled, so those capabilities are shown as documented but unverified.

Main entry points: [`news.js`](https://github.com/gauri-2044/news_portal/blob/main/news.js) (News fetcher), [`news.html`](https://github.com/gauri-2044/news_portal/blob/main/news.html) (News portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Portal interface"]
  node_portal["News portal<br/>[news.html]"]
  node_styles["Portal styles<br/>[news.css]"]
  node_topic_browsing["Topic browsing<br/>[news.html]"]
  node_headline_view["Headline display<br/>[news.js]"]
  node_article_view["Article cards<br/>[news.js]"]
end

subgraph group_retrieval["News retrieval"]
  node_fetcher["News fetcher<br/>[news.js]"]
  node_headlines_flow["Headline loading<br/>[news.js]"]
  node_articles_flow["Article loading<br/>[news.js]"]
end

subgraph group_external["External services"]
  node_newsapi["NewsAPI"]
end

node_reader(("Reader"))

node_reader -->|"visits"| node_portal
node_reader -.->|"explores topics"| node_topic_browsing
node_headlines_flow -->|"requests data"| node_fetcher
node_articles_flow -->|"requests data"| node_fetcher
node_fetcher -->|"fetches articles"| node_newsapi
node_headlines_flow -->|"renders headlines"| node_headline_view
node_articles_flow -->|"renders cards"| node_article_view

click node_portal "https://github.com/gauri-2044/news_portal/blob/main/news.html"
click node_styles "https://github.com/gauri-2044/news_portal/blob/main/news.css"
click node_topic_browsing "https://github.com/gauri-2044/news_portal/blob/main/news.html"
click node_headline_view "https://github.com/gauri-2044/news_portal/blob/main/news.js"
click node_article_view "https://github.com/gauri-2044/news_portal/blob/main/news.js"
click node_fetcher "https://github.com/gauri-2044/news_portal/blob/main/news.js"
click node_headlines_flow "https://github.com/gauri-2044/news_portal/blob/main/news.js"
click node_articles_flow "https://github.com/gauri-2044/news_portal/blob/main/news.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_portal,node_styles,node_topic_browsing,node_headline_view,node_article_view toneBlue
class node_fetcher,node_headlines_flow,node_articles_flow toneAmber
class node_newsapi toneMint
class node_reader toneIndigo
```

## Components

### Portal interface

- [News portal](https://github.com/gauri-2044/news_portal/blob/main/news.html): `news.html`
- [Portal styles](https://github.com/gauri-2044/news_portal/blob/main/news.css): `news.css`
- [Topic browsing](https://github.com/gauri-2044/news_portal/blob/main/news.html): `news.html`
- [Headline display](https://github.com/gauri-2044/news_portal/blob/main/news.js): `news.js`
- [Article cards](https://github.com/gauri-2044/news_portal/blob/main/news.js): `news.js`

### News retrieval

- [News fetcher](https://github.com/gauri-2044/news_portal/blob/main/news.js): `news.js`
- [Headline loading](https://github.com/gauri-2044/news_portal/blob/main/news.js): `news.js`
- [Article loading](https://github.com/gauri-2044/news_portal/blob/main/news.js): `news.js`

### External services

- **NewsAPI**

### Other components

- **Reader**

## Connections

- Reader → News portal: visits (evidence: `README.md`)
- Reader → Topic browsing: explores topics (evidence: `README.md`)
- Headline loading → News fetcher: requests data (evidence: `news.js`)
- Article loading → News fetcher: requests data (evidence: `news.js`)
- News fetcher → NewsAPI: fetches articles (evidence: `news.js`)
- Headline loading → Headline display: renders headlines (evidence: `news.js`)
- Article loading → Article cards: renders cards (evidence: `news.js`)
