# sakshi-dhakne/newspulse architecture

> Architecture diagram of the GitHub repository sakshi-dhakne/newspulse, 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/sakshi-dhakne/newspulse
- Repository: https://github.com/sakshi-dhakne/newspulse

## Overview

NewsPulse is a command-line news digest application. Running `app.py` loads configured credentials, fetches U.S. top headlines, categorizes up to 15 articles, formats a digest, and sends it by email. The graph separates orchestration, article categorization, and configuration/delivery integrations. The README documents the overall workflow; source excerpts show the calls and integrations. The recipient is configured in the email message, but no separate recipient-side component is represented.

Main entry points: [`app.py`](https://github.com/sakshi-dhakne/newspulse/blob/main/app.py) (Digest workflow), [`fetcher.py`](https://github.com/sakshi-dhakne/newspulse/blob/main/fetcher.py) (News fetcher), [`email_sender.py`](https://github.com/sakshi-dhakne/newspulse/blob/main/email_sender.py) (Email sender), [`analyzer.py`](https://github.com/sakshi-dhakne/newspulse/blob/main/analyzer.py) (Keyword categorizer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Digest orchestration"]
  node_app["Digest workflow<br/>[app.py]"]
end

subgraph group_classification["Article classification"]
  node_analyzer["Keyword categorizer<br/>[analyzer.py]"]
end

subgraph group_integrations["Configuration and delivery"]
  node_fetcher["News fetcher<br/>[fetcher.py]"]
  node_config["Credential config<br/>[config.py]"]
  node_email_sender["Email sender<br/>[email_sender.py]"]
end

node_user(("User"))
node_newsapi["NewsAPI"]
node_smtp["Gmail SMTP"]

node_user -->|"runs"| node_app
node_app -->|"imports credentials"| node_config
node_app -->|"fetches articles"| node_fetcher
node_fetcher -->|"requests headlines"| node_newsapi
node_app -->|"categorizes articles"| node_analyzer
node_app -->|"sends digest"| node_email_sender
node_email_sender -->|"sends via SMTP"| node_smtp

click node_app "https://github.com/sakshi-dhakne/newspulse/blob/main/app.py"
click node_fetcher "https://github.com/sakshi-dhakne/newspulse/blob/main/fetcher.py"
click node_analyzer "https://github.com/sakshi-dhakne/newspulse/blob/main/analyzer.py"
click node_config "https://github.com/sakshi-dhakne/newspulse/blob/main/config.py"
click node_email_sender "https://github.com/sakshi-dhakne/newspulse/blob/main/email_sender.py"

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_user toneBlue
class node_analyzer toneAmber
class node_fetcher,node_config,node_email_sender,node_newsapi toneMint
class node_smtp toneIndigo
```

## Components

### Digest orchestration

- [Digest workflow](https://github.com/sakshi-dhakne/newspulse/blob/main/app.py): `app.py`

### Article classification

- [Keyword categorizer](https://github.com/sakshi-dhakne/newspulse/blob/main/analyzer.py): `analyzer.py`

### Configuration and delivery

- [News fetcher](https://github.com/sakshi-dhakne/newspulse/blob/main/fetcher.py): `fetcher.py`
- [Credential config](https://github.com/sakshi-dhakne/newspulse/blob/main/config.py): `config.py`
- [Email sender](https://github.com/sakshi-dhakne/newspulse/blob/main/email_sender.py): `email_sender.py`

### Other components

- **User**
- **NewsAPI**
- **Gmail SMTP**

## Connections

- User → Digest workflow: runs (evidence: `README.md`)
- Digest workflow → Credential config: imports credentials (evidence: `app.py`)
- Digest workflow → News fetcher: fetches articles (evidence: `app.py`)
- News fetcher → NewsAPI: requests headlines (evidence: `fetcher.py`)
- Digest workflow → Keyword categorizer: categorizes articles (evidence: `app.py`)
- Digest workflow → Email sender: sends digest (evidence: `app.py`)
- Email sender → Gmail SMTP: sends via SMTP (evidence: `email_sender.py`)
