# sushensanthush/plant_lk_admin architecture

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

- Interactive diagram: https://gitdiagram.com/sushensanthush/plant_lk_admin
- Repository: https://github.com/sushensanthush/plant_lk_admin

## Overview

Plant.LK Admin is a browser-based management dashboard for the Plant.LK commerce ecosystem. Administrators sign in, enter a session-checked dashboard, and manage operational data alongside overview metrics. The main runtime module also handles theme state and uses Firebase services for authentication, Firestore records, and uploaded images. The README documents feature areas beyond the sampled implementation excerpts; those are included, but edges are limited to relationships supported by excerpts or documentation.

Main entry points: [`js/dashboard.js`](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js) (Dashboard Runtime), [`js/firebase-config.js`](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/firebase-config.js) (Firebase Setup), [`js/login.js`](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/login.js) (Sign-in Logic), [`login.html`](https://github.com/sushensanthush/plant_lk_admin/blob/main/login.html) (Login Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access &amp; Dashboard"]
  node_login["Login Page<br/>[login.html]"]
  node_login_logic["Sign-in Logic<br/>[login.js]"]
  node_dashboard["Admin Dashboard<br/>[dashboard.html]"]
  node_dashboard_runtime["Dashboard Runtime<br/>[dashboard.js]"]
  node_theme["Theme State<br/>[dashboard.js]"]
end

subgraph group_operations["Store Operations"]
  node_overview["Overview &amp; Metrics<br/>[dashboard.js]"]
  node_products["Product Catalog<br/>[dashboard.js]"]
  node_categories["Categories<br/>[dashboard.js]"]
  node_nurseries["Nurseries<br/>[dashboard.js]"]
  node_orders["Order Tracking<br/>[dashboard.js]"]
  node_messages["Customer Messages<br/>[dashboard.js]"]
  node_users["User Accounts<br/>[dashboard.js]"]
end

subgraph group_services["Firebase Services"]
  node_firebase_config["Firebase Setup<br/>[firebase-config.js]"]
  node_firebase_auth["Firebase Auth"]
  node_firestore[("Cloud Firestore")]
  node_storage[("Firebase Storage")]
end

node_admin(("Administrator"))

node_admin -->|"opens"| node_login
node_login -->|"runs"| node_login_logic
node_login_logic -->|"imports"| node_firebase_config
node_login_logic -->|"signs in"| node_firebase_auth
node_login_logic -->|"redirects to"| node_dashboard
node_dashboard -->|"runs"| node_dashboard_runtime
node_dashboard_runtime -->|"imports"| node_firebase_config
node_dashboard_runtime -->|"checks session"| node_firebase_auth
node_dashboard_runtime -->|"redirects to"| node_login
node_dashboard_runtime -->|"loads"| node_overview
node_dashboard_runtime -->|"manages"| node_products
node_dashboard_runtime -->|"manages"| node_categories
node_dashboard_runtime -->|"manages"| node_nurseries
node_dashboard_runtime -->|"manages"| node_orders
node_dashboard_runtime -->|"displays"| node_messages
node_dashboard_runtime -->|"manages"| node_users
node_dashboard_runtime -->|"loads"| node_theme
node_firebase_config -->|"initializes"| node_firebase_auth
node_firebase_config -->|"initializes"| node_firestore
node_firebase_config -->|"initializes"| node_storage
node_overview -->|"reads counts"| node_firestore
node_overview -->|"reads recent"| node_orders
node_overview -->|"reads recent"| node_messages
node_products -->|"reads/writes"| node_firestore
node_products -->|"uploads images"| node_storage
node_categories -->|"reads/writes"| node_firestore
node_categories -->|"uploads images"| node_storage
node_nurseries -->|"writes"| node_firestore
node_orders -->|"reads/updates"| node_firestore
node_users -->|"reads/updates"| node_firestore
node_users -->|"uploads images"| node_storage

click node_login "https://github.com/sushensanthush/plant_lk_admin/blob/main/login.html"
click node_login_logic "https://github.com/sushensanthush/plant_lk_admin/blob/main/js/login.js"
click node_dashboard "https://github.com/sushensanthush/plant_lk_admin/blob/main/dashboard.html"
click node_dashboard_runtime "https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js"
click node_overview "https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js"
click node_products "https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js"
click node_categories "https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js"
click node_nurseries "https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js"
click node_orders "https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js"
click node_messages "https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js"
click node_users "https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js"
click node_theme "https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js"
click node_firebase_config "https://github.com/sushensanthush/plant_lk_admin/blob/main/js/firebase-config.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_login,node_login_logic,node_dashboard,node_dashboard_runtime,node_theme toneBlue
class node_overview,node_products,node_categories,node_nurseries,node_orders,node_messages,node_users toneAmber
class node_firebase_config,node_firebase_auth,node_firestore,node_storage toneMint
class node_admin toneIndigo
```

## Components

### Access & Dashboard

- [Login Page](https://github.com/sushensanthush/plant_lk_admin/blob/main/login.html): `login.html`
- [Sign-in Logic](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/login.js): `js/login.js`
- [Admin Dashboard](https://github.com/sushensanthush/plant_lk_admin/blob/main/dashboard.html): `dashboard.html`
- [Dashboard Runtime](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js): `js/dashboard.js`
- [Theme State](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js): `js/dashboard.js`

### Store Operations

- [Overview & Metrics](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js): `js/dashboard.js`
- [Product Catalog](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js): `js/dashboard.js`
- [Categories](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js): `js/dashboard.js`
- [Nurseries](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js): `js/dashboard.js`
- [Order Tracking](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js): `js/dashboard.js`
- [Customer Messages](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js): `js/dashboard.js`
- [User Accounts](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/dashboard.js): `js/dashboard.js`

### Firebase Services

- [Firebase Setup](https://github.com/sushensanthush/plant_lk_admin/blob/main/js/firebase-config.js): `js/firebase-config.js`
- **Firebase Auth**
- **Cloud Firestore**
- **Firebase Storage**

### Other components

- **Administrator**

## Connections

- Administrator → Login Page: opens (evidence: `README.md`)
- Login Page → Sign-in Logic: runs (evidence: `js/login.js`)
- Sign-in Logic → Firebase Setup: imports (evidence: `js/login.js`)
- Sign-in Logic → Firebase Auth: signs in (evidence: `js/login.js`)
- Sign-in Logic → Admin Dashboard: redirects to (evidence: `js/login.js`)
- Admin Dashboard → Dashboard Runtime: runs (evidence: `README.md`)
- Dashboard Runtime → Firebase Setup: imports (evidence: `js/dashboard.js`)
- Dashboard Runtime → Firebase Auth: checks session (evidence: `js/dashboard.js`)
- Dashboard Runtime → Login Page: redirects to (evidence: `js/dashboard.js`)
- Dashboard Runtime → Overview & Metrics: loads (evidence: `js/dashboard.js`)
- Dashboard Runtime → Product Catalog: manages (evidence: `js/dashboard.js`)
- Dashboard Runtime → Categories: manages (evidence: `js/dashboard.js`)
- Dashboard Runtime → Nurseries: manages (evidence: `js/dashboard.js`)
- Dashboard Runtime → Order Tracking: manages (evidence: `js/dashboard.js`)
- Dashboard Runtime → Customer Messages: displays (evidence: `js/dashboard.js`)
- Dashboard Runtime → User Accounts: manages (evidence: `js/dashboard.js`)
- Dashboard Runtime → Theme State: loads (evidence: `js/dashboard.js`)
- Firebase Setup → Firebase Auth: initializes (evidence: `js/firebase-config.js`)
- Firebase Setup → Cloud Firestore: initializes (evidence: `js/firebase-config.js`)
- Firebase Setup → Firebase Storage: initializes (evidence: `js/firebase-config.js`)
- Overview & Metrics → Cloud Firestore: reads counts (evidence: `js/dashboard.js`)
- Overview & Metrics → Order Tracking: reads recent (evidence: `js/dashboard.js`)
- Overview & Metrics → Customer Messages: reads recent (evidence: `js/dashboard.js`)
- Product Catalog → Cloud Firestore: reads/writes (evidence: `js/dashboard.js`)
- Product Catalog → Firebase Storage: uploads images (evidence: `js/dashboard.js`)
- Categories → Cloud Firestore: reads/writes (evidence: `js/dashboard.js`)
- Categories → Firebase Storage: uploads images (evidence: `js/dashboard.js`)
- Nurseries → Cloud Firestore: writes (evidence: `js/dashboard.js`)
- Order Tracking → Cloud Firestore: reads/updates (evidence: `js/dashboard.js`)
- User Accounts → Cloud Firestore: reads/updates (evidence: `js/dashboard.js`)
- User Accounts → Firebase Storage: uploads images (evidence: `js/dashboard.js`)
