Platform bundle: marketing publish, IT ops, packaging, agents mesh.

Volledige Foodlinkk Command Center uitbreiding met social automatisering,
reclamefolder filters, Proxmox monitoring en documentatie.
This commit is contained in:
Aissa
2026-06-09 00:41:27 +00:00
commit 5d60d33db1
212 changed files with 30044 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# Agents
## Mesh (16 agents + Herman)
Herman fungeert als **Co-CEO** in het centrum van het netwerk. Agents communiceren via events (`agent_events`) en worden gevisualiseerd op `/agents?tab=mesh`.
## Nieuwe agents (migratie 016)
| Key | Naam | Rol |
|-----|------|-----|
| `sysops` | SysOps | Proxmox, Docker, VM monitoring |
| `packaging` | Packaging | SVG/PDF verpakkingsontwerp |
## Souls
Elke agent heeft een `soul_md` in PostgreSQL (`agent_souls`). Herman leest souls voor briefing en delegatie.
## Permissions
Module rechten voor Herman: `/settings?tab=permissions` — tabel `herman_permissions`.
## Agent events
Marketing publish, reclamefolder sync en ops refreshes loggen naar `agent_events` voor traceerbaarheid.
+50
View File
@@ -0,0 +1,50 @@
# API referentie (kern)
Base URLs: Cockpit `http://10.4.7.18:8600` · Tools API `http://10.4.7.18:8700`
## Reclame folders
| Method | Path | Beschrijving |
|--------|------|--------------|
| GET | `/api/retail/reclamefolder/chains` | Alle supermarktketens |
| POST | `/api/retail/reclamefolder/refresh` | Sync van reclamefolder.nl |
| GET | `/api/retail/promo-campaigns` | Query: `chain`, `q`, `folder_type`, `valid_days`, `limit` |
Folder links: `https://www.reclamefolder.nl/f/folders/{edition_id}/`
## Marketing publish (Cockpit)
| Method | Path | Beschrijving |
|--------|------|--------------|
| POST | `/api/marketing/upload` | multipart image upload |
| POST | `/api/marketing/publish` | 202 — start background job |
| GET | `/api/marketing/publish/{job_id}` | Job status + result |
| GET | `/api/marketing/publish/history` | Recente jobs |
| GET | `/api/marketing/channels` | Geconfigureerde kanalen |
Kanalen: `twitter`, `linkedin`, `instagram`, `facebook`, `tiktok`, `pinterest`
## Settings social
| Method | Path |
|--------|------|
| GET | `/api/settings/social` |
| PUT | `/api/settings/social/{platform}` |
| POST | `/api/settings/social/{platform}/test` |
## IT Ops
| Method | Path |
|--------|------|
| GET | `/api/ops/topology` |
| GET | `/api/ops/snapshot` |
| POST | `/api/ops/refresh` |
## Packaging
| Method | Path |
|--------|------|
| POST | `/packaging/generate` |
| GET | `/packaging/preview/{id}` |
Zie Tools API OpenAPI op `:8700/docs` voor volledige lijst.
+34
View File
@@ -0,0 +1,34 @@
# Apps & pagina's
## Cockpit modules
| Route | Functie |
|-------|---------|
| `/` | Herman CEO dashboard, briefing |
| `/retail` | Retail 360 — filialen, halal gaps, weer |
| `/marketing` | Marketing hub (tabs) |
| `/marketing?tab=reclame` | Reclame folders — filters keten/type/geldigheid/zoek |
| `/marketing?tab=publish` | Social automatisering — multi-channel publish |
| `/clients`, `/deals` | CRM |
| `/agents` | Agent overzicht |
| `/agents?tab=mesh` | Netwerk visualisatie (Herman centrum) |
| `/ops` | IT Ops topologie |
| `/packaging` | Verpakkingsontwerp |
| `/settings?tab=email` | SMTP/IMAP accounts |
| `/settings?tab=social` | Social API credentials |
| `/settings?tab=permissions` | Herman module rechten |
| `/hermes` | Chat met Hermes |
| `/beurs` | Markt/beurs data |
| `/studio` | ComfyUI studio |
| `/reports` | Rapportage export |
## Tools API modules
- `/retail/*` — Retail 360, promo campaigns, reclamefolder sync
- `/ops/*` — Proxmox/infra snapshots
- `/packaging/*` — SVG/PDF/PNG generatie
- `/research/*`, `/recommendations/*` — Research pipeline
## Docker services
Zie `docker-compose.yml`: redis, tools-api, cockpit, browser-agent, gitea, email-agent, prometheus (monitoring).
+52
View File
@@ -0,0 +1,52 @@
# Architectuur
## Overzicht
```mermaid
flowchart TB
subgraph vm106 [VM106 - 10.4.7.18]
Cockpit[Cockpit :8600]
ToolsAPI[Tools API :8700]
Gitea[Gitea :3001]
PG[(PostgreSQL foodlinkk_db)]
Cockpit --> ToolsAPI
Cockpit --> PG
ToolsAPI --> PG
end
subgraph vm105 [VM105 - 10.4.7.19]
Ollama[Ollama / Hermes]
Chroma[ChromaDB]
end
subgraph proxmox [Proxmox - 10.4.7.14]
Nodes[VM105 + VM106]
end
Cockpit --> Ollama
ToolsAPI --> Ollama
ToolsAPI --> proxmox
```
## Lagen
1. **Presentation** — Cockpit templates (Jinja2), Alpine.js, neo CSS thema
2. **API gateway** — Cockpit routes proxyen naar Tools API waar nodig (`retail.py`, `ops_api.py`)
3. **Services** — Tools API connectors (reclamefolder, Proxmox, RSS, CBS, PDOK)
4. **Data** — PostgreSQL met migraties `001``016`
5. **Agents** — Souls in `agent_souls`, events in `agent_events`, mesh op `/agents`
## Marketing automatisering
- Upload → `marketing_media` tabel + `/static/uploads/marketing/`
- Publish → `POST /api/marketing/publish` → BackgroundTasks → `social_publish_jobs`
- Credentials → `social_integrations` (Settings tab Social API's)
- Zonder keys: `skipped_not_configured` per kanaal
## IT Ops
- `tools-api/app/connectors/proxmox.py` — SSH/API naar Proxmox host
- Snapshots in `infra_snapshots`
- Cockpit `/ops` — SVG topologie met pulse animaties
## Packaging
- Python generator (`svgwrite`, Pillow, `python-barcode`, reportlab)
- Endpoints onder `/packaging/*` (Tools API) + Cockpit UI `/packaging`
+32
View File
@@ -0,0 +1,32 @@
# CSS thema
## Design tokens
Bestand: `cockpit/static/css/tokens.css`
- Donkere neo achtergrond
- Accent kleuren per module (marketing roze, ops cyaan, packaging groen)
## Belangrijkste stylesheets
| Bestand | Gebruik |
|---------|---------|
| `palantir-theme.css` | Basis layout, panels |
| `pulse-theme.css` | KPI cards, live badges, pulse animaties |
| `topnav-neo.css` | Navigatie pills |
| `vertical-tabs.css` | Marketing/agents vertical tabs |
| `mobile.css` | Responsive + PWA |
| `ops-topology.css` | IT Ops SVG topologie |
| `agents-mesh.css` | Agent netwerk visualisatie |
## Conventies
- `.panel` — content secties
- `.feed-card` — list items
- `.btn-pulse*` — gradient action buttons
- `.live-badge` — live indicator
- Alpine.js `x-cloak` voor flash-vrije tabs
## PWA
`static/manifest.json` + `static/sw.js` — installeerbaar op mobiel.
+53
View File
@@ -0,0 +1,53 @@
# Deploy
## Vereisten
- Docker + Docker Compose op VM106
- PostgreSQL container `foodlinkk_db`
- SSH toegang: `aissa@10.4.7.18`
## Eén deploy (aanbevolen)
Vanaf de monorepo root:
```bash
chmod +x deploy-all.sh
./deploy-all.sh
```
Het script:
1. Rsync't de volledige codebase naar `~/foodlinkk-command-center` op VM106
2. Voert alle SQL migraties uit (`migrations/*.sql`)
3. Bouwt en herstart containers (`tools-api`, `cockpit`, `email-agent`, `browser-agent`)
4. Voert health checks uit
## Omgevingsvariabelen
Kopieer `.env.example` naar `.env` op de host. Gevoelige waarden nooit committen.
## Gitea
Repository host: `http://10.4.7.18:3001`
```bash
git init
git remote add origin http://10.4.7.18:3001/aissa/foodlinkk-command-center.git
git add .
git commit -m "Platform bundle: ops, packaging, marketing publish"
git push -u origin main
```
## Handmatige migratie (indien nodig)
```bash
docker exec -i foodlinkk_db psql -U aissa -d foodlinkk < migrations/016_platform_ops_packaging.sql
```
## Health checks
```bash
curl http://10.4.7.18:8700/health
curl -o /dev/null -w "%{http_code}\n" http://10.4.7.18:8600/marketing
curl -o /dev/null -w "%{http_code}\n" http://10.4.7.18:8600/ops
```