# nader-grt/ecommerceapp architecture

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

- Interactive diagram: https://gitdiagram.com/nader-grt/ecommerceapp
- Repository: https://github.com/nader-grt/ecommerceapp

## Overview

This repository combines a React-Admin back office with an Express/Sequelize API for commerce and operations. The visible admin workflow is authentication and resource management through shared providers; the API includes product, order, inventory, user, and delivery capabilities, though most route wiring was not sampled. The graph preserves those major subsystems without asserting unshown links. No README was provided, so capability coverage is based on the source tree; edges are limited to relationships visible in excerpts or the SOURCE INDEX.

Main entry points: [`admin/src/App.tsx`](https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/App.tsx) (Admin app), [`admin/src/auth/httpclientService/httpclientService.ts`](https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/auth/httpclientService/httpclientService.ts) (Authenticated HTTP client), [`admin/src/core/providers/dataProvider.tsx`](https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/core/providers/dataProvider.tsx) (Data provider), [`api/src/controllers/auth`](https://github.com/nader-grt/ecommerceapp/tree/main/api/src/controllers/auth) (Auth controllers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin console"]
  node_adminapp["Admin app<br/>[App.tsx]"]
  node_authui["Login and registration"]
  node_dataprovider["Data provider<br/>[dataProvider.tsx]"]
  node_adapter["API adapter<br/>[apiAdapter.ts]"]
  node_resources["Admin resources"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
end

subgraph group_api["Commerce API"]
  node_apiuser(("API client"))
  node_productcontrollers["Product controllers"]
  node_productusecases["Product use cases"]
  node_orders["Order management"]
  node_controllerbase["Controller response layer<br/>[BaseCOntroller.ts]"]
  node_models["Sequelize models<br/>[main.ts]"]
  node_database[("Database<br/>[config.ts]")]
end

subgraph group_identity["Identity and access"]
  node_authprovider["Auth provider<br/>[authProvider.tsx]"]
  node_httpclient["Authenticated HTTP client"]
  node_authservice["Auth service<br/>[authService.ts]"]
  node_authcontrollers["Auth controllers"]
  node_tokenmiddleware["Token middleware<br/>[verifyToken.ts]"]
  node_userdomain["User domain<br/>[userDomain.ts]"]
  node_userrepo["User repository<br/>[userRepo.ts]"]
end

subgraph group_operations["Operations"]
  node_inventory["Inventory management"]
  node_delivery["Delivery scheduling"]
  node_fulfillment["Order delivery"]
end

node_operator(("Admin user"))

node_operator -->|"uses"| node_adminapp
node_adminapp -->|"routes to"| node_authui
node_adminapp -->|"configures"| node_authprovider
node_adminapp -->|"configures"| node_dataprovider
node_adminapp -->|"registers"| node_resources
node_adminapp -->|"configures"| node_dashboard
node_dataprovider -->|"uses"| node_adapter
node_dataprovider -->|"uses"| node_httpclient
node_authservice -->|"uses"| node_httpclient
node_httpclient -->|"reads token"| node_authprovider
node_httpclient -->|"sends requests"| node_apiuser
node_authservice -->|"registers"| node_apiuser
node_apiuser -.->|"requests"| node_authcontrollers
node_authcontrollers -->|"sets credentials"| node_userdomain
node_authcontrollers -->|"checks and saves"| node_userrepo
node_tokenmiddleware -->|"verifies tokens"| node_apiuser
node_productcontrollers -->|"executes"| node_productusecases
node_orders -.->|"extends"| node_controllerbase
node_delivery -.->|"extends"| node_controllerbase
node_fulfillment -.->|"coordinates"| node_orders
node_models -->|"initializes with"| node_database
node_userrepo -->|"queries"| node_models
node_userrepo -.->|"uses connection"| node_database

click node_adminapp "https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/App.tsx"
click node_authui "https://github.com/nader-grt/ecommerceapp/tree/main/admin/src/auth/pages"
click node_authprovider "https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/core/providers/authProvider.tsx"
click node_httpclient "https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/auth/httpclientService/httpclientService.ts"
click node_authservice "https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/auth/services/authService.ts"
click node_dataprovider "https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/core/providers/dataProvider.tsx"
click node_adapter "https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/apiAdapter.ts"
click node_resources "https://github.com/nader-grt/ecommerceapp/tree/main/admin/src/modules"
click node_dashboard "https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/dashboard/Dashboard.tsx"
click node_authcontrollers "https://github.com/nader-grt/ecommerceapp/tree/main/api/src/controllers/auth"
click node_tokenmiddleware "https://github.com/nader-grt/ecommerceapp/blob/main/api/src/middleware/verifyToken.ts"
click node_userdomain "https://github.com/nader-grt/ecommerceapp/blob/main/api/src/models/domain/auth/user/userDomain.ts"
click node_userrepo "https://github.com/nader-grt/ecommerceapp/blob/main/api/src/repo/auth/userRepo/userRepo.ts"
click node_productcontrollers "https://github.com/nader-grt/ecommerceapp/tree/main/api/src/controllers/products"
click node_productusecases "https://github.com/nader-grt/ecommerceapp/tree/main/api/src/useCases/productUseCase"
click node_orders "https://github.com/nader-grt/ecommerceapp/tree/main/api/src/controllers/Orders"
click node_inventory "https://github.com/nader-grt/ecommerceapp/tree/main/api/src/useCases/InventorieUseCase"
click node_delivery "https://github.com/nader-grt/ecommerceapp/tree/main/api/src/controllers/DelivererDayWork"
click node_fulfillment "https://github.com/nader-grt/ecommerceapp/tree/main/api/src/useCases/OrderWithDeliveriesUseCase"
click node_controllerbase "https://github.com/nader-grt/ecommerceapp/blob/main/api/src/infra/BaseCOntroller.ts"
click node_models "https://github.com/nader-grt/ecommerceapp/blob/main/api/src/models/main.ts"
click node_database "https://github.com/nader-grt/ecommerceapp/blob/main/api/src/dbConfig/config.ts"

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_adminapp,node_authui,node_dataprovider,node_adapter,node_resources,node_dashboard,node_operator toneBlue
class node_apiuser,node_productcontrollers,node_productusecases,node_orders,node_controllerbase,node_models,node_database toneAmber
class node_authprovider,node_httpclient,node_authservice,node_authcontrollers,node_tokenmiddleware,node_userdomain,node_userrepo toneMint
class node_inventory,node_delivery,node_fulfillment toneRose
```

## Components

### Admin console

- [Admin app](https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/App.tsx): `admin/src/App.tsx`
- [Login and registration](https://github.com/nader-grt/ecommerceapp/tree/main/admin/src/auth/pages): `admin/src/auth/pages`
- [Data provider](https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/core/providers/dataProvider.tsx): `admin/src/core/providers/dataProvider.tsx`
- [API adapter](https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/apiAdapter.ts): `admin/src/apiAdapter.ts`
- [Admin resources](https://github.com/nader-grt/ecommerceapp/tree/main/admin/src/modules): `admin/src/modules`
- [Dashboard](https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/dashboard/Dashboard.tsx): `admin/src/dashboard/Dashboard.tsx`

### Commerce API

- **API client**
- [Product controllers](https://github.com/nader-grt/ecommerceapp/tree/main/api/src/controllers/products): `api/src/controllers/products`
- [Product use cases](https://github.com/nader-grt/ecommerceapp/tree/main/api/src/useCases/productUseCase): `api/src/useCases/productUseCase`
- [Order management](https://github.com/nader-grt/ecommerceapp/tree/main/api/src/controllers/Orders): `api/src/controllers/Orders`
- [Controller response layer](https://github.com/nader-grt/ecommerceapp/blob/main/api/src/infra/BaseCOntroller.ts): `api/src/infra/BaseCOntroller.ts`
- [Sequelize models](https://github.com/nader-grt/ecommerceapp/blob/main/api/src/models/main.ts): `api/src/models/main.ts`
- [Database](https://github.com/nader-grt/ecommerceapp/blob/main/api/src/dbConfig/config.ts): `api/src/dbConfig/config.ts`

### Identity and access

- [Auth provider](https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/core/providers/authProvider.tsx): `admin/src/core/providers/authProvider.tsx`
- [Authenticated HTTP client](https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/auth/httpclientService/httpclientService.ts): `admin/src/auth/httpclientService/httpclientService.ts`
- [Auth service](https://github.com/nader-grt/ecommerceapp/blob/main/admin/src/auth/services/authService.ts): `admin/src/auth/services/authService.ts`
- [Auth controllers](https://github.com/nader-grt/ecommerceapp/tree/main/api/src/controllers/auth): `api/src/controllers/auth`
- [Token middleware](https://github.com/nader-grt/ecommerceapp/blob/main/api/src/middleware/verifyToken.ts): `api/src/middleware/verifyToken.ts`
- [User domain](https://github.com/nader-grt/ecommerceapp/blob/main/api/src/models/domain/auth/user/userDomain.ts): `api/src/models/domain/auth/user/userDomain.ts`
- [User repository](https://github.com/nader-grt/ecommerceapp/blob/main/api/src/repo/auth/userRepo/userRepo.ts): `api/src/repo/auth/userRepo/userRepo.ts`

### Operations

- [Inventory management](https://github.com/nader-grt/ecommerceapp/tree/main/api/src/useCases/InventorieUseCase): `api/src/useCases/InventorieUseCase`
- [Delivery scheduling](https://github.com/nader-grt/ecommerceapp/tree/main/api/src/controllers/DelivererDayWork): `api/src/controllers/DelivererDayWork`
- [Order delivery](https://github.com/nader-grt/ecommerceapp/tree/main/api/src/useCases/OrderWithDeliveriesUseCase): `api/src/useCases/OrderWithDeliveriesUseCase`

### Other components

- **Admin user**

## Connections

- Admin user → Admin app: uses (evidence: `admin/src/App.tsx`)
- Admin app → Login and registration: routes to (evidence: `admin/src/App.tsx`)
- Admin app → Auth provider: configures (evidence: `admin/src/App.tsx`)
- Admin app → Data provider: configures (evidence: `admin/src/App.tsx`)
- Admin app → Admin resources: registers (evidence: `admin/src/App.tsx`)
- Admin app → Dashboard: configures (evidence: `admin/src/App.tsx`)
- Data provider → API adapter: uses (evidence: `admin/src/core/providers/dataProvider.tsx`)
- Data provider → Authenticated HTTP client: uses (evidence: `admin/src/core/providers/dataProvider.tsx`)
- Auth service → Authenticated HTTP client: uses (evidence: `admin/src/auth/services/authService.ts`)
- Authenticated HTTP client → Auth provider: reads token (evidence: `admin/src/auth/httpclientService/httpclientService.ts`)
- Authenticated HTTP client → API client: sends requests (evidence: `admin/src/auth/httpclientService/httpclientService.ts`)
- Auth service → API client: registers (evidence: `admin/src/auth/services/authService.ts`)
- API client → Auth controllers: requests
- Auth controllers → User domain: sets credentials (evidence: `api/src/controllers/auth/RegisterController.ts`)
- Auth controllers → User repository: checks and saves (evidence: `api/src/controllers/auth/RegisterController.ts`)
- Token middleware → API client: verifies tokens (evidence: `api/src/middleware/verifyToken.ts`)
- Product controllers → Product use cases: executes (evidence: `api/src/controllers/products/GetAllProductsFiltredByCategoryIdController.ts`)
- Order management → Controller response layer: extends (evidence: `api/src/controllers/Orders/CreateOrderByAdminController.ts`)
- Delivery scheduling → Controller response layer: extends (evidence: `api/src/controllers/DelivererDayWork/UpdateDelivererDayWorkController.ts`)
- Order delivery → Order management: coordinates
- Sequelize models → Database: initializes with (evidence: `api/src/models/main.ts`)
- User repository → Sequelize models: queries (evidence: `api/src/repo/auth/userRepo/userRepo.ts`)
- User repository → Database: uses connection
