# đēī¸ āšā¸ā¸ā¸ā¸ąā¸ Network Architecture & Container Services (LCBP3-DMS)
āšā¸ā¸ā¸ā¸ąā¸ā¸ā¸ĩāšāšā¸Ēā¸ā¸ā¸ā¸˛ā¸Ŗāšā¸āšā¸ā¸Ēāšā¸§ā¸āšā¸ā¸Ŗā¸ˇā¸ā¸āšā¸˛ā¸ĸ (VLANs), ā¸ā¸˛ā¸Ŗāšā¸ā¸ˇāšā¸ā¸Ąā¸āšā¸ Firewall (ACLs) āšā¸Ĩ⏰ā¸ā¸ā¸ā¸˛ā¸ā¸ā¸ā¸ Server ā¸ā¸ąāšā¸ā¸Ēā¸ā¸ā¸ā¸ąā¸§ (QNAP: Application, ASUSTOR: Infrastructure)
> đ **ā¸ā¸šā¸Ŗā¸˛ā¸ĸā¸Ĩ⏰āšā¸ā¸ĩā¸ĸ⏠Server Roles āšā¸Ĩ⏰ Service Distribution āšā¸āšā¸ā¸ĩāš:** [README.md](README.md#-hardware-infrastructure)
---
## 2. Data Flow Diagram
```mermaid
flowchart TB
subgraph Internet["đ Internet"]
User[("đ¤ User")]
end
subgraph QNAP["đž QNAP TS-473A (App Server)"]
NPM["đ˛ NPM
(Reverse Proxy)"]
Frontend["đą Next.js
(Frontend)"]
Backend["âī¸ NestJS
(Backend API)"]
DB["đī¸ MariaDB"]
Redis["đĻ Redis"]
ES["đ Elasticsearch"]
end
subgraph ASUSTOR["đž ASUSTOR AS5403T (Infra Server)"]
Portainer["đŗ Portainer"]
Registry["đĻ Registry"]
Prometheus["đ Prometheus"]
Grafana["đ Grafana"]
Uptime["âąī¸ Uptime Kuma"]
Backup["đž Restic/Borg"]
NFS["đ NFS Storage"]
end
User -->|HTTPS 443| NPM
NPM --> Frontend
NPM --> Backend
Frontend --> Backend
Backend --> DB
Backend --> Redis
Backend --> ES
DB -.->|Scheduled Backup| Backup
Backup --> NFS
Portainer -.->|Manage| QNAP
Prometheus -.->|Collect Metrics| Backend
Prometheus -.->|Collect Metrics| DB
Uptime -.->|Health Check| NPM
```
---
## 3. Docker Management View
```mermaid
flowchart TB
subgraph Portainer["đŗ Portainer (ASUSTOR - Central Management)"]
direction TB
subgraph LocalStack["đĻ Local Infra Stack"]
Registry["Docker Registry"]
Prometheus["Prometheus"]
Grafana["Grafana"]
Uptime["Uptime Kuma"]
Backup["Restic/Borg"]
Loki["Loki (Logs)"]
ClamAV["ClamAV"]
end
subgraph RemoteStack["đ Remote: QNAP App Stack"]
Frontend["Next.js"]
Backend["NestJS"]
MariaDB["MariaDB"]
Redis["Redis"]
ES["Elasticsearch"]
NPM["NPM"]
Gitea["Gitea"]
N8N["n8n"]
PMA["phpMyAdmin"]
end
end
```
---
## 4. Security Zones Diagram
```mermaid
flowchart TB
subgraph PublicZone["đ PUBLIC ZONE"]
direction LR
NPM["NPM (Reverse Proxy)"]
SSL["SSL/TLS Termination"]
end
subgraph AppZone["đą APPLICATION ZONE (QNAP)"]
direction LR
Frontend["Next.js"]
Backend["NestJS"]
N8N["n8n"]
Gitea["Gitea"]
end
subgraph DataZone["đž DATA ZONE (QNAP - Internal Only)"]
direction LR
MariaDB["MariaDB"]
Redis["Redis"]
ES["Elasticsearch"]
end
subgraph InfraZone["đ ī¸ INFRASTRUCTURE ZONE (ASUSTOR)"]
direction LR
Backup["Backup Services"]
Registry["Docker Registry"]
Monitoring["Prometheus + Grafana"]
Logs["Loki / Syslog"]
end
PublicZone -->|HTTPS Only| AppZone
AppZone -->|Internal API| DataZone
DataZone -.->|Backup| InfraZone
AppZone -.->|Metrics| InfraZone
```
---
## 5. āšā¸ā¸ā¸ā¸ąā¸ā¸ā¸˛ā¸Ŗāšā¸ā¸ˇāšā¸ā¸Ąā¸āšā¸āšā¸ā¸Ŗā¸ˇā¸ā¸āšā¸˛ā¸ĸ (Network Flow)
```mermaid
graph TD
direction TB
subgraph Flow1["ā¸ā¸˛ā¸Ŗāšā¸ā¸ˇāšā¸ā¸Ąā¸āšā¸ā¸ā¸˛ā¸ā¸ ⏞ā¸ĸā¸ā¸ā¸ (Public WAN)"]
User["ā¸ā¸šāšāšā¸āšā¸ā¸˛ā¸ā¸ ⏞ā¸ĸā¸ā¸ā¸ (Internet)"]
end
subgraph Router["Router (ER7206) - Gateway"]
User -- "Port 80/443 (HTTPS/HTTP)" --> ER7206
ER7206["Port Forwarding
TCP 80 â 192.168.10.8:80
TCP 443 â 192.168.10.8:443"]
end
subgraph VLANs["āšā¸ā¸Ŗā¸ˇā¸ā¸āšā¸˛ā¸ĸ⏠⏞ā¸ĸāšā¸ (VLANs & Firewall Rules)"]
direction LR
subgraph VLAN10["VLAN 10: Servers
192.168.10.x"]
QNAP["QNAP NAS
(192.168.10.8)"]
ASUSTOR["ASUSTOR NAS
(192.168.10.9)"]
end
subgraph VLAN20["VLAN 20: MGMT
192.168.20.x"]
AdminPC["Admin PC / Switches"]
end
subgraph VLAN30["VLAN 30: USER
192.168.30.x"]
OfficePC["PC ā¸ā¸ā¸ąā¸ā¸ā¸˛ā¸/Wi-Fi"]
end
subgraph VLAN70["VLAN 70: GUEST
192.168.70.x"]
GuestPC["Guest Wi-Fi"]
end
subgraph Firewall["Firewall ACLs (OC200/ER7206)"]
direction TB
rule1["Rule 1: DENY
Guest (VLAN 70) â All VLANs"]
rule2["Rule 2: DENY
Server (VLAN 10) â User (VLAN 30)"]
rule3["Rule 3: ALLOW
User (VLAN 30) â QNAP
Ports: 443, 80"]
rule4["Rule 4: ALLOW
MGMT (VLAN 20) â All"]
end
GuestPC -.x|rule1| QNAP
QNAP -.x|rule2| OfficePC
OfficePC -- "https://lcbp3.np-dms.work" -->|rule3| QNAP
AdminPC -->|rule4| QNAP
AdminPC -->|rule4| ASUSTOR
end
ER7206 --> QNAP
subgraph DockerQNAP["Docker 'lcbp3' (QNAP - Applications)"]
direction TB
subgraph PublicServices["Services ā¸ā¸ĩāš NPM āšā¸ā¸´ā¸ā¸Ēā¸šāšā¸ ⏞ā¸ĸā¸ā¸ā¸"]
direction LR
NPM["NPM (Nginx Proxy Manager)"]
FrontendC["frontend:3000"]
BackendC["backend:3000"]
GiteaC["gitea:3000"]
PMAC["pma:80"]
N8NC["n8n:5678"]
end
subgraph InternalServices["Internal Services (Backend Only)"]
direction LR
DBC["mariadb:3306"]
CacheC["cache:6379"]
SearchC["search:9200"]
end
NPM -- "lcbp3.np-dms.work" --> FrontendC
NPM -- "backend.np-dms.work" --> BackendC
NPM -- "git.np-dms.work" --> GiteaC
NPM -- "pma.np-dms.work" --> PMAC
NPM -- "n8n.np-dms.work" --> N8NC
BackendC -- "lcbp3 Network" --> DBC
BackendC -- "lcbp3 Network" --> CacheC
BackendC -- "lcbp3 Network" --> SearchC
end
subgraph DockerASUSTOR["Docker 'lcbp3' (ASUSTOR - Infrastructure)"]
direction TB
subgraph InfraServices["Infrastructure Services"]
direction LR
PortainerC["portainer:9443"]
RegistryC["registry:5000"]
PrometheusC["prometheus:9090"]
GrafanaC["grafana:3000"]
UptimeC["uptime-kuma:3001"]
end
subgraph BackupServices["Backup & Storage"]
direction LR
ResticC["restic/borg"]
NFSC["NFS Share"]
end
PortainerC -.->|"Remote Endpoint"| NPM
PrometheusC -.->|"Scrape Metrics"| BackendC
ResticC --> NFSC
end
QNAP --> NPM
ASUSTOR --> PortainerC
DBC -.->|"Scheduled Backup"| ResticC
```
---
## 6. ā¸Ē⏪⏏ā¸ā¸ā¸˛ā¸Ŗā¸ā¸ąāšā¸ā¸āšā¸˛ Firewall ACLs (ā¸Ē⏺ā¸Ģā¸Ŗā¸ąā¸ Omada OC200)
ā¸ā¸ĩāšā¸ā¸ˇā¸ā¸Ŗā¸˛ā¸ĸā¸ā¸˛ā¸Ŗā¸ā¸ (Rules) ā¸ā¸ĩāšā¸ā¸¸ā¸ā¸āšā¸ā¸ā¸Ē⏪āšā¸˛ā¸āšā¸ **Settings > Network Security > ACL** (āšā¸Ŗā¸ĩā¸ĸā¸ā¸Ĩ⏺ā¸ā¸ąā¸ā¸ā¸˛ā¸ā¸ā¸ā¸Ĩā¸ā¸Ĩāšā¸˛ā¸):
| ā¸Ĩ⏺ā¸ā¸ąā¸ | Name | Policy | Source | Destination | Ports |
| :---- | :--------------------- | :-------- | :---------------- | :------------------------ | :----------------------------------- |
| **1** | Isolate-Guests | **Deny** | Network â VLAN 70 | Network â VLAN 10, 20, 30 | All |
| **2** | Isolate-Servers | **Deny** | Network â VLAN 10 | Network â VLAN 30 (USER) | All |
| **3** | Block-User-to-Mgmt | **Deny** | Network â VLAN 30 | Network â VLAN 20 (MGMT) | All |
| **4** | Allow-User-to-Services | **Allow** | Network â VLAN 30 | IP â QNAP (192.168.10.8) | Port Group â Web (443, 80, 81, 2222) |
| **5** | Allow-MGMT-to-All | **Allow** | Network â VLAN 20 | Any | All |
| **6** | Allow-Server-Internal | **Allow** | IP â 192.168.10.8 | IP â 192.168.10.9 | All (QNAP â ASUSTOR) |
| **7** | (Default) | Deny | Any | Any | All |
---
## 7. ā¸Ē⏪⏏ā¸ā¸ā¸˛ā¸Ŗā¸ā¸ąāšā¸ā¸āšā¸˛ Port Forwarding (ā¸Ē⏺ā¸Ģā¸Ŗā¸ąā¸ Omada ER7206)
ā¸ā¸ĩāšā¸ā¸ˇā¸ā¸Ŗā¸˛ā¸ĸā¸ā¸˛ā¸Ŗā¸ā¸ā¸ā¸ĩāšā¸ā¸¸ā¸ā¸āšā¸ā¸ā¸Ē⏪āšā¸˛ā¸āšā¸ **Settings > Transmission > Port Forwarding**:
| Name | External Port | Internal IP | Internal Port | Protocol |
| :-------------- | :------------ | :----------- | :------------ | :------- |
| Allow-NPM-HTTPS | 443 | 192.168.10.8 | 443 | TCP |
| Allow-NPM-HTTP | 80 | 192.168.10.8 | 80 | TCP |
> **ā¸Ģā¸Ąā¸˛ā¸ĸāšā¸Ģā¸ā¸¸**: Port forwarding āšā¸ā¸ā¸ĩāš QNAP (NPM) āšā¸āšā¸˛ā¸ā¸ąāšā¸, ASUSTOR āšā¸Ąāšā¸ā¸§ā¸Ŗāšā¸ā¸´ā¸ā¸Ŗā¸ąā¸ traffic ā¸ā¸˛ā¸ā¸ ⏞ā¸ĸā¸ā¸ā¸
---
## 6. Container Service Distribution
> đ **ā¸ā¸šā¸Ŗā¸˛ā¸ĸā¸Ĩ⏰āšā¸ā¸ĩā¸ĸ⏠Container Services, Ports, āšā¸Ĩ⏰ Domain Mapping āšā¸āšā¸ā¸ĩāš:** [README.md](README.md#-domain-mapping-npm-proxy)
---
## 9. Backup Flow
```
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â BACKUP STRATEGY â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
â â
â QNAP (Source) ASUSTOR (Target) â
â ââââââââââââââââ ââââââââââââââââââââââââ â
â â MariaDB â ââââ Daily 2AM âââââļ â /volume1/backup/db/ â â
â â (mysqldump) â â (Restic Repository) â â
â ââââââââââââââââ ââââââââââââââââââââââââ â
â â
â ââââââââââââââââ ââââââââââââââââââââââââ â
â â Redis RDB â ââââ Daily 3AM âââââļ â /volume1/backup/ â â
â â + AOF â â redis/ â â
â ââââââââââââââââ ââââââââââââââââââââââââ â
â â
â ââââââââââââââââ ââââââââââââââââââââââââ â
â â App Config â ââââ Weekly ââââââââļ â /volume1/backup/ â â
â â + Volumes â Sunday 4AM â config/ â â
â ââââââââââââââââ ââââââââââââââââââââââââ â
â â
â Retention Policy: â
â âĸ Daily: 7 days â
â âĸ Weekly: 4 weeks â
â âĸ Monthly: 6 months â
â â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
```
---
> đ **ā¸Ģā¸Ąā¸˛ā¸ĸāšā¸Ģā¸ā¸¸**: āšā¸ā¸ā¸Ē⏞⏪ā¸ā¸ĩāšā¸āšā¸˛ā¸ā¸ā¸´ā¸ā¸ā¸˛ā¸ Architecture Document **v1.8.0** - Last updated: 2026-01-28