# omarg4/ezpc2 architecture

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

- Interactive diagram: https://gitdiagram.com/omarg4/ezpc2
- Repository: https://github.com/omarg4/ezpc2

## Overview

EzPc is a PC-build recommendation app: users choose a budget and performance priority, receive a parts list, and can save or manage builds when signed in. Its backend selects catalog parts from PostgreSQL; a separate update endpoint refreshes that catalog from an external parts-data scraper. The graph follows the evidenced UI-to-API flow and server-owned calls. The README is empty, so capabilities are based on the sampled source; unsampled login and signup implementations are shown without inferred internals.

Main entry points: [`client/src/App.jsx`](https://github.com/omarg4/ezpc2/blob/master/client/src/App.jsx) (App routes), [`client/firebaseconfig.js`](https://github.com/omarg4/ezpc2/blob/master/client/firebaseconfig.js) (Firebase services), [`client/src/pages/Home.jsx`](https://github.com/omarg4/ezpc2/blob/master/client/src/pages/Home.jsx) (Budget and priority), [`server/scrape-cron.js`](https://github.com/omarg4/ezpc2/blob/master/server/scrape-cron.js) (Catalog scraper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Build recommendation"]
  node_home["Budget and priority<br/>[Home.jsx]"]
  node_build_view["Recommended build"]
  node_loading["Loading indicator<br/>[Loading.jsx]"]
end

subgraph group_server["Catalog backend"]
  node_parts_api["Parts endpoint<br/>[index.js]"]
  node_recommendation["Part selection<br/>[suggestedData.js]"]
  node_catalog[("Parts catalog<br/>[db.js]")]
  node_scrape_endpoint["Catalog update endpoint<br/>[index.js]"]
  node_scraper["Catalog scraper<br/>[scrape-cron.js]"]
end

subgraph group_identity["Identity and builds"]
  node_saved_builds["Saved build history<br/>[PreviousBuilds.jsx]"]
  node_firebase[("Firebase services<br/>[firebaseconfig.js]")]
  node_user_context["Signed-in user state<br/>[UserContext.jsx]"]
  node_account_pages["Login and signup"]
end

subgraph group_shell["Application shell"]
  node_app["App routes<br/>[App.jsx]"]
  node_header["Header and logout<br/>[Header.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
end

node_visitor(("PC builder"))
node_parts_source["Parts data source"]

node_visitor -->|"opens app"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_build_view
node_app -->|"routes to"| node_saved_builds
node_app -->|"provides user state"| node_user_context
node_app -->|"renders"| node_header
node_app -->|"renders"| node_footer
node_app -->|"routes to"| node_account_pages
node_home -->|"posts budget allocations"| node_parts_api
node_parts_api -->|"calls"| node_recommendation
node_recommendation -->|"queries parts"| node_catalog
node_home -->|"shows while waiting"| node_loading
node_build_view -->|"reads and saves builds"| node_firebase
node_saved_builds -->|"reads and deletes builds"| node_firebase
node_user_context -->|"observes authentication"| node_firebase
node_header -->|"reads user state"| node_user_context
node_header -->|"signs out"| node_firebase
node_scrape_endpoint -->|"calls"| node_scraper
node_scraper -->|"fetches catalog data"| node_parts_source
node_scraper -->|"replaces catalog rows"| node_catalog

click node_app "https://github.com/omarg4/ezpc2/blob/master/client/src/App.jsx"
click node_home "https://github.com/omarg4/ezpc2/blob/master/client/src/pages/Home.jsx"
click node_parts_api "https://github.com/omarg4/ezpc2/blob/master/server/index.js"
click node_recommendation "https://github.com/omarg4/ezpc2/blob/master/server/suggestedData.js"
click node_catalog "https://github.com/omarg4/ezpc2/blob/master/server/db.js"
click node_build_view "https://github.com/omarg4/ezpc2/blob/master/client/src/pages/RecommendedBuild.jsx"
click node_saved_builds "https://github.com/omarg4/ezpc2/blob/master/client/src/components/PreviousBuilds.jsx"
click node_firebase "https://github.com/omarg4/ezpc2/blob/master/client/firebaseconfig.js"
click node_user_context "https://github.com/omarg4/ezpc2/blob/master/client/src/components/UserContext.jsx"
click node_account_pages "https://github.com/omarg4/ezpc2/tree/master/client/src/pages"
click node_header "https://github.com/omarg4/ezpc2/blob/master/client/src/components/Header.jsx"
click node_footer "https://github.com/omarg4/ezpc2/blob/master/client/src/components/Footer.jsx"
click node_loading "https://github.com/omarg4/ezpc2/blob/master/client/src/components/Loading.jsx"
click node_scrape_endpoint "https://github.com/omarg4/ezpc2/blob/master/server/index.js"
click node_scraper "https://github.com/omarg4/ezpc2/blob/master/server/scrape-cron.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_home,node_build_view,node_loading toneBlue
class node_parts_api,node_recommendation,node_catalog,node_scrape_endpoint,node_scraper toneAmber
class node_saved_builds,node_firebase,node_user_context,node_account_pages toneMint
class node_app,node_header,node_footer toneRose
class node_visitor,node_parts_source toneIndigo
```

## Components

### Build recommendation

- [Budget and priority](https://github.com/omarg4/ezpc2/blob/master/client/src/pages/Home.jsx): `client/src/pages/Home.jsx`
- [Recommended build](https://github.com/omarg4/ezpc2/blob/master/client/src/pages/RecommendedBuild.jsx): `client/src/pages/RecommendedBuild.jsx`
- [Loading indicator](https://github.com/omarg4/ezpc2/blob/master/client/src/components/Loading.jsx): `client/src/components/Loading.jsx`

### Catalog backend

- [Parts endpoint](https://github.com/omarg4/ezpc2/blob/master/server/index.js): `server/index.js`
- [Part selection](https://github.com/omarg4/ezpc2/blob/master/server/suggestedData.js): `server/suggestedData.js`
- [Parts catalog](https://github.com/omarg4/ezpc2/blob/master/server/db.js): `server/db.js`
- [Catalog update endpoint](https://github.com/omarg4/ezpc2/blob/master/server/index.js): `server/index.js`
- [Catalog scraper](https://github.com/omarg4/ezpc2/blob/master/server/scrape-cron.js): `server/scrape-cron.js`

### Identity and builds

- [Saved build history](https://github.com/omarg4/ezpc2/blob/master/client/src/components/PreviousBuilds.jsx): `client/src/components/PreviousBuilds.jsx`
- [Firebase services](https://github.com/omarg4/ezpc2/blob/master/client/firebaseconfig.js): `client/firebaseconfig.js`
- [Signed-in user state](https://github.com/omarg4/ezpc2/blob/master/client/src/components/UserContext.jsx): `client/src/components/UserContext.jsx`
- [Login and signup](https://github.com/omarg4/ezpc2/tree/master/client/src/pages): `client/src/pages`

### Application shell

- [App routes](https://github.com/omarg4/ezpc2/blob/master/client/src/App.jsx): `client/src/App.jsx`
- [Header and logout](https://github.com/omarg4/ezpc2/blob/master/client/src/components/Header.jsx): `client/src/components/Header.jsx`
- [Footer](https://github.com/omarg4/ezpc2/blob/master/client/src/components/Footer.jsx): `client/src/components/Footer.jsx`

### Other components

- **PC builder**
- **Parts data source**

## Connections

- PC builder → App routes: opens app (evidence: `client/src/App.jsx`)
- App routes → Budget and priority: routes to (evidence: `client/src/App.jsx`)
- App routes → Recommended build: routes to (evidence: `client/src/App.jsx`)
- App routes → Saved build history: routes to (evidence: `client/src/App.jsx`)
- App routes → Signed-in user state: provides user state (evidence: `client/src/App.jsx`)
- App routes → Header and logout: renders (evidence: `client/src/App.jsx`)
- App routes → Footer: renders (evidence: `client/src/App.jsx`)
- App routes → Login and signup: routes to (evidence: `client/src/App.jsx`)
- Budget and priority → Parts endpoint: posts budget allocations (evidence: `client/src/pages/Home.jsx`)
- Parts endpoint → Part selection: calls (evidence: `server/index.js`)
- Part selection → Parts catalog: queries parts (evidence: `server/suggestedData.js`)
- Budget and priority → Loading indicator: shows while waiting (evidence: `client/src/pages/Home.jsx`)
- Recommended build → Firebase services: reads and saves builds (evidence: `client/src/pages/RecommendedBuild.jsx`)
- Saved build history → Firebase services: reads and deletes builds (evidence: `client/src/components/PreviousBuilds.jsx`)
- Signed-in user state → Firebase services: observes authentication (evidence: `client/src/components/UserContext.jsx`)
- Header and logout → Signed-in user state: reads user state (evidence: `client/src/components/Header.jsx`)
- Header and logout → Firebase services: signs out (evidence: `client/src/components/Header.jsx`)
- Catalog update endpoint → Catalog scraper: calls (evidence: `server/index.js`)
- Catalog scraper → Parts data source: fetches catalog data (evidence: `server/scrape-cron.js`)
- Catalog scraper → Parts catalog: replaces catalog rows (evidence: `server/scrape-cron.js`)
