# azharsheikh-ruby/netlify-sites-frontend-challenge architecture

> Architecture diagram of the GitHub repository azharsheikh-ruby/netlify-sites-frontend-challenge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azharsheikh-ruby/netlify-sites-frontend-challenge
- Repository: https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge

## Overview

This is a React Sites List frontend for viewing and managing sites by team. On startup, the app fetches teams and sites; users can select a team, search, sort, page through results, open a site, toggle favorites, and add sites. App.js owns the state and these behaviors, while the Axios client handles API requests and json-server persists data in the local JSON database. The README documents the major capabilities and API; the graph reflects the sampled App.js and client rather than inferring unsampled UI modules.

Main entry points: [`src/App.js`](https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/App.js) (App state and orchestration), [`src/api/client.js`](https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/api/client.js) (Axios API client), [`src/data/db.json`](https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/data/db.json) (Sites and teams data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Sites List experience"]
  node_app["App state and orchestration<br/>[App.js]"]
  node_team["Team selection<br/>[App.js]"]
  node_site_view["Search, sort, pagination<br/>[App.js]"]
  node_site_card["Site cards and navigation<br/>[App.js]"]
  node_favorites["Favorite toggling<br/>[App.js]"]
  node_add_site["Add site form<br/>[App.js]"]
end

subgraph group_data["API and persistence"]
  node_api_client["Axios API client<br/>[client.js]"]
  node_json_server["json-server API"]
  node_database[("Sites and teams data<br/>[db.json]")]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"requests data"| node_api_client
node_app -->|"selects team"| node_team
node_app -->|"derives results"| node_site_view
node_app -->|"renders sites"| node_site_card
node_app -->|"toggles favorite"| node_favorites
node_app -->|"submits site"| node_add_site
node_api_client -->|"sends requests"| node_json_server
node_json_server -->|"persists data"| node_database

click node_app "https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/App.js"
click node_team "https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/App.js"
click node_site_view "https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/App.js"
click node_site_card "https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/App.js"
click node_favorites "https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/App.js"
click node_add_site "https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/App.js"
click node_api_client "https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/api/client.js"
click node_database "https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/data/db.json"

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_team,node_site_view,node_site_card,node_favorites,node_add_site,node_user toneBlue
class node_api_client,node_json_server,node_database toneAmber
```

## Components

### Sites List experience

- [App state and orchestration](https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/App.js): `src/App.js`
- [Team selection](https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/App.js): `src/App.js`
- [Search, sort, pagination](https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/App.js): `src/App.js`
- [Site cards and navigation](https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/App.js): `src/App.js`
- [Favorite toggling](https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/App.js): `src/App.js`
- [Add site form](https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/App.js): `src/App.js`

### API and persistence

- [Axios API client](https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/api/client.js): `src/api/client.js`
- **json-server API**
- [Sites and teams data](https://github.com/azharsheikh-ruby/netlify-sites-frontend-challenge/blob/main/src/data/db.json): `src/data/db.json`

### Other components

- **User**

## Connections

- User → App state and orchestration: uses (evidence: `README.md`)
- App state and orchestration → Axios API client: requests data (evidence: `src/App.js`)
- App state and orchestration → Team selection: selects team (evidence: `src/App.js`)
- App state and orchestration → Search, sort, pagination: derives results (evidence: `src/App.js`)
- App state and orchestration → Site cards and navigation: renders sites (evidence: `src/App.js`)
- App state and orchestration → Favorite toggling: toggles favorite (evidence: `src/App.js`)
- App state and orchestration → Add site form: submits site (evidence: `src/App.js`)
- Axios API client → json-server API: sends requests (evidence: `src/api/client.js`)
- json-server API → Sites and teams data: persists data (evidence: `README.md`)
