# suryani-76/newspaper_app architecture

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

- Interactive diagram: https://gitdiagram.com/suryani-76/newspaper_app
- Repository: https://github.com/suryani-76/newspaper_app

## Overview

CineWire is a movie-news and discovery web app. Readers browse/search news and film information, open articles, and use account features such as bookmarks, reactions, comments, and preferences; applicants can submit reporter or studio applications for admin review. The browser client talks to the Express API, which selects Guardian, TMDB, or local fallback content and persists user and editorial workflows in SQLite. The excerpts establish the main API-to-provider and database links; finer client endpoint wiring and several feature routes were not sampled.

Main entry points: [`server.js`](https://github.com/suryani-76/newspaper_app/blob/main/server.js) (HTTP API), [`app.js`](https://github.com/suryani-76/newspaper_app/blob/main/app.js) (Web client), [`db.js`](https://github.com/suryani-76/newspaper_app/blob/main/db.js) (SQLite records), [`guardian.js`](https://github.com/suryani-76/newspaper_app/blob/main/guardian.js) (Guardian news)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Reader experience"]
  node_webui["Web client<br/>[app.js]"]
  node_language["Localization<br/>[translation.js]"]
  node_offline["Offline shell<br/>[sw.js]"]
end

subgraph group_api["Application API"]
  node_api_server["HTTP API<br/>[server.js]"]
  node_auth["Accounts and sessions<br/>[server.js]"]
  node_article_api["News and discovery<br/>[server.js]"]
  node_community["Reader interactions<br/>[server.js]"]
  node_applications["Contributor applications<br/>[server.js]"]
end

subgraph group_content["Content providers"]
  node_guardian["Guardian news<br/>[guardian.js]"]
  node_tmdb["Film catalog<br/>[tmdb.js]"]
  node_local_content["Fallback articles<br/>[server.js]"]
end

subgraph group_state["Persistent state"]
  node_sqlite[("SQLite records<br/>[db.js]")]
end

node_reader(("Reader"))
node_guardian_service{{"Guardian API"}}
node_tmdb_service{{"TMDB API"}}

node_reader -->|"uses"| node_webui
node_webui -->|"requests"| node_api_server
node_webui -->|"translates"| node_language
node_webui -.->|"loads offline"| node_offline
node_api_server -->|"routes"| node_article_api
node_api_server -.->|"routes"| node_auth
node_api_server -.->|"routes"| node_community
node_api_server -->|"routes"| node_applications
node_article_api -->|"fetches news"| node_guardian
node_article_api -.->|"fetches films"| node_tmdb
node_article_api -->|"falls back"| node_local_content
node_guardian -->|"queries"| node_guardian_service
node_tmdb -->|"queries"| node_tmdb_service
node_auth -.->|"reads/writes"| node_sqlite
node_community -.->|"reads/writes"| node_sqlite
node_applications -->|"reads/writes"| node_sqlite

click node_webui "https://github.com/suryani-76/newspaper_app/blob/main/app.js"
click node_language "https://github.com/suryani-76/newspaper_app/blob/main/translation.js"
click node_offline "https://github.com/suryani-76/newspaper_app/blob/main/sw.js"
click node_api_server "https://github.com/suryani-76/newspaper_app/blob/main/server.js"
click node_auth "https://github.com/suryani-76/newspaper_app/blob/main/server.js"
click node_article_api "https://github.com/suryani-76/newspaper_app/blob/main/server.js"
click node_community "https://github.com/suryani-76/newspaper_app/blob/main/server.js"
click node_applications "https://github.com/suryani-76/newspaper_app/blob/main/server.js"
click node_guardian "https://github.com/suryani-76/newspaper_app/blob/main/guardian.js"
click node_tmdb "https://github.com/suryani-76/newspaper_app/blob/main/tmdb.js"
click node_local_content "https://github.com/suryani-76/newspaper_app/blob/main/server.js"
click node_sqlite "https://github.com/suryani-76/newspaper_app/blob/main/db.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_webui,node_language,node_offline toneBlue
class node_api_server,node_auth,node_article_api,node_community,node_applications toneAmber
class node_guardian,node_tmdb,node_local_content,node_guardian_service,node_tmdb_service toneMint
class node_sqlite toneRose
class node_reader toneIndigo
```

## Components

### Reader experience

- [Web client](https://github.com/suryani-76/newspaper_app/blob/main/app.js): `app.js`
- [Localization](https://github.com/suryani-76/newspaper_app/blob/main/translation.js): `translation.js`
- [Offline shell](https://github.com/suryani-76/newspaper_app/blob/main/sw.js): `sw.js`

### Application API

- [HTTP API](https://github.com/suryani-76/newspaper_app/blob/main/server.js): `server.js`
- [Accounts and sessions](https://github.com/suryani-76/newspaper_app/blob/main/server.js): `server.js`
- [News and discovery](https://github.com/suryani-76/newspaper_app/blob/main/server.js): `server.js`
- [Reader interactions](https://github.com/suryani-76/newspaper_app/blob/main/server.js): `server.js`
- [Contributor applications](https://github.com/suryani-76/newspaper_app/blob/main/server.js): `server.js`

### Content providers

- [Guardian news](https://github.com/suryani-76/newspaper_app/blob/main/guardian.js): `guardian.js`
- [Film catalog](https://github.com/suryani-76/newspaper_app/blob/main/tmdb.js): `tmdb.js`
- [Fallback articles](https://github.com/suryani-76/newspaper_app/blob/main/server.js): `server.js`

### Persistent state

- [SQLite records](https://github.com/suryani-76/newspaper_app/blob/main/db.js): `db.js`

### Other components

- **Reader**
- **Guardian API**
- **TMDB API**

## Connections

- Reader → Web client: uses (evidence: `app.js`)
- Web client → HTTP API: requests (evidence: `app.js`)
- Web client → Localization: translates (evidence: `translation.js`)
- Web client → Offline shell: loads offline
- HTTP API → News and discovery: routes (evidence: `server.js`)
- HTTP API → Accounts and sessions: routes (evidence: `server.js`)
- HTTP API → Reader interactions: routes (evidence: `server.js`)
- HTTP API → Contributor applications: routes (evidence: `server.js`)
- News and discovery → Guardian news: fetches news (evidence: `server.js`)
- News and discovery → Film catalog: fetches films (evidence: `server.js`)
- News and discovery → Fallback articles: falls back (evidence: `server.js`)
- Guardian news → Guardian API: queries (evidence: `guardian.js`)
- Film catalog → TMDB API: queries (evidence: `tmdb.js`)
- Accounts and sessions → SQLite records: reads/writes (evidence: `server.js`)
- Reader interactions → SQLite records: reads/writes (evidence: `server.js`)
- Contributor applications → SQLite records: reads/writes (evidence: `server.js`)
