# ivandelacruz14/rainchem-fullstack architecture

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

- Interactive diagram: https://gitdiagram.com/ivandelacruz14/rainchem-fullstack
- Repository: https://github.com/ivandelacruz14/rainchem-fullstack

## Overview

Rainchem is a motorcycle-parts and lubricant storefront with a React client, Flask API, MySQL persistence, and an admin dashboard. The main customer journey is browsing products or services, building a cart, checking out, then tracking an order and viewing its receipt; admins manage orders and catalog content. The README also documents bulk pricing, payment options, Google sign-in, and a knowledge-base chatbot. Some route and service implementations were not excerpted, so uncertain backend call links are omitted or marked unverified.

Main entry points: [`frontend/src/api/client.js`](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/api/client.js) (API client), [`frontend/src/App.jsx`](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/App.jsx) (Route app), [`backend/app/routes/orders.py`](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/routes/orders.py) (Order and payment API), [`backend/app/models/order.py`](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/models/order.py) (Domain models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer storefront"]
  node_app["Route app<br/>[App.jsx]"]
  node_catalog["Browse catalog<br/>[Services.jsx]"]
  node_cart["Cart and pricing<br/>[CartContext.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_account["Account journey"]
  node_orderresults["Payment and receipt<br/>[OrderSuccess.jsx]"]
  node_authui["Customer authentication<br/>[AuthContext.jsx]"]
  node_api["API client<br/>[client.js]"]
end

subgraph group_admin["Admin operations"]
  node_adminui["Admin dashboard<br/>[Orders.jsx]"]
  node_knowledgeui["Knowledge and chat monitor<br/>[Knowledge.jsx]"]
  node_adminauth["Admin authentication"]
end

subgraph group_backend["Backend services"]
  node_catalogapi["Product API<br/>[products.py]"]
  node_orderapi["Order and payment API<br/>[orders.py]"]
  node_authapi["Customer auth API<br/>[auth.py]"]
  node_adminapi["Admin API<br/>[admin_orders.py]"]
  node_chatapi["Chat API<br/>[chat.py]"]
  node_pricing["Pricing rules<br/>[pricing.py]"]
  node_rag["Knowledge retrieval<br/>[rag.py]"]
  node_payments["Payment integration<br/>[paymongo.py]"]
  node_receipts["Receipt service<br/>[receipt_service.py]"]
  node_email["Email notifications<br/>[email_service.py]"]
  node_google["Google sign-in<br/>[google_auth.py]"]
end

subgraph group_data["Domain data"]
  node_models["Domain models<br/>[order.py]"]
  node_mysql[("MySQL database")]
end

node_customer(("Customer"))
node_mailjet["Mailjet"]
node_googleid["Google identity"]

node_customer -->|"uses"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_account
node_app -->|"routes to"| node_orderresults
node_app -->|"routes to"| node_adminui
node_app -->|"routes to"| node_knowledgeui
node_catalog -->|"fetches products"| node_api
node_checkout -->|"reads cart"| node_cart
node_checkout -.->|"submits order"| node_api
node_cart -->|"mirrors pricing"| node_pricing
node_api -.->|"requests products"| node_catalogapi
node_api -.->|"requests orders"| node_orderapi
node_api -.->|"requests auth"| node_authapi
node_api -.->|"requests admin"| node_adminapi
node_api -.->|"requests chat"| node_chatapi
node_authui -->|"restores session"| node_api
node_adminui -->|"loads admin data"| node_api
node_adminauth -->|"requests auth"| node_api
node_catalogapi -.->|"uses product data"| node_models
node_orderapi -.->|"calculates totals"| node_pricing
node_orderapi -.->|"starts payment"| node_payments
node_orderapi -.->|"creates receipt"| node_receipts
node_orderapi -.->|"sends notifications"| node_email
node_adminapi -.->|"generates receipt"| node_receipts
node_chatapi -.->|"retrieves answers"| node_rag
node_rag -.->|"uses knowledge data"| node_models
node_email -->|"sends email"| node_mailjet
node_google -.->|"verifies identity"| node_googleid
node_models -.->|"persists records"| node_mysql
node_receipts -->|"stores receipts"| node_models

click node_app "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/App.jsx"
click node_catalog "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/pages/Services.jsx"
click node_cart "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/context/CartContext.jsx"
click node_checkout "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/pages/Checkout.jsx"
click node_account "https://github.com/ivandelacruz14/rainchem-fullstack/tree/main/frontend/src/pages/account"
click node_orderresults "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/pages/OrderSuccess.jsx"
click node_authui "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/context/AuthContext.jsx"
click node_api "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/api/client.js"
click node_adminui "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/admin/pages/Orders.jsx"
click node_knowledgeui "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/admin/pages/Knowledge.jsx"
click node_adminauth "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/context/AdminAuthContext.jsx"
click node_catalogapi "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/routes/products.py"
click node_orderapi "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/routes/orders.py"
click node_authapi "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/routes/auth.py"
click node_adminapi "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/routes/admin_orders.py"
click node_chatapi "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/routes/chat.py"
click node_pricing "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/services/pricing.py"
click node_rag "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/services/rag.py"
click node_payments "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/services/paymongo.py"
click node_receipts "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/services/receipt_service.py"
click node_email "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/services/email_service.py"
click node_google "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/services/google_auth.py"
click node_models "https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/models/order.py"

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_catalog,node_cart,node_checkout,node_account,node_orderresults,node_authui,node_api toneBlue
class node_adminui,node_knowledgeui,node_adminauth toneAmber
class node_catalogapi,node_orderapi,node_authapi,node_adminapi,node_chatapi,node_pricing,node_rag,node_payments,node_receipts,node_email,node_google toneMint
class node_models,node_mysql toneRose
class node_customer,node_mailjet,node_googleid toneIndigo
```

## Components

### Customer storefront

- [Route app](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Browse catalog](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/pages/Services.jsx): `frontend/src/pages/Services.jsx`
- [Cart and pricing](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/context/CartContext.jsx): `frontend/src/context/CartContext.jsx`
- [Checkout](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/pages/Checkout.jsx): `frontend/src/pages/Checkout.jsx`
- [Account journey](https://github.com/ivandelacruz14/rainchem-fullstack/tree/main/frontend/src/pages/account): `frontend/src/pages/account`
- [Payment and receipt](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/pages/OrderSuccess.jsx): `frontend/src/pages/OrderSuccess.jsx`
- [Customer authentication](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [API client](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`

### Admin operations

- [Admin dashboard](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/admin/pages/Orders.jsx): `frontend/src/admin/pages/Orders.jsx`
- [Knowledge and chat monitor](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/admin/pages/Knowledge.jsx): `frontend/src/admin/pages/Knowledge.jsx`
- [Admin authentication](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/frontend/src/context/AdminAuthContext.jsx): `frontend/src/context/AdminAuthContext.jsx`

### Backend services

- [Product API](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/routes/products.py): `backend/app/routes/products.py`
- [Order and payment API](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/routes/orders.py): `backend/app/routes/orders.py`
- [Customer auth API](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/routes/auth.py): `backend/app/routes/auth.py`
- [Admin API](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/routes/admin_orders.py): `backend/app/routes/admin_orders.py`
- [Chat API](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/routes/chat.py): `backend/app/routes/chat.py`
- [Pricing rules](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/services/pricing.py): `backend/app/services/pricing.py`
- [Knowledge retrieval](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/services/rag.py): `backend/app/services/rag.py`
- [Payment integration](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/services/paymongo.py): `backend/app/services/paymongo.py`
- [Receipt service](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/services/receipt_service.py): `backend/app/services/receipt_service.py`
- [Email notifications](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/services/email_service.py): `backend/app/services/email_service.py`
- [Google sign-in](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/services/google_auth.py): `backend/app/services/google_auth.py`

### Domain data

- [Domain models](https://github.com/ivandelacruz14/rainchem-fullstack/blob/main/backend/app/models/order.py): `backend/app/models/order.py`
- **MySQL database**

### Other components

- **Customer**
- **Mailjet**
- **Google identity**

## Connections

- Customer → Route app: uses (evidence: `frontend/src/App.jsx`)
- Route app → Browse catalog: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Checkout: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Account journey: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Payment and receipt: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Admin dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Route app → Knowledge and chat monitor: routes to (evidence: `frontend/src/App.jsx`)
- Browse catalog → API client: fetches products (evidence: `frontend/src/pages/Services.jsx`)
- Checkout → Cart and pricing: reads cart (evidence: `frontend/src/pages/Checkout.jsx`)
- Checkout → API client: submits order (evidence: `frontend/src/pages/Checkout.jsx`)
- Cart and pricing → Pricing rules: mirrors pricing (evidence: `README.md`)
- API client → Product API: requests products
- API client → Order and payment API: requests orders
- API client → Customer auth API: requests auth
- API client → Admin API: requests admin
- API client → Chat API: requests chat
- Customer authentication → API client: restores session (evidence: `frontend/src/context/AuthContext.jsx`)
- Admin dashboard → API client: loads admin data (evidence: `frontend/src/admin/pages/Orders.jsx`)
- Admin authentication → API client: requests auth (evidence: `frontend/src/context/AdminAuthContext.jsx`)
- Product API → Domain models: uses product data
- Order and payment API → Pricing rules: calculates totals
- Order and payment API → Payment integration: starts payment
- Order and payment API → Receipt service: creates receipt
- Order and payment API → Email notifications: sends notifications
- Admin API → Receipt service: generates receipt
- Chat API → Knowledge retrieval: retrieves answers
- Knowledge retrieval → Domain models: uses knowledge data
- Email notifications → Mailjet: sends email (evidence: `backend/app/services/email_service.py`)
- Google sign-in → Google identity: verifies identity
- Domain models → MySQL database: persists records
- Receipt service → Domain models: stores receipts (evidence: `backend/app/services/receipt_service.py`)
