# saikumar937-max/voicenews architecture

> Architecture diagram of the GitHub repository saikumar937-max/voicenews, 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/saikumar937-max/voicenews
- Repository: https://github.com/saikumar937-max/voicenews

## Overview

voicenews is an AI-powered audio news reader: users browse Guardian headlines and listen to them narrated. The sampled backend exposes category-based news retrieval and optional Murf speech generation; without a Murf key, its TTS endpoint reports that browser TTS should be used. The README identifies a React frontend, but its implementation and frontend-to-backend wiring were not shown, so that connection is left unverified. The repository tree does not show the `static/` directory referenced by the backend.

Main entry points: [`main.py`](https://github.com/saikumar937-max/voicenews/blob/main/main.py) (FastAPI app), [`index.html`](https://github.com/saikumar937-max/voicenews/blob/main/index.html) (React frontend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_frontend["React frontend<br/>[index.html]"]
end

subgraph group_backend["Backend"]
  node_api["FastAPI app<br/>[main.py]"]
  node_news_route["News endpoint<br/>[main.py]"]
  node_category_map["Category mapping<br/>[main.py]"]
  node_tts_route["Speech endpoint<br/>[main.py]"]
end

subgraph group_services["External services"]
  node_guardian["Guardian API"]
  node_murf["Murf speech API"]
end

node_user(("Listener"))

node_user -->|"uses"| node_frontend
node_frontend -.->|"requests data"| node_api
node_api -->|"routes news"| node_news_route
node_news_route -->|"maps category"| node_category_map
node_news_route -->|"fetches headlines"| node_guardian
node_api -->|"routes speech"| node_tts_route
node_tts_route -->|"generates speech"| node_murf

click node_frontend "https://github.com/saikumar937-max/voicenews/blob/main/index.html"
click node_api "https://github.com/saikumar937-max/voicenews/blob/main/main.py"
click node_news_route "https://github.com/saikumar937-max/voicenews/blob/main/main.py"
click node_category_map "https://github.com/saikumar937-max/voicenews/blob/main/main.py"
click node_tts_route "https://github.com/saikumar937-max/voicenews/blob/main/main.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_frontend toneBlue
class node_api,node_news_route,node_category_map,node_tts_route toneAmber
class node_guardian,node_murf toneMint
class node_user toneIndigo
```

## Components

### Client

- [React frontend](https://github.com/saikumar937-max/voicenews/blob/main/index.html): `index.html`

### Backend

- [FastAPI app](https://github.com/saikumar937-max/voicenews/blob/main/main.py): `main.py`
- [News endpoint](https://github.com/saikumar937-max/voicenews/blob/main/main.py): `main.py`
- [Category mapping](https://github.com/saikumar937-max/voicenews/blob/main/main.py): `main.py`
- [Speech endpoint](https://github.com/saikumar937-max/voicenews/blob/main/main.py): `main.py`

### External services

- **Guardian API**
- **Murf speech API**

### Other components

- **Listener**

## Connections

- Listener → React frontend: uses (evidence: `README.md`)
- React frontend → FastAPI app: requests data
- FastAPI app → News endpoint: routes news (evidence: `main.py`)
- News endpoint → Category mapping: maps category (evidence: `main.py`)
- News endpoint → Guardian API: fetches headlines (evidence: `main.py`)
- FastAPI app → Speech endpoint: routes speech (evidence: `main.py`)
- Speech endpoint → Murf speech API: generates speech (evidence: `main.py`)
