# yannkosal/news-app architecture

> Architecture diagram of the GitHub repository yannkosal/news-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yannkosal/news-app
- Repository: https://github.com/yannkosal/news-app
- Video tour (about a minute): https://gitdiagram.com/yannkosal/news-app/video

## Overview

This is a Flutter news-reading app: users browse headlines and categories, then open an article. The README documents live NewsAPI fetching and article links; the file tree identifies the UI pages, services, and models. The sampled source contains platform launchers rather than Dart runtime code, so internal page-to-service wiring is inferred only at a high level; uncertain links are omitted.

Main entry points: [`lib/pages/home.dart`](https://github.com/yannkosal/news-app/blob/main/lib/pages/home.dart) (Home feed), [`lib/service/news.dart`](https://github.com/yannkosal/news-app/blob/main/lib/service/news.dart) (News service), [`lib/main.dart`](https://github.com/yannkosal/news-app/blob/main/lib/main.dart) (App entry), [`lib/pages/category.dart`](https://github.com/yannkosal/news-app/blob/main/lib/pages/category.dart) (Category view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Reader experience"]
  node_app["App entry<br/>[main.dart]"]
  node_onboarding["Onboarding<br/>[onboarding.dart]"]
  node_home["Home feed<br/>[home.dart]"]
  node_category["Category view<br/>[category.dart]"]
  node_tile["Category tile<br/>[category_tile.dart]"]
  node_article["Article view<br/>[article_view.dart]"]
end

subgraph group_services["News services"]
  node_news["News service<br/>[news.dart]"]
  node_category_data["Category data<br/>[data.dart]"]
  node_show_category["Category service<br/>[show_category.dart]"]
end

subgraph group_models["News data models"]
  node_article_model["Article model<br/>[article_model.dart]"]
  node_category_model["Category model"]
  node_show_category_model["Shown category model"]
end

node_reader(("Reader"))
node_newsapi{{"NewsAPI"}}
node_web_article{{"Article links"}}

node_reader -->|"launches"| node_app
node_app -->|"starts"| node_onboarding
node_reader -->|"browses"| node_home
node_reader -->|"selects category"| node_category
node_home -->|"fetches headlines"| node_news
node_news -->|"requests news"| node_newsapi
node_home -->|"loads categories"| node_category_data
node_category -->|"loads category news"| node_show_category
node_reader -->|"opens article"| node_article
node_article -.->|"opens link"| node_web_article
node_news -->|"parses articles"| node_article_model
node_category_data -->|"provides categories"| node_category_model
node_show_category -->|"provides categories"| node_show_category_model
node_home -->|"shows categories"| node_tile

click node_app "https://github.com/yannkosal/news-app/blob/main/lib/main.dart"
click node_onboarding "https://github.com/yannkosal/news-app/blob/main/lib/pages/onboarding.dart"
click node_home "https://github.com/yannkosal/news-app/blob/main/lib/pages/home.dart"
click node_category "https://github.com/yannkosal/news-app/blob/main/lib/pages/category.dart"
click node_tile "https://github.com/yannkosal/news-app/blob/main/lib/components/category_tile.dart"
click node_article "https://github.com/yannkosal/news-app/blob/main/lib/pages/article_view.dart"
click node_news "https://github.com/yannkosal/news-app/blob/main/lib/service/news.dart"
click node_category_data "https://github.com/yannkosal/news-app/blob/main/lib/service/data.dart"
click node_show_category "https://github.com/yannkosal/news-app/blob/main/lib/service/show_category.dart"
click node_article_model "https://github.com/yannkosal/news-app/blob/main/lib/models/article_model.dart"
click node_category_model "https://github.com/yannkosal/news-app/blob/main/lib/models/category_model.dart"
click node_show_category_model "https://github.com/yannkosal/news-app/blob/main/lib/models/show_category_model.dart"

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_onboarding,node_home,node_category,node_tile,node_article toneBlue
class node_news,node_category_data,node_show_category toneAmber
class node_article_model,node_category_model,node_show_category_model,node_newsapi toneMint
class node_reader,node_web_article toneIndigo
```

## Components

### Reader experience

- [App entry](https://github.com/yannkosal/news-app/blob/main/lib/main.dart): `lib/main.dart`
- [Onboarding](https://github.com/yannkosal/news-app/blob/main/lib/pages/onboarding.dart): `lib/pages/onboarding.dart`
- [Home feed](https://github.com/yannkosal/news-app/blob/main/lib/pages/home.dart): `lib/pages/home.dart`
- [Category view](https://github.com/yannkosal/news-app/blob/main/lib/pages/category.dart): `lib/pages/category.dart`
- [Category tile](https://github.com/yannkosal/news-app/blob/main/lib/components/category_tile.dart): `lib/components/category_tile.dart`
- [Article view](https://github.com/yannkosal/news-app/blob/main/lib/pages/article_view.dart): `lib/pages/article_view.dart`

### News services

- [News service](https://github.com/yannkosal/news-app/blob/main/lib/service/news.dart): `lib/service/news.dart`
- [Category data](https://github.com/yannkosal/news-app/blob/main/lib/service/data.dart): `lib/service/data.dart`
- [Category service](https://github.com/yannkosal/news-app/blob/main/lib/service/show_category.dart): `lib/service/show_category.dart`

### News data models

- [Article model](https://github.com/yannkosal/news-app/blob/main/lib/models/article_model.dart): `lib/models/article_model.dart`
- [Category model](https://github.com/yannkosal/news-app/blob/main/lib/models/category_model.dart): `lib/models/category_model.dart`
- [Shown category model](https://github.com/yannkosal/news-app/blob/main/lib/models/show_category_model.dart): `lib/models/show_category_model.dart`

### Other components

- **Reader**
- **NewsAPI**
- **Article links**

## Connections

- Reader → App entry: launches
- App entry → Onboarding: starts
- Reader → Home feed: browses
- Reader → Category view: selects category
- Home feed → News service: fetches headlines
- News service → NewsAPI: requests news
- Home feed → Category data: loads categories
- Category view → Category service: loads category news
- Reader → Article view: opens article
- Article view → Article links: opens link
- News service → Article model: parses articles
- Category data → Category model: provides categories
- Category service → Shown category model: provides categories
- Home feed → Category tile: shows categories
