docs: refresh diagrams and add node overview

This commit is contained in:
Tero Halla-aho 2025-11-25 22:04:55 +02:00
parent 27a1be729f
commit f686a160e3
3 changed files with 68 additions and 37 deletions

View file

@ -16,13 +16,13 @@
<div class="diagram"> <div class="diagram">
<pre class="mermaid"> <pre class="mermaid">
flowchart LR flowchart LR
Browser[Client browser] -->|HTTP/HTTPS| Next[Next.js App Router / SSR-ISR + API routes] Browser["Client browser"] -->|"HTTPS"| Next["Next.js App Router\nSSR/ISR + API routes"]
Next --> Prisma[Prisma ORM] Next --> Auth["Auth/session module\n(JWT cookie)"]
Next --> Prisma["Prisma ORM"]
Prisma --> Postgres[(PostgreSQL)] Prisma --> Postgres[(PostgreSQL)]
Next --> Mailer[SMTP mailer (smtp.sohva.org + DKIM)] Next --> Mailer["SMTP mailer\nsmtp.sohva.org + DKIM"]
Next --> Storage[Image URLs (remote bucket)] Next --> Storage["Image storage (remote bucket)"]
Admin[Admin and Moderators] --> Next Admin["Admins & moderators"] --> Next
Next --> Auth[Auth module / JWT session cookie]
</pre> </pre>
</div> </div>
<div class="callout">Edit the Mermaid block above to evolve the architecture.</div> <div class="callout">Edit the Mermaid block above to evolve the architecture.</div>
@ -41,8 +41,8 @@ flowchart LR
string id string id
string email string email
string passwordHash string passwordHash
Role role string role
UserStatus status string status
datetime emailVerifiedAt datetime emailVerifiedAt
datetime approvedAt datetime approvedAt
datetime rejectedAt datetime rejectedAt
@ -50,23 +50,27 @@ flowchart LR
} }
LISTING { LISTING {
string id string id
ListingStatus status string status
datetime approvedAt datetime approvedAt
datetime rejectedAt datetime rejectedAt
datetime removedAt datetime removedAt
string country string country
string region string region
string city string city
float latitude
float longitude
} }
LISTINGTRANSLATION { LISTINGTRANSLATION {
string id string id
string slug string slug
string title string title
string locale string locale
string teaser
} }
LISTINGIMAGE { LISTINGIMAGE {
string id string id
string url string url
boolean isCover
} }
</pre> </pre>
</div> </div>

View file

@ -16,16 +16,16 @@
<div class="diagram"> <div class="diagram">
<pre class="mermaid"> <pre class="mermaid">
flowchart LR flowchart LR
Dev[Developer] -->|npm run lint| Lint Dev["Developer"] -->|"npm run lint"| Lint
Dev --> BuildScript[./deploy/build.sh] Dev --> Build["./deploy/build.sh"]
Lint --> BuildScript Lint --> Build
BuildScript --> Docker[Docker buildx multi-stage] Build --> Docker["Docker buildx\nmulti-stage"]
Docker --> Image[registry.halla-aho.net/thalla/lomavuokraus-web] Docker --> Image["registry.halla-aho.net/thalla/lomavuokraus-web"]
Image --> Push[./deploy/push.sh] Image --> Push["./deploy/push.sh"]
Push --> DeployStg[./deploy/deploy-staging.sh] Push --> DeployStg["./deploy/deploy-staging.sh"]
Push --> DeployProd[./deploy/deploy-prod.sh] Push --> DeployProd["./deploy/deploy-prod.sh"]
DeployStg --> K8sStg[kubectl apply + rollout (staging)] DeployStg --> RolloutStg["kubectl apply + rollout\n(staging)"]
DeployProd --> K8sProd[kubectl apply + rollout (prod)] DeployProd --> RolloutProd["kubectl apply + rollout\n(prod)"]
</pre> </pre>
</div> </div>
<div class="callout">Edit the Mermaid block to reflect pipeline changes; no external tooling required.</div> <div class="callout">Edit the Mermaid block to reflect pipeline changes; no external tooling required.</div>

View file

@ -15,28 +15,55 @@
<h2>Traffic flow</h2> <h2>Traffic flow</h2>
<div class="diagram"> <div class="diagram">
<pre class="mermaid"> <pre class="mermaid">
graph LR flowchart LR
User[User Browser] -->|HTTPS| Traefik[Traefik Ingress (IngressClass traefik)] DNS["lomavuokraus.fi\nstaging.lomavuokraus.fi\napi.lomavuokraus.fi"] --> Traefik["Traefik ingress\n(class: traefik)"]
Traefik -->|Host: lomavuokraus.fi / staging.lomavuokraus.fi| Service[Service port 80 to 3000] User["User browser"] -->|"HTTPS"| Traefik
Service --> Pod[Next.js Pods (2)] CertMgr["cert-manager\nletsencrypt prod/staging"] -->|"TLS"| Traefik
Pod --> DB[(PostgreSQL 46.62.203.202)] subgraph Cluster["k3s hel1 cx22 (157.180.66.64)"]
Pod --> SMTP[smtp.sohva.org] Traefik --> Service["Service :80 -> 3000"]
subgraph Cluster [k3s Cluster hel1 cx22 157.180.66.64] Service --> Pod["Next.js pods (2)"]
Traefik Pod --> DB["PostgreSQL 46.62.203.202"]
Service Pod --> SMTP["smtp.sohva.org"]
Pod Secret["Secret: lomavuokraus-web-secrets"]
CertMgr[cert-manager] CM["ConfigMap: lomavuokraus-web-config"]
Secret[Secrets: lomavuokraus-web-secrets]
CM[ConfigMap: lomavuokraus-web-config]
end end
CertMgr -->|TLS| Traefik Registry["registry.halla-aho.net/thalla/lomavuokraus-web"] -->|"pull"| Pod
Registry[registry.halla-aho.net/thalla/lomavuokraus-web] -->|pull| Pod
DNS[lomavuokraus.fi / staging.lomavuokraus.fi / api.lomavuokraus.fi] --> Traefik
</pre> </pre>
</div> </div>
<div class="callout">Mermaid renders directly in the browser; edit the graph in this file to update.</div> <div class="callout">Mermaid renders directly in the browser; edit the graph in this file to update.</div>
</section> </section>
<section class="card">
<h2>Hetzner nodes</h2>
<div class="diagram">
<pre class="mermaid">
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
</pre>
</div>
</section>
<section class="card"> <section class="card">
<h2>Cluster &amp; Namespaces</h2> <h2>Cluster &amp; Namespaces</h2>
<ul> <ul>