# itsankitpatel/productify architecture

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

- Interactive diagram: https://gitdiagram.com/itsankitpatel/productify
- Repository: https://github.com/itsankitpatel/productify

## Overview

Productify is a browser-based product manager with login and product CRUD. The user logs in through the external authentication API, reaches the protected home page, and manages products through the dashboard; product search and sample-data reset are additional capabilities. Zustand holds shared product and form-visibility state, while browser local storage persists user credentials and product data. The README documents routing and listing capabilities, but App.jsx and AllProducts.jsx were not excerpted, so their internal wiring is shown only where documented.

Main entry points: [`src/components/Login.jsx`](https://github.com/itsankitpatel/productify/blob/main/src/components/Login.jsx) (Login Form), [`src/App.jsx`](https://github.com/itsankitpatel/productify/blob/main/src/App.jsx) (App Router), [`src/components/Home/Home.jsx`](https://github.com/itsankitpatel/productify/blob/main/src/components/Home/Home.jsx) (Product Dashboard), [`src/components/Home/AllProducts.jsx`](https://github.com/itsankitpatel/productify/blob/main/src/components/Home/AllProducts.jsx) (Product Listing and CRUD)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App and Routing"]
  node_app["App Router<br/>[App.jsx]"]
  node_layout["Shared Layout<br/>[Layout.jsx]"]
  node_routeguards["Route Guards<br/>[ProtectRoutes.jsx]"]
  node_catchall["Fallback Routing<br/>[CatchAllRoutes.jsx]"]
  node_loginredirect["Login Redirect<br/>[RedirectRoute.jsx]"]
end

subgraph group_account["Account Access"]
  node_login["Login Form<br/>[Login.jsx]"]
  node_reqres["Reqres Login API"]
  node_navbar["Navigation and Logout<br/>[Navbar.jsx]"]
  node_demohelp["Demo Credentials Help<br/>[Info.jsx]"]
end

subgraph group_products["Product Management"]
  node_home["Product Dashboard<br/>[Home.jsx]"]
  node_addproduct["Add Product Form<br/>[AddProduct.jsx]"]
  node_listing["Product Listing and CRUD<br/>[AllProducts.jsx]"]
  node_search["Product Search<br/>[Home.jsx]"]
  node_sampledata["Sample Product Data"]
end

subgraph group_state["State and Persistence"]
  node_productstate["Shared Product State<br/>[useProductStore.js]"]
  node_browserstorage[("Browser Local Storage")]
end

node_user(("User"))

node_user -->|"opens app"| node_app
node_app -.->|"renders layout"| node_layout
node_app -->|"protects home"| node_routeguards
node_app -->|"redirects logged-in"| node_loginredirect
node_app -->|"handles unknown routes"| node_catchall
node_user -->|"submits credentials"| node_login
node_login -->|"posts credentials"| node_reqres
node_login -->|"stores user token"| node_browserstorage
node_navbar -->|"reads and clears user"| node_browserstorage
node_login -->|"navigates after login"| node_home
node_navbar -->|"navigates on logout"| node_login
node_login -->|"renders credentials help"| node_demohelp
node_home -->|"renders conditionally"| node_addproduct
node_home -->|"renders listing"| node_listing
node_home -->|"reads shared state"| node_productstate
node_addproduct -->|"reads shared state"| node_productstate
node_addproduct -->|"writes product data"| node_browserstorage
node_home -->|"filters products"| node_search
node_user -->|"manages products"| node_listing
node_user -->|"searches by name"| node_search
node_user -->|"requests sample reset"| node_sampledata
node_sampledata -.->|"supplies reset products"| node_listing
node_listing -.->|"persists product data"| node_browserstorage

click node_app "https://github.com/itsankitpatel/productify/blob/main/src/App.jsx"
click node_layout "https://github.com/itsankitpatel/productify/blob/main/src/Layout.jsx"
click node_routeguards "https://github.com/itsankitpatel/productify/blob/main/src/components/ProtectRoutes.jsx"
click node_catchall "https://github.com/itsankitpatel/productify/blob/main/src/components/CatchAllRoutes.jsx"
click node_loginredirect "https://github.com/itsankitpatel/productify/blob/main/src/components/RedirectRoute.jsx"
click node_login "https://github.com/itsankitpatel/productify/blob/main/src/components/Login.jsx"
click node_navbar "https://github.com/itsankitpatel/productify/blob/main/src/components/Navbar.jsx"
click node_demohelp "https://github.com/itsankitpatel/productify/blob/main/src/components/Info.jsx"
click node_home "https://github.com/itsankitpatel/productify/blob/main/src/components/Home/Home.jsx"
click node_addproduct "https://github.com/itsankitpatel/productify/blob/main/src/components/Home/AddProduct.jsx"
click node_listing "https://github.com/itsankitpatel/productify/blob/main/src/components/Home/AllProducts.jsx"
click node_search "https://github.com/itsankitpatel/productify/blob/main/src/components/Home/Home.jsx"
click node_sampledata "https://github.com/itsankitpatel/productify/blob/main/src/utils/productSampleData.js"
click node_productstate "https://github.com/itsankitpatel/productify/blob/main/src/store/useProductStore.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_app,node_layout,node_routeguards,node_catchall,node_loginredirect,node_user toneBlue
class node_login,node_reqres,node_navbar,node_demohelp toneAmber
class node_home,node_addproduct,node_listing,node_search,node_sampledata toneMint
class node_productstate,node_browserstorage toneRose
```

## Components

### App and Routing

- [App Router](https://github.com/itsankitpatel/productify/blob/main/src/App.jsx): `src/App.jsx`
- [Shared Layout](https://github.com/itsankitpatel/productify/blob/main/src/Layout.jsx): `src/Layout.jsx`
- [Route Guards](https://github.com/itsankitpatel/productify/blob/main/src/components/ProtectRoutes.jsx): `src/components/ProtectRoutes.jsx`
- [Fallback Routing](https://github.com/itsankitpatel/productify/blob/main/src/components/CatchAllRoutes.jsx): `src/components/CatchAllRoutes.jsx`
- [Login Redirect](https://github.com/itsankitpatel/productify/blob/main/src/components/RedirectRoute.jsx): `src/components/RedirectRoute.jsx`

### Account Access

- [Login Form](https://github.com/itsankitpatel/productify/blob/main/src/components/Login.jsx): `src/components/Login.jsx`
- **Reqres Login API**
- [Navigation and Logout](https://github.com/itsankitpatel/productify/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Demo Credentials Help](https://github.com/itsankitpatel/productify/blob/main/src/components/Info.jsx): `src/components/Info.jsx`

### Product Management

- [Product Dashboard](https://github.com/itsankitpatel/productify/blob/main/src/components/Home/Home.jsx): `src/components/Home/Home.jsx`
- [Add Product Form](https://github.com/itsankitpatel/productify/blob/main/src/components/Home/AddProduct.jsx): `src/components/Home/AddProduct.jsx`
- [Product Listing and CRUD](https://github.com/itsankitpatel/productify/blob/main/src/components/Home/AllProducts.jsx): `src/components/Home/AllProducts.jsx`
- [Product Search](https://github.com/itsankitpatel/productify/blob/main/src/components/Home/Home.jsx): `src/components/Home/Home.jsx`
- [Sample Product Data](https://github.com/itsankitpatel/productify/blob/main/src/utils/productSampleData.js): `src/utils/productSampleData.js`

### State and Persistence

- [Shared Product State](https://github.com/itsankitpatel/productify/blob/main/src/store/useProductStore.js): `src/store/useProductStore.js`
- **Browser Local Storage**

### Other components

- **User**

## Connections

- User → App Router: opens app (evidence: `README.md`)
- App Router → Shared Layout: renders layout
- App Router → Route Guards: protects home (evidence: `README.md`)
- App Router → Login Redirect: redirects logged-in (evidence: `README.md`)
- App Router → Fallback Routing: handles unknown routes (evidence: `README.md`)
- User → Login Form: submits credentials (evidence: `src/components/Login.jsx`)
- Login Form → Reqres Login API: posts credentials (evidence: `src/components/Login.jsx`)
- Login Form → Browser Local Storage: stores user token (evidence: `src/components/Login.jsx`)
- Navigation and Logout → Browser Local Storage: reads and clears user (evidence: `src/components/Navbar.jsx`)
- Login Form → Product Dashboard: navigates after login (evidence: `src/components/Login.jsx`)
- Navigation and Logout → Login Form: navigates on logout (evidence: `src/components/Navbar.jsx`)
- Login Form → Demo Credentials Help: renders credentials help (evidence: `src/components/Login.jsx`)
- Product Dashboard → Add Product Form: renders conditionally (evidence: `src/components/Home/Home.jsx`)
- Product Dashboard → Product Listing and CRUD: renders listing (evidence: `src/components/Home/Home.jsx`)
- Product Dashboard → Shared Product State: reads shared state (evidence: `src/components/Home/Home.jsx`)
- Add Product Form → Shared Product State: reads shared state (evidence: `src/components/Home/AddProduct.jsx`)
- Add Product Form → Browser Local Storage: writes product data (evidence: `src/components/Home/AddProduct.jsx`)
- Product Dashboard → Product Search: filters products (evidence: `src/components/Home/Home.jsx`)
- User → Product Listing and CRUD: manages products (evidence: `README.md`)
- User → Product Search: searches by name (evidence: `README.md`)
- User → Sample Product Data: requests sample reset (evidence: `README.md`)
- Sample Product Data → Product Listing and CRUD: supplies reset products
- Product Listing and CRUD → Browser Local Storage: persists product data
