# altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour architecture

> Architecture diagram of the GitHub repository altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour
- Repository: https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour

## Overview

Telco Product Recommendation is a web application for account management, browsing and purchasing telco products, personalized recommendations, and administrative oversight. Users register or log in, then explore recommendations and products, manage their profile and balance, and view or make transactions; administrators manage users, products, transactions, and reports. The frontend communicates with an Express API backed by Sequelize models, while a separate Python/Node ML service supports prediction. The graph preserves the documented feature areas, but several links are omitted because their implementation was not sampled.

Main entry points: [`frontend/src/App.jsx`](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/App.jsx) (Web routes), [`backend-1/server.js`](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/server.js) (Express API), [`frontend/src/services`](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/tree/main/frontend/src/services) (API services), [`backend-1/models/index.js`](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/models/index.js) (Relational data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Web routes<br/>[App.jsx]"]
  node_authstate["Session state<br/>[auth.js]"]
  node_authpages["Sign in and register<br/>[Login.jsx]"]
  node_dashboard["User dashboard<br/>[Dashboard.jsx]"]
  node_catalog["Product browsing<br/>[Products.jsx]"]
  node_productdetail["Product details<br/>[ProductDetail.jsx]"]
  node_profile["Profile and balance<br/>[Profile.jsx]"]
  node_history["Transaction history"]
  node_admindashboard["Admin analytics<br/>[AdminDashboard.jsx]"]
  node_adminmanagement["Admin management<br/>[AdminProducts.jsx]"]
  node_frontendservices["API services"]
  node_httpclient["HTTP client<br/>[api.js]"]
end

subgraph group_api["Core API"]
  node_api["Express API<br/>[server.js]"]
  node_authroutes["Authentication routes<br/>[authRoutes.js]"]
  node_authcontroller["Authentication<br/>[authController.js]"]
  node_productroutes["Product routes<br/>[productRoutes.js]"]
  node_productcontroller["Product operations"]
  node_recroutes["Recommendation routes"]
  node_reccontroller["Recommendation operations"]
  node_transactionroutes["Transaction routes"]
  node_transactioncontroller["Transaction operations"]
  node_userroutes["User routes<br/>[userRoutes.js]"]
  node_usercontroller["User operations<br/>[userController.js]"]
  node_adminroutes["Admin routes<br/>[adminRoutes.js]"]
  node_admincontroller["Admin operations<br/>[adminController.js]"]
  node_authmiddleware["Access control<br/>[authMiddleware.js]"]
end

subgraph group_data["Application data"]
  node_database[("Relational data<br/>[index.js]")]
end

subgraph group_ml["Recommendation ML"]
  node_mlservice["ML prediction service<br/>[server.js]"]
  node_predict["Prediction logic<br/>[predict.py]"]
end

node_customer(("Customer"))
node_admin(("Administrator"))

node_customer -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"routes to"| node_authpages
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_productdetail
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_history
node_app -->|"routes to"| node_admindashboard
node_app -->|"routes to"| node_adminmanagement
node_app -->|"checks session"| node_authstate
node_authpages -->|"uses auth"| node_frontendservices
node_dashboard -->|"loads recommendations"| node_frontendservices
node_catalog -->|"loads products"| node_frontendservices
node_productdetail -->|"uses product services"| node_frontendservices
node_profile -->|"loads profile"| node_frontendservices
node_admindashboard -->|"loads analytics"| node_frontendservices
node_authpages -->|"stores session"| node_authstate
node_frontendservices -.->|"sends requests"| node_httpclient
node_httpclient -.->|"calls API"| node_api
node_api -->|"mounts routes"| node_authroutes
node_api -->|"mounts routes"| node_productroutes
node_api -->|"mounts routes"| node_recroutes
node_api -->|"mounts routes"| node_transactionroutes
node_api -->|"mounts routes"| node_userroutes
node_api -->|"mounts routes"| node_adminroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_productroutes -->|"dispatches"| node_productcontroller
node_recroutes -->|"dispatches"| node_reccontroller
node_transactionroutes -->|"dispatches"| node_transactioncontroller
node_userroutes -->|"dispatches"| node_usercontroller
node_adminroutes -->|"dispatches"| node_admincontroller
node_adminroutes -->|"protects routes"| node_authmiddleware
node_recroutes -->|"protects routes"| node_authmiddleware
node_authcontroller -->|"reads and writes"| node_database
node_productcontroller -->|"uses models"| node_database
node_reccontroller -->|"uses models"| node_database
node_transactioncontroller -->|"uses models"| node_database
node_usercontroller -->|"uses models"| node_database
node_admincontroller -->|"queries models"| node_database
node_authcontroller -->|"requests predictions"| node_mlservice
node_mlservice -.->|"runs prediction"| node_predict

click node_app "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/App.jsx"
click node_authstate "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/utils/auth.js"
click node_authpages "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/Login.jsx"
click node_dashboard "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/Dashboard.jsx"
click node_catalog "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/Products.jsx"
click node_productdetail "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/ProductDetail.jsx"
click node_profile "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/Profile.jsx"
click node_history "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/TransactionHistory.jsx"
click node_admindashboard "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/admin/AdminDashboard.jsx"
click node_adminmanagement "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/admin/AdminProducts.jsx"
click node_frontendservices "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/tree/main/frontend/src/services"
click node_httpclient "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/services/api.js"
click node_api "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/server.js"
click node_authroutes "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/routes/authRoutes.js"
click node_authcontroller "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/controllers/authController.js"
click node_productroutes "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/routes/productRoutes.js"
click node_productcontroller "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/controllers/productController.js"
click node_recroutes "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/routes/recommendationRoutes.js"
click node_reccontroller "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/controllers/recommendationController.js"
click node_transactionroutes "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/routes/transactionRoutes.js"
click node_transactioncontroller "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/controllers/transactionController.js"
click node_userroutes "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/routes/userRoutes.js"
click node_usercontroller "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/controllers/userController.js"
click node_adminroutes "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/routes/adminRoutes.js"
click node_admincontroller "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/controllers/adminController.js"
click node_authmiddleware "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/middleware/authMiddleware.js"
click node_database "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/models/index.js"
click node_mlservice "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-2-ml/server.js"
click node_predict "https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-2-ml/python/predict.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_authstate,node_authpages,node_dashboard,node_catalog,node_productdetail,node_profile,node_history,node_admindashboard,node_adminmanagement,node_frontendservices,node_httpclient toneBlue
class node_api,node_authroutes,node_authcontroller,node_productroutes,node_productcontroller,node_recroutes,node_reccontroller,node_transactionroutes,node_transactioncontroller,node_userroutes,node_usercontroller,node_adminroutes,node_admincontroller,node_authmiddleware toneAmber
class node_database toneMint
class node_mlservice,node_predict toneRose
class node_customer,node_admin toneIndigo
```

## Components

### Web application

- [Web routes](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Session state](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/utils/auth.js): `frontend/src/utils/auth.js`
- [Sign in and register](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [User dashboard](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Product browsing](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/Products.jsx): `frontend/src/pages/Products.jsx`
- [Product details](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/ProductDetail.jsx): `frontend/src/pages/ProductDetail.jsx`
- [Profile and balance](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/Profile.jsx): `frontend/src/pages/Profile.jsx`
- [Transaction history](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/TransactionHistory.jsx): `frontend/src/pages/TransactionHistory.jsx`
- [Admin analytics](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/admin/AdminDashboard.jsx): `frontend/src/pages/admin/AdminDashboard.jsx`
- [Admin management](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/pages/admin/AdminProducts.jsx): `frontend/src/pages/admin/AdminProducts.jsx`
- [API services](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/tree/main/frontend/src/services): `frontend/src/services`
- [HTTP client](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Core API

- [Express API](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/server.js): `backend-1/server.js`
- [Authentication routes](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/routes/authRoutes.js): `backend-1/routes/authRoutes.js`
- [Authentication](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/controllers/authController.js): `backend-1/controllers/authController.js`
- [Product routes](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/routes/productRoutes.js): `backend-1/routes/productRoutes.js`
- [Product operations](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/controllers/productController.js): `backend-1/controllers/productController.js`
- [Recommendation routes](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/routes/recommendationRoutes.js): `backend-1/routes/recommendationRoutes.js`
- [Recommendation operations](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/controllers/recommendationController.js): `backend-1/controllers/recommendationController.js`
- [Transaction routes](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/routes/transactionRoutes.js): `backend-1/routes/transactionRoutes.js`
- [Transaction operations](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/controllers/transactionController.js): `backend-1/controllers/transactionController.js`
- [User routes](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/routes/userRoutes.js): `backend-1/routes/userRoutes.js`
- [User operations](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/controllers/userController.js): `backend-1/controllers/userController.js`
- [Admin routes](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/routes/adminRoutes.js): `backend-1/routes/adminRoutes.js`
- [Admin operations](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/controllers/adminController.js): `backend-1/controllers/adminController.js`
- [Access control](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/middleware/authMiddleware.js): `backend-1/middleware/authMiddleware.js`

### Application data

- [Relational data](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-1/models/index.js): `backend-1/models/index.js`

### Recommendation ML

- [ML prediction service](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-2-ml/server.js): `backend-2-ml/server.js`
- [Prediction logic](https://github.com/altheeiya/telco-product-recomendation-offer-based-on-customer-behaviour/blob/main/backend-2-ml/python/predict.py): `backend-2-ml/python/predict.py`

### Other components

- **Customer**
- **Administrator**

## Connections

- Customer → Web routes: uses
- Administrator → Web routes: uses
- Web routes → Sign in and register: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → User dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Product browsing: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Product details: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Profile and balance: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Transaction history: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Admin analytics: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Admin management: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Session state: checks session (evidence: `frontend/src/App.jsx`)
- Sign in and register → API services: uses auth (evidence: `frontend/src/pages/Login.jsx`)
- User dashboard → API services: loads recommendations (evidence: `frontend/src/pages/Dashboard.jsx`)
- Product browsing → API services: loads products (evidence: `frontend/src/pages/Products.jsx`)
- Product details → API services: uses product services (evidence: `frontend/src/pages/ProductDetail.jsx`)
- Profile and balance → API services: loads profile (evidence: `frontend/src/pages/Profile.jsx`)
- Admin analytics → API services: loads analytics (evidence: `frontend/src/pages/admin/AdminDashboard.jsx`)
- Sign in and register → Session state: stores session (evidence: `frontend/src/pages/Login.jsx`)
- API services → HTTP client: sends requests (evidence: `frontend/src/services/authService.js`)
- HTTP client → Express API: calls API
- Express API → Authentication routes: mounts routes (evidence: `backend-1/server.js`)
- Express API → Product routes: mounts routes (evidence: `backend-1/server.js`)
- Express API → Recommendation routes: mounts routes (evidence: `backend-1/server.js`)
- Express API → Transaction routes: mounts routes (evidence: `backend-1/server.js`)
- Express API → User routes: mounts routes (evidence: `backend-1/server.js`)
- Express API → Admin routes: mounts routes (evidence: `backend-1/server.js`)
- Authentication routes → Authentication: dispatches (evidence: `backend-1/routes/authRoutes.js`)
- Product routes → Product operations: dispatches (evidence: `backend-1/routes/productRoutes.js`)
- Recommendation routes → Recommendation operations: dispatches (evidence: `backend-1/routes/recommendationRoutes.js`)
- Transaction routes → Transaction operations: dispatches (evidence: `backend-1/routes/transactionRoutes.js`)
- User routes → User operations: dispatches (evidence: `backend-1/routes/userRoutes.js`)
- Admin routes → Admin operations: dispatches (evidence: `backend-1/routes/adminRoutes.js`)
- Admin routes → Access control: protects routes (evidence: `backend-1/routes/adminRoutes.js`)
- Recommendation routes → Access control: protects routes (evidence: `backend-1/routes/recommendationRoutes.js`)
- Authentication → Relational data: reads and writes (evidence: `backend-1/controllers/authController.js`)
- Product operations → Relational data: uses models (evidence: `backend-1/controllers/productController.js`)
- Recommendation operations → Relational data: uses models (evidence: `backend-1/controllers/recommendationController.js`)
- Transaction operations → Relational data: uses models (evidence: `backend-1/controllers/transactionController.js`)
- User operations → Relational data: uses models (evidence: `backend-1/controllers/userController.js`)
- Admin operations → Relational data: queries models (evidence: `backend-1/controllers/adminController.js`)
- Authentication → ML prediction service: requests predictions (evidence: `backend-1/controllers/authController.js`)
- ML prediction service → Prediction logic: runs prediction
