# trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu architecture

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

- Interactive diagram: https://gitdiagram.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu
- Repository: https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu

## Overview

This repository contains two distinct applications: ElectroCare, a repair-service booking and management system, and a Streamlit digit recognizer. ElectroCare’s frontend calls its API; the shown backend handles accounts, service listings, bookings, ticket tracking, quote approval, and staff booking access using MySQL. The digit app preprocesses uploaded images for CNN inference, while a separate training script obtains MNIST data and saves model weights. Some ElectroCare implementation is unsampled, so the graph limits its relationships to those visible in excerpts; the README describes only the digit-recognition app.

Main entry points: [`ElectroCare_GitHub_Ready/frontend/app.js`](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/frontend/app.js) (ElectroCare web app), [`ElectroCare_GitHub_Ready/database/electrocare.sql`](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/database/electrocare.sql) (ElectroCare database), [`training/train.py`](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/training/train.py) (CNN training), [`ElectroCare_GitHub_Ready/backend/server.js`](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/backend/server.js) (Account access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ec_ui["ElectroCare interface"]
  node_ec_frontend["ElectroCare web app<br/>[app.js]"]
end

subgraph group_ec_ops["Repair operations"]
  node_ec_auth["Account access<br/>[server.js]"]
  node_ec_services["Service catalog<br/>[server.js]"]
  node_ec_booking["Repair bookings<br/>[server.js]"]
  node_ec_tracking["Ticket tracking<br/>[server.js]"]
  node_ec_quotes["Quote approval<br/>[server.js]"]
  node_ec_staff["Staff bookings<br/>[server.js]"]
  node_ec_db[("ElectroCare database<br/>[electrocare.sql]")]
end

subgraph group_digits["Digit recognition"]
  node_digit_app["Image upload and prediction<br/>[app.py]"]
end

subgraph group_training["Model training"]
  node_cnn_train["CNN training<br/>[train.py]"]
  node_mnist_loader["MNIST data loaders<br/>[dataset.py]"]
  node_weights["CNN weights<br/>[model.pth]"]
end

node_customer(("Customer"))
node_staff_admin(("Staff / admin"))
node_digit_user(("Digit recognizer user"))
node_mnist[("MNIST dataset")]

node_customer -->|"uses"| node_ec_frontend
node_staff_admin -->|"uses"| node_ec_frontend
node_ec_frontend -->|"requests auth"| node_ec_auth
node_ec_frontend -.->|"requests services"| node_ec_services
node_ec_frontend -.->|"submits bookings"| node_ec_booking
node_ec_frontend -.->|"requests tickets"| node_ec_tracking
node_ec_frontend -.->|"approves quotes"| node_ec_quotes
node_ec_frontend -.->|"requests staff view"| node_ec_staff
node_ec_auth -->|"reads / writes"| node_ec_db
node_ec_services -->|"reads"| node_ec_db
node_ec_booking -->|"writes booking"| node_ec_db
node_ec_tracking -->|"reads tickets"| node_ec_db
node_ec_quotes -->|"updates quote"| node_ec_db
node_ec_staff -->|"reads bookings"| node_ec_db
node_digit_user -->|"uploads image"| node_digit_app
node_digit_app -->|"loads weights"| node_weights
node_cnn_train -->|"loads batches"| node_mnist_loader
node_mnist_loader -->|"downloads data"| node_mnist
node_cnn_train -->|"saves weights"| node_weights

click node_ec_frontend "https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/frontend/app.js"
click node_ec_auth "https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/backend/server.js"
click node_ec_services "https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/backend/server.js"
click node_ec_booking "https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/backend/server.js"
click node_ec_tracking "https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/backend/server.js"
click node_ec_quotes "https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/backend/server.js"
click node_ec_staff "https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/backend/server.js"
click node_ec_db "https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/database/electrocare.sql"
click node_digit_app "https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/app.py"
click node_cnn_train "https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/training/train.py"
click node_mnist_loader "https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/dataset/dataset.py"
click node_weights "https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/models/model.pth"

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_ec_frontend,node_digit_user toneBlue
class node_ec_auth,node_ec_services,node_ec_booking,node_ec_tracking,node_ec_quotes,node_ec_staff,node_ec_db,node_mnist toneAmber
class node_digit_app toneMint
class node_cnn_train,node_mnist_loader,node_weights toneRose
class node_customer,node_staff_admin toneIndigo
```

## Components

### ElectroCare interface

- [ElectroCare web app](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/frontend/app.js): `ElectroCare_GitHub_Ready/frontend/app.js`

### Repair operations

- [Account access](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/backend/server.js): `ElectroCare_GitHub_Ready/backend/server.js`
- [Service catalog](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/backend/server.js): `ElectroCare_GitHub_Ready/backend/server.js`
- [Repair bookings](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/backend/server.js): `ElectroCare_GitHub_Ready/backend/server.js`
- [Ticket tracking](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/backend/server.js): `ElectroCare_GitHub_Ready/backend/server.js`
- [Quote approval](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/backend/server.js): `ElectroCare_GitHub_Ready/backend/server.js`
- [Staff bookings](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/backend/server.js): `ElectroCare_GitHub_Ready/backend/server.js`
- [ElectroCare database](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/ElectroCare_GitHub_Ready/database/electrocare.sql): `ElectroCare_GitHub_Ready/database/electrocare.sql`

### Digit recognition

- [Image upload and prediction](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/app.py): `app.py`

### Model training

- [CNN training](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/training/train.py): `training/train.py`
- [MNIST data loaders](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/dataset/dataset.py): `dataset/dataset.py`
- [CNN weights](https://github.com/trungpham07012004/-trungpham07012004-24ct1-pham_phuoc_trung_de_tai_sua_chua_do_dien_tu/blob/main/models/model.pth): `models/model.pth`

### Other components

- **Customer**
- **Staff / admin**
- **Digit recognizer user**
- **MNIST dataset**

## Connections

- Customer → ElectroCare web app: uses (evidence: `ElectroCare_GitHub_Ready/frontend/app.js`)
- Staff / admin → ElectroCare web app: uses (evidence: `ElectroCare_GitHub_Ready/frontend/app.js`)
- ElectroCare web app → Account access: requests auth (evidence: `ElectroCare_GitHub_Ready/frontend/app.js`)
- ElectroCare web app → Service catalog: requests services
- ElectroCare web app → Repair bookings: submits bookings
- ElectroCare web app → Ticket tracking: requests tickets
- ElectroCare web app → Quote approval: approves quotes
- ElectroCare web app → Staff bookings: requests staff view
- Account access → ElectroCare database: reads / writes (evidence: `ElectroCare_GitHub_Ready/backend/server.js`)
- Service catalog → ElectroCare database: reads (evidence: `ElectroCare_GitHub_Ready/backend/server.js`)
- Repair bookings → ElectroCare database: writes booking (evidence: `ElectroCare_GitHub_Ready/backend/server.js`)
- Ticket tracking → ElectroCare database: reads tickets (evidence: `ElectroCare_GitHub_Ready/backend/server.js`)
- Quote approval → ElectroCare database: updates quote (evidence: `ElectroCare_GitHub_Ready/backend/server.js`)
- Staff bookings → ElectroCare database: reads bookings (evidence: `ElectroCare_GitHub_Ready/backend/server.js`)
- Digit recognizer user → Image upload and prediction: uploads image (evidence: `app.py`)
- Image upload and prediction → CNN weights: loads weights (evidence: `app.py`)
- CNN training → MNIST data loaders: loads batches (evidence: `training/train.py`)
- MNIST data loaders → MNIST dataset: downloads data (evidence: `dataset/dataset.py`)
- CNN training → CNN weights: saves weights (evidence: `training/train.py`)
