From f686a160e36e2cfc63f5a3868429da6e5b36d29e Mon Sep 17 00:00:00 2001 From: Tero Halla-aho Date: Tue, 25 Nov 2025 22:04:55 +0200 Subject: [PATCH] docs: refresh diagrams and add node overview --- docs/architecture.html | 24 ++++++++++------- docs/build.html | 20 +++++++------- docs/infra.html | 61 ++++++++++++++++++++++++++++++------------ 3 files changed, 68 insertions(+), 37 deletions(-) diff --git a/docs/architecture.html b/docs/architecture.html index 3def31a..d01c877 100644 --- a/docs/architecture.html +++ b/docs/architecture.html @@ -16,13 +16,13 @@
 flowchart LR
-  Browser[Client browser] -->|HTTP/HTTPS| Next[Next.js App Router / SSR-ISR + API routes]
-  Next --> Prisma[Prisma ORM]
-  Prisma --> Postgres[(PostgreSQL)]
-  Next --> Mailer[SMTP mailer (smtp.sohva.org + DKIM)]
-  Next --> Storage[Image URLs (remote bucket)]
-  Admin[Admin and Moderators] --> Next
-  Next --> Auth[Auth module / JWT session cookie]
+    Browser["Client browser"] -->|"HTTPS"| Next["Next.js App Router\nSSR/ISR + API routes"]
+    Next --> Auth["Auth/session module\n(JWT cookie)"]
+    Next --> Prisma["Prisma ORM"]
+    Prisma --> Postgres[(PostgreSQL)]
+    Next --> Mailer["SMTP mailer\nsmtp.sohva.org + DKIM"]
+    Next --> Storage["Image storage (remote bucket)"]
+    Admin["Admins & moderators"] --> Next
           
Edit the Mermaid block above to evolve the architecture.
@@ -41,8 +41,8 @@ flowchart LR string id string email string passwordHash - Role role - UserStatus status + string role + string status datetime emailVerifiedAt datetime approvedAt datetime rejectedAt @@ -50,23 +50,27 @@ flowchart LR } LISTING { string id - ListingStatus status + string status datetime approvedAt datetime rejectedAt datetime removedAt string country string region string city + float latitude + float longitude } LISTINGTRANSLATION { string id string slug string title string locale + string teaser } LISTINGIMAGE { string id string url + boolean isCover } diff --git a/docs/build.html b/docs/build.html index 8897617..bbb177b 100644 --- a/docs/build.html +++ b/docs/build.html @@ -16,16 +16,16 @@
 flowchart LR
-  Dev[Developer] -->|npm run lint| Lint
-  Dev --> BuildScript[./deploy/build.sh]
-  Lint --> BuildScript
-  BuildScript --> Docker[Docker buildx multi-stage]
-  Docker --> Image[registry.halla-aho.net/thalla/lomavuokraus-web]
-  Image --> Push[./deploy/push.sh]
-  Push --> DeployStg[./deploy/deploy-staging.sh]
-  Push --> DeployProd[./deploy/deploy-prod.sh]
-  DeployStg --> K8sStg[kubectl apply + rollout (staging)]
-  DeployProd --> K8sProd[kubectl apply + rollout (prod)]
+    Dev["Developer"] -->|"npm run lint"| Lint
+    Dev --> Build["./deploy/build.sh"]
+    Lint --> Build
+    Build --> Docker["Docker buildx\nmulti-stage"]
+    Docker --> Image["registry.halla-aho.net/thalla/lomavuokraus-web"]
+    Image --> Push["./deploy/push.sh"]
+    Push --> DeployStg["./deploy/deploy-staging.sh"]
+    Push --> DeployProd["./deploy/deploy-prod.sh"]
+    DeployStg --> RolloutStg["kubectl apply + rollout\n(staging)"]
+    DeployProd --> RolloutProd["kubectl apply + rollout\n(prod)"]
           
Edit the Mermaid block to reflect pipeline changes; no external tooling required.
diff --git a/docs/infra.html b/docs/infra.html index f466a97..24a1870 100644 --- a/docs/infra.html +++ b/docs/infra.html @@ -15,28 +15,55 @@

Traffic flow

-graph LR
-  User[User Browser] -->|HTTPS| Traefik[Traefik Ingress (IngressClass traefik)]
-  Traefik -->|Host: lomavuokraus.fi / staging.lomavuokraus.fi| Service[Service port 80 to 3000]
-  Service --> Pod[Next.js Pods (2)]
-  Pod --> DB[(PostgreSQL 46.62.203.202)]
-  Pod --> SMTP[smtp.sohva.org]
-  subgraph Cluster [k3s Cluster hel1 cx22 157.180.66.64]
-    Traefik
-    Service
-    Pod
-    CertMgr[cert-manager]
-    Secret[Secrets: lomavuokraus-web-secrets]
-    CM[ConfigMap: lomavuokraus-web-config]
-  end
-  CertMgr -->|TLS| Traefik
-  Registry[registry.halla-aho.net/thalla/lomavuokraus-web] -->|pull| Pod
-  DNS[lomavuokraus.fi / staging.lomavuokraus.fi / api.lomavuokraus.fi] --> Traefik
+flowchart LR
+    DNS["lomavuokraus.fi\nstaging.lomavuokraus.fi\napi.lomavuokraus.fi"] --> Traefik["Traefik ingress\n(class: traefik)"]
+    User["User browser"] -->|"HTTPS"| Traefik
+    CertMgr["cert-manager\nletsencrypt prod/staging"] -->|"TLS"| Traefik
+    subgraph Cluster["k3s hel1 cx22 (157.180.66.64)"]
+        Traefik --> Service["Service :80 -> 3000"]
+        Service --> Pod["Next.js pods (2)"]
+        Pod --> DB["PostgreSQL 46.62.203.202"]
+        Pod --> SMTP["smtp.sohva.org"]
+        Secret["Secret: lomavuokraus-web-secrets"]
+        CM["ConfigMap: lomavuokraus-web-config"]
+    end
+    Registry["registry.halla-aho.net/thalla/lomavuokraus-web"] -->|"pull"| Pod
           
Mermaid renders directly in the browser; edit the graph in this file to update.
+
+

Hetzner nodes

+
+
+flowchart TB
+    Users["Users"] -->|"HTTPS"| K3s["Node A: k3s (hel1 cx22)\nTraefik + cert-manager"]
+    subgraph HetznerCloud["Hetzner Cloud"]
+        K3s
+        DB["Node B: Postgres VM\n46.62.203.202"]
+    end
+
+    subgraph Prod["Prod namespace"]
+        Prod1["Next.js pod #1 (prod)"]
+        Prod2["Next.js pod #2 (prod)"]
+    end
+
+    subgraph Staging["Staging namespace"]
+        Stg1["Next.js pod #1 (staging)"]
+        Stg2["Next.js pod #2 (staging)"]
+    end
+
+    K3s --> Prod1
+    K3s --> Stg1
+    Prod1 --> DB
+    Prod2 --> DB
+    Stg1 --> DB
+    Stg2 --> DB
+          
+
+
+

Cluster & Namespaces