# Mintel Alpha Platform — Developer Cheat Sheet

This platform runs real customer websites on their own domains  
(e.g. klz-cables.com, marisas.world, shop.customer.de).

You do not manage servers.  
You ship Docker containers.  
Mintel runs the platform.

---

## Control Plane (Infra)

Internal services (developers only):

Git (Gitea)  
https://git.infra.mintel.me  

CI (Gitea Actions)  
https://git.infra.mintel.me/actions  

Container Registry  
https://registry.infra.mintel.me  

Error Tracking (GlitchTip)  
https://errors.infra.mintel.me  

Analytics (Umami)  
https://analytics.infra.mintel.me  

Uptime  
https://status.infra.mintel.me  

Logs (Dozzle)  
https://logs.infra.mintel.me  

---

## SMTP

# SMTP Config
SMTP_HOST=
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=
SMTP_PASS=
SMTP_FROM= # muss im projekt gesetzt werden

---

## Shared Image Optimization (imgproxy)

Alle Bilder werden zentral über **imgproxy** optimiert, resized und in moderne Formate (WebP, AVIF) konvertiert.

**Basis-URL**  
https://img.infra.mintel.me

```text
https://img.infra.mintel.me/unsafe/rs:800x600/plain/https://example.com/bild.jpg
https://img.infra.mintel.me/rs:400x/plain/https://picsum.photos/2000/1333

---

## Production Platform (Alpha)

Alpha runs all customer websites and is publicly reachable.

- Listens on ports 80 / 443
- Runs Traefik
- Routes real domains
- Is isolated from Infra

Customer DNS A records point to the Alpha server IP.

---

## Routing (Traefik)

Routing is host-based.

Each service declares its domains via labels:

labels:
  - traefik.enable=true
  - traefik.http.routers.app.rule=Host(example.com,www.example.com)
  - traefik.http.routers.app.entrypoints=websecure
  - traefik.http.routers.app.tls.certresolver=le
  - traefik.http.services.app.loadbalancer.server.port=3000

Traefik:
- terminates TLS
- auto-issues certificates
- supports zero-downtime deploys

---

## Directory layout on Alpha

Each app lives in:

/opt/alpha/sites/APP_NAME

Contains:

docker-compose.yml  
.env (optional)  
content/  
db/  

---

## Container Images

All production images are built by CI and pushed to the Mintel Registry.

Registry:
registry.infra.mintel.me

Naming:
registry.infra.mintel.me/ORG/APP_NAME:TAG

Example:
registry.infra.mintel.me/mintel/mb-grid-solutions:latest

---

## Databases

### Postgres (shared)

One Postgres server, many databases.

Connection format:
postgres://infra:infra@postgres:5432/APP_DB

Each app must use its own database.

---

### Redis (shared)

One Redis instance, multiple DB indexes.

redis://redis:6379/1  
redis://redis:6379/2  

Each app must use its own DB number.

---

## Health checks (required)

Every public service must expose:

GET /health → 200 OK when ready

Used by Traefik for zero-downtime routing.

---

## Error Tracking (GlitchTip)

Each app gets a DSN:

https://PUBLIC_KEY@errors.infra.mintel.me/PROJECT_ID

Set as:
SENTRY_DSN

---

## Analytics (Umami)

Each site gets a website ID.

Include:

https://analytics.infra.mintel.me/script.js  
data-website-id=YOUR_ID

---

## Deployment (Gitea Actions)

Flow:

- Push to main
- CI builds image
- Image pushed to registry
- Alpha pulls and runs
- Traefik routes traffic

Deploy target:
deploy@alpha.mintel.me

---

## Monitoring

Errors → GlitchTip  
Traffic → Umami  
Logs → Dozzle  
Uptime → Uptime-Kuma  

Infra monitors everything.

---

## Summary

You push code  
CI builds images  
Registry stores images  
Alpha runs containers  
Traefik routes domains  
Databases are shared but isolated  
Deploys are zero-downtime  
Everything is monitored  

This is a real production platform.