# sdushan/redux_saga_example architecture

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

## Overview

This React Native Redux-Saga example fetches products and displays them. The screen dispatches a fetch request; a saga calls the products service and emits success or failure actions, and Redux state drives the product list, loading indicator, or error message. The graph separates UI, orchestration, and state. Some Redux middleware/action routing is runtime wiring rather than a direct source-level call, so those links are marked unverified; native debug tooling is excluded.

Main entry points: [`src/screens/ProductsScreen.js`](https://github.com/sdushan/redux_saga_example/blob/master/src/screens/ProductsScreen.js) (Products screen), [`src/App.js`](https://github.com/sdushan/redux_saga_example/blob/master/src/App.js) (Redux store), [`src/sagas/productsSagas.js`](https://github.com/sdushan/redux_saga_example/blob/master/src/sagas/productsSagas.js) (Fetch watcher), [`src/sagas/rootSaga.js`](https://github.com/sdushan/redux_saga_example/blob/master/src/sagas/rootSaga.js) (Root saga)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Product UI"]
  node_screen["Products screen<br/>[ProductsScreen.js]"]
end

subgraph group_flow["Request Flow"]
  node_app["App setup<br/>[App.js]"]
  node_actions["Product actions<br/>[index.js]"]
  node_saga["Root saga<br/>[rootSaga.js]"]
  node_watcher["Fetch watcher<br/>[productsSagas.js]"]
  node_worker["Fetch worker<br/>[productsSagas.js]"]
  node_service["Products service"]
end

subgraph group_state["Redux State"]
  node_store["Redux store<br/>[App.js]"]
  node_reducer["Products reducer<br/>[productsReducer.js]"]
  node_rootreducer["Root reducer<br/>[index.js]"]
end

node_user(("App user"))
node_api["Product API"]

node_user -->|"views"| node_screen
node_screen -->|"dispatches"| node_actions
node_app -->|"creates"| node_store
node_app -->|"provides store"| node_screen
node_app -->|"runs"| node_saga
node_saga -->|"starts"| node_watcher
node_watcher -->|"takes latest"| node_worker
node_worker -->|"calls"| node_service
node_service -->|"requests"| node_api
node_rootreducer -->|"combines"| node_reducer
node_screen -->|"reads state"| node_store
node_store -.->|"reduces actions"| node_rootreducer
node_watcher -.->|"dispatches results"| node_store

click node_app "https://github.com/sdushan/redux_saga_example/blob/master/src/App.js"
click node_screen "https://github.com/sdushan/redux_saga_example/blob/master/src/screens/ProductsScreen.js"
click node_actions "https://github.com/sdushan/redux_saga_example/blob/master/src/actions/products/index.js"
click node_saga "https://github.com/sdushan/redux_saga_example/blob/master/src/sagas/rootSaga.js"
click node_watcher "https://github.com/sdushan/redux_saga_example/blob/master/src/sagas/productsSagas.js"
click node_worker "https://github.com/sdushan/redux_saga_example/blob/master/src/sagas/productsSagas.js"
click node_service "https://github.com/sdushan/redux_saga_example/blob/master/src/services/productsServices.js"
click node_store "https://github.com/sdushan/redux_saga_example/blob/master/src/App.js"
click node_reducer "https://github.com/sdushan/redux_saga_example/blob/master/src/reducers/productsReducer.js"
click node_rootreducer "https://github.com/sdushan/redux_saga_example/blob/master/src/reducers/index.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_screen,node_user toneBlue
class node_app,node_actions,node_saga,node_watcher,node_worker,node_service toneAmber
class node_store,node_reducer,node_rootreducer,node_api toneMint
```

## Components

### Product UI

- [Products screen](https://github.com/sdushan/redux_saga_example/blob/master/src/screens/ProductsScreen.js): `src/screens/ProductsScreen.js`

### Request Flow

- [App setup](https://github.com/sdushan/redux_saga_example/blob/master/src/App.js): `src/App.js`
- [Product actions](https://github.com/sdushan/redux_saga_example/blob/master/src/actions/products/index.js): `src/actions/products/index.js`
- [Root saga](https://github.com/sdushan/redux_saga_example/blob/master/src/sagas/rootSaga.js): `src/sagas/rootSaga.js`
- [Fetch watcher](https://github.com/sdushan/redux_saga_example/blob/master/src/sagas/productsSagas.js): `src/sagas/productsSagas.js`
- [Fetch worker](https://github.com/sdushan/redux_saga_example/blob/master/src/sagas/productsSagas.js): `src/sagas/productsSagas.js`
- [Products service](https://github.com/sdushan/redux_saga_example/blob/master/src/services/productsServices.js): `src/services/productsServices.js`

### Redux State

- [Redux store](https://github.com/sdushan/redux_saga_example/blob/master/src/App.js): `src/App.js`
- [Products reducer](https://github.com/sdushan/redux_saga_example/blob/master/src/reducers/productsReducer.js): `src/reducers/productsReducer.js`
- [Root reducer](https://github.com/sdushan/redux_saga_example/blob/master/src/reducers/index.js): `src/reducers/index.js`

### Other components

- **App user**
- **Product API**

## Connections

- App user → Products screen: views (evidence: `src/screens/ProductsScreen.js`)
- Products screen → Product actions: dispatches (evidence: `src/screens/ProductsScreen.js`)
- App setup → Redux store: creates (evidence: `src/App.js`)
- App setup → Products screen: provides store (evidence: `src/App.js`)
- App setup → Root saga: runs (evidence: `src/App.js`)
- Root saga → Fetch watcher: starts (evidence: `src/sagas/rootSaga.js`)
- Fetch watcher → Fetch worker: takes latest (evidence: `src/sagas/productsSagas.js`)
- Fetch worker → Products service: calls (evidence: `src/sagas/productsSagas.js`)
- Products service → Product API: requests (evidence: `src/services/productsServices.js`)
- Root reducer → Products reducer: combines (evidence: `src/reducers/index.js`)
- Products screen → Redux store: reads state (evidence: `src/screens/ProductsScreen.js`)
- Redux store → Root reducer: reduces actions (evidence: `src/App.js`)
- Fetch watcher → Redux store: dispatches results
