# START_HERE — Iðunn

Read this first when you land on **CT116**.

**Iðunn** is a food-health companion (bot / site / later app) that logs meals, remembers the kitchen, and coaches toward a modern Nordic ancestral plate. This guest is **Phase 2**: Hello World + foundation API (users, kitchen, markdown profiles, usage meter). The product is **not live**. No Telegram bot yet.

## Where you are

| | |
|---|---|
| Guest | LXC **116**, hostname `idunn`, Debian 13 |
| LAN | `192.168.42.116` |
| Public | `https://idunn.2powerful.de` |
| Hello World | `http://192.168.42.116:8080/` |
| Prototype app | `http://192.168.42.116:8080/app.html` |
| API | `http://192.168.42.116:8000/` and `/api/` on :8080 |
| Docs on disk | `/opt/idunn/docs/` |
| Store | `/opt/idunn/data/idunn.sqlite` + `data/md/users/<id>/` |
| Compose | `/opt/idunn/docker-compose.yml` |

Host briefing stays in `/root/PROXMOX.md` on the Proxmox node. **Iðunn docs live here, inside the CT**, not under `/root/idunn` on the host.

## Read order

1. This file
2. `CONCEPT.md` — vision, plate, surfaces
3. `PHILOSOPHY.md` — what Iðunn prefers and calls out
4. `/opt/idunn/internal/CONSTITUTION.md` — hidden coach guardrails (not served on the Hello World docs index)
5. `ROADMAP.md` — combined phases
6. Then as needed: `FOOD_ONTOLOGY.md`, `RECIPES.md`, `INVENTORY.md`, `PROFILES.md`, `MULTIUSER_METERING.md`, `RESOURCES.md`

## Prototype rule (v1)

This is a **mockup to show the idea**. Do not build a fortress.

- Data does **not** need to be super-safe in v1.
- Simple per-user `user_id` on rows is enough to *demonstrate* isolation. No encryption-at-rest, no HSM, no hardened auth, no production GDPR programme yet.
- The Hello World even serves most docs over plain HTTP on the LAN. That is fine for a prototype.
- When (if) this leaves the household, Phase 5 hardens. Not now.

## Coach rule (for later, already decided)

The bot is **not a doctor**. It advises. **The user decides.** Always point people to research **both directions** and keep an open eye on what actually makes sense for them.

## What not to do on this box yet

- Do not add a Telegram token (Phase 3)
- Do not add `XAI_API_KEY` (Phase 3)
- Do not merge with TestoTracker (CT113)
- Do not treat SQLite as a fortress — this is a mockup

## Useful commands

```bash
cd /opt/idunn
docker compose ps
curl -sS http://127.0.0.1:8080/health
curl -sS http://127.0.0.1:8000/users
ls docs data/md/users
```

From the Proxmox host: `pct exec 116 -- bash`


## Telegram / AI keys (Phase 3)

Secrets live in `/opt/idunn/.env` (mode 600). Copy from `.env.example`.

1. Create a bot with BotFather, put `TELEGRAM_BOT_TOKEN` in `.env`
2. Optional: SpaceXAI key from https://console.x.ai as `XAI_API_KEY` (photos + voice + coach JSON)
3. `cd /opt/idunn && docker compose up -d --build api`

Webhook: `https://idunn.2powerful.de/tg-hook`  
Header: `X-Telegram-Bot-Api-Secret-Token` (same as Minecraft). Without the xAI key the bot still logs text and leftovers.


## Machine room

Host briefing: on the Proxmox node see `/root/IDUNN.md`.

Configure keys and watch lamps: https://idunn.2powerful.de/admin  
Password is `ADMIN_PASSWORD` in `/opt/idunn/.env`.


## Telegram

User guide: [TELEGRAM.md](TELEGRAM.md)
