# arunkumar06072002/inyra architecture

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

- Interactive diagram: https://gitdiagram.com/arunkumar06072002/inyra
- Repository: https://github.com/arunkumar06072002/inyra

## Overview

Inyra is a two-sided e-commerce application: customers browse products, manage a cart, and place and track orders; owners manage catalog, storefront settings, orders, and audit exports. Angular pages and services call an Express API whose route handlers enforce role checks and operate on MongoDB-backed models. The README also documents ads, image management, and Excel audit downloads; these are retained as product capabilities, though their internal implementation paths are not fully evidenced here. Arrows cite only shown routing, calls, or README statements; unverified links are omitted.

Main entry points: [`client/src/app/app.routes.ts`](https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/app.routes.ts) (Route dispatch), [`server/server.js`](https://github.com/arunkumar06072002/inyra/blob/main/server/server.js) (API application), [`server/src/routes/product.routes.js`](https://github.com/arunkumar06072002/inyra/blob/main/server/src/routes/product.routes.js) (Catalog endpoints), [`server/src/routes/order.routes.js`](https://github.com/arunkumar06072002/inyra/blob/main/server/src/routes/order.routes.js) (Order endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer storefront"]
  node_customer_journey["Browse and order"]
  node_customer_auth["Customer account<br/>[login.ts]"]
end

subgraph group_owner["Owner console"]
  node_owner_journey["Manage store"]
  node_owner_storefront["Storefront settings<br/>[storefront.ts]"]
  node_owner_audit["Audit and export<br/>[audit.ts]"]
end

subgraph group_frontend["Angular shared layer"]
  node_routes["Route dispatch<br/>[app.routes.ts]"]
  node_auth_service["Session and auth<br/>[auth.service.ts]"]
  node_jwt_interceptor["JWT interceptor<br/>[jwt.interceptor.ts]"]
  node_domain_services["Catalog, cart, orders"]
  node_settings_theme["Settings and theme"]
end

subgraph group_api["Express API"]
  node_api_server["API application<br/>[server.js]"]
  node_auth_routes["Auth endpoints<br/>[auth.routes.js]"]
  node_catalog_routes["Catalog endpoints<br/>[product.routes.js]"]
  node_order_routes["Order endpoints<br/>[order.routes.js]"]
  node_order_logic["Order workflow<br/>[orderController.js]"]
  node_product_logic["Product management"]
  node_category_logic["Category management"]
  node_auth_logic["Identity logic<br/>[authController.js]"]
  node_access_control["Role authorization<br/>[auth.js]"]
  node_audit_api["Audit and Excel API<br/>[audit.routes.js]"]
  node_settings_ads["Settings and ads API"]
  node_image_api["Image endpoints<br/>[image.routes.js]"]
end

subgraph group_data["Persistence and media"]
  node_mongo[("MongoDB records<br/>[db.js]")]
  node_image_store["Image storage<br/>[imageStore.js]"]
end

node_customer_actor(("Customer"))
node_owner_actor(("Store owner"))
node_external_gateway(("Payment gateway"))

node_customer_actor -->|"opens storefront"| node_routes
node_owner_actor -->|"opens owner panel"| node_routes
node_routes -->|"routes to"| node_customer_journey
node_routes -->|"routes to"| node_customer_auth
node_routes -->|"routes to"| node_owner_journey
node_routes -->|"routes to"| node_owner_storefront
node_routes -->|"routes to"| node_owner_audit
node_customer_auth -.->|"uses"| node_auth_service
node_customer_journey -.->|"uses"| node_domain_services
node_owner_journey -.->|"uses"| node_domain_services
node_owner_storefront -->|"uses"| node_settings_theme
node_api_server -->|"mounts"| node_auth_routes
node_api_server -->|"mounts"| node_catalog_routes
node_api_server -->|"mounts"| node_order_routes
node_api_server -->|"mounts"| node_audit_api
node_api_server -->|"mounts"| node_settings_ads
node_api_server -->|"mounts"| node_image_api
node_auth_routes -->|"dispatches"| node_auth_logic
node_catalog_routes -->|"dispatches"| node_product_logic
node_order_routes -->|"dispatches"| node_order_logic
node_order_routes -->|"checks roles"| node_access_control
node_catalog_routes -->|"checks roles"| node_access_control
node_auth_logic -->|"reads and writes"| node_mongo
node_order_logic -->|"reads and writes"| node_mongo
node_product_logic -->|"reads and writes"| node_mongo
node_product_logic -->|"saves and deletes"| node_image_store
node_owner_audit -.->|"requests export"| node_audit_api
node_external_gateway -.->|"payment processing"| node_order_logic

click node_customer_journey "https://github.com/arunkumar06072002/inyra/tree/main/client/src/app/customer/pages"
click node_customer_auth "https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/customer/pages/login/login.ts"
click node_owner_journey "https://github.com/arunkumar06072002/inyra/tree/main/client/src/app/owner/pages"
click node_owner_storefront "https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/owner/pages/storefront/storefront.ts"
click node_owner_audit "https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/owner/pages/audit/audit.ts"
click node_routes "https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/app.routes.ts"
click node_auth_service "https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/core/services/auth.service.ts"
click node_jwt_interceptor "https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/core/interceptors/jwt.interceptor.ts"
click node_domain_services "https://github.com/arunkumar06072002/inyra/tree/main/client/src/app/core/services"
click node_settings_theme "https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/core/services/settings.service.ts"
click node_api_server "https://github.com/arunkumar06072002/inyra/blob/main/server/server.js"
click node_auth_routes "https://github.com/arunkumar06072002/inyra/blob/main/server/src/routes/auth.routes.js"
click node_catalog_routes "https://github.com/arunkumar06072002/inyra/blob/main/server/src/routes/product.routes.js"
click node_order_routes "https://github.com/arunkumar06072002/inyra/blob/main/server/src/routes/order.routes.js"
click node_order_logic "https://github.com/arunkumar06072002/inyra/blob/main/server/src/controllers/orderController.js"
click node_product_logic "https://github.com/arunkumar06072002/inyra/blob/main/server/src/controllers/productController.js"
click node_category_logic "https://github.com/arunkumar06072002/inyra/blob/main/server/src/controllers/categoryController.js"
click node_auth_logic "https://github.com/arunkumar06072002/inyra/blob/main/server/src/controllers/authController.js"
click node_access_control "https://github.com/arunkumar06072002/inyra/blob/main/server/src/middleware/auth.js"
click node_audit_api "https://github.com/arunkumar06072002/inyra/blob/main/server/src/routes/audit.routes.js"
click node_settings_ads "https://github.com/arunkumar06072002/inyra/blob/main/server/src/controllers/settingsController.js"
click node_image_api "https://github.com/arunkumar06072002/inyra/blob/main/server/src/routes/image.routes.js"
click node_mongo "https://github.com/arunkumar06072002/inyra/blob/main/server/src/config/db.js"
click node_image_store "https://github.com/arunkumar06072002/inyra/blob/main/server/src/utils/imageStore.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_customer_journey,node_customer_auth toneBlue
class node_owner_journey,node_owner_storefront,node_owner_audit toneAmber
class node_routes,node_auth_service,node_jwt_interceptor,node_domain_services,node_settings_theme toneMint
class node_api_server,node_auth_routes,node_catalog_routes,node_order_routes,node_order_logic,node_product_logic,node_category_logic,node_auth_logic,node_access_control,node_audit_api,node_settings_ads,node_image_api toneRose
class node_mongo,node_image_store,node_customer_actor,node_owner_actor,node_external_gateway toneIndigo
```

## Components

### Customer storefront

- [Browse and order](https://github.com/arunkumar06072002/inyra/tree/main/client/src/app/customer/pages): `client/src/app/customer/pages`
- [Customer account](https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/customer/pages/login/login.ts): `client/src/app/customer/pages/login/login.ts`

### Owner console

- [Manage store](https://github.com/arunkumar06072002/inyra/tree/main/client/src/app/owner/pages): `client/src/app/owner/pages`
- [Storefront settings](https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/owner/pages/storefront/storefront.ts): `client/src/app/owner/pages/storefront/storefront.ts`
- [Audit and export](https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/owner/pages/audit/audit.ts): `client/src/app/owner/pages/audit/audit.ts`

### Angular shared layer

- [Route dispatch](https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/app.routes.ts): `client/src/app/app.routes.ts`
- [Session and auth](https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/core/services/auth.service.ts): `client/src/app/core/services/auth.service.ts`
- [JWT interceptor](https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/core/interceptors/jwt.interceptor.ts): `client/src/app/core/interceptors/jwt.interceptor.ts`
- [Catalog, cart, orders](https://github.com/arunkumar06072002/inyra/tree/main/client/src/app/core/services): `client/src/app/core/services`
- [Settings and theme](https://github.com/arunkumar06072002/inyra/blob/main/client/src/app/core/services/settings.service.ts): `client/src/app/core/services/settings.service.ts`

### Express API

- [API application](https://github.com/arunkumar06072002/inyra/blob/main/server/server.js): `server/server.js`
- [Auth endpoints](https://github.com/arunkumar06072002/inyra/blob/main/server/src/routes/auth.routes.js): `server/src/routes/auth.routes.js`
- [Catalog endpoints](https://github.com/arunkumar06072002/inyra/blob/main/server/src/routes/product.routes.js): `server/src/routes/product.routes.js`
- [Order endpoints](https://github.com/arunkumar06072002/inyra/blob/main/server/src/routes/order.routes.js): `server/src/routes/order.routes.js`
- [Order workflow](https://github.com/arunkumar06072002/inyra/blob/main/server/src/controllers/orderController.js): `server/src/controllers/orderController.js`
- [Product management](https://github.com/arunkumar06072002/inyra/blob/main/server/src/controllers/productController.js): `server/src/controllers/productController.js`
- [Category management](https://github.com/arunkumar06072002/inyra/blob/main/server/src/controllers/categoryController.js): `server/src/controllers/categoryController.js`
- [Identity logic](https://github.com/arunkumar06072002/inyra/blob/main/server/src/controllers/authController.js): `server/src/controllers/authController.js`
- [Role authorization](https://github.com/arunkumar06072002/inyra/blob/main/server/src/middleware/auth.js): `server/src/middleware/auth.js`
- [Audit and Excel API](https://github.com/arunkumar06072002/inyra/blob/main/server/src/routes/audit.routes.js): `server/src/routes/audit.routes.js`
- [Settings and ads API](https://github.com/arunkumar06072002/inyra/blob/main/server/src/controllers/settingsController.js): `server/src/controllers/settingsController.js`
- [Image endpoints](https://github.com/arunkumar06072002/inyra/blob/main/server/src/routes/image.routes.js): `server/src/routes/image.routes.js`

### Persistence and media

- [MongoDB records](https://github.com/arunkumar06072002/inyra/blob/main/server/src/config/db.js): `server/src/config/db.js`
- [Image storage](https://github.com/arunkumar06072002/inyra/blob/main/server/src/utils/imageStore.js): `server/src/utils/imageStore.js`

### Other components

- **Customer**
- **Store owner**
- **Payment gateway**

## Connections

- Customer → Route dispatch: opens storefront (evidence: `client/src/app/app.routes.ts`)
- Store owner → Route dispatch: opens owner panel (evidence: `client/src/app/app.routes.ts`)
- Route dispatch → Browse and order: routes to (evidence: `client/src/app/app.routes.ts`)
- Route dispatch → Customer account: routes to (evidence: `client/src/app/app.routes.ts`)
- Route dispatch → Manage store: routes to (evidence: `client/src/app/app.routes.ts`)
- Route dispatch → Storefront settings: routes to (evidence: `client/src/app/app.routes.ts`)
- Route dispatch → Audit and export: routes to (evidence: `client/src/app/app.routes.ts`)
- Customer account → Session and auth: uses
- Browse and order → Catalog, cart, orders: uses
- Manage store → Catalog, cart, orders: uses (evidence: `client/src/app/owner/pages/storefront/storefront.ts`)
- Storefront settings → Settings and theme: uses (evidence: `client/src/app/owner/pages/storefront/storefront.ts`)
- API application → Auth endpoints: mounts (evidence: `server/server.js`)
- API application → Catalog endpoints: mounts (evidence: `server/server.js`)
- API application → Order endpoints: mounts (evidence: `server/server.js`)
- API application → Audit and Excel API: mounts (evidence: `server/server.js`)
- API application → Settings and ads API: mounts (evidence: `server/server.js`)
- API application → Image endpoints: mounts (evidence: `server/server.js`)
- Auth endpoints → Identity logic: dispatches (evidence: `server/src/routes/auth.routes.js`)
- Catalog endpoints → Product management: dispatches (evidence: `server/src/routes/product.routes.js`)
- Order endpoints → Order workflow: dispatches (evidence: `server/src/routes/order.routes.js`)
- Order endpoints → Role authorization: checks roles (evidence: `server/src/routes/order.routes.js`)
- Catalog endpoints → Role authorization: checks roles (evidence: `server/src/routes/product.routes.js`)
- Identity logic → MongoDB records: reads and writes (evidence: `server/src/controllers/authController.js`)
- Order workflow → MongoDB records: reads and writes (evidence: `server/src/controllers/orderController.js`)
- Product management → MongoDB records: reads and writes (evidence: `server/src/controllers/productController.js`)
- Product management → Image storage: saves and deletes (evidence: `server/src/controllers/productController.js`)
- Audit and export → Audit and Excel API: requests export
- Payment gateway → Order workflow: payment processing
