# Poruka za server admina (copy-paste u Slack/email)

---

**Bok,**

Šaljem ti Polleo Demand aplikaciju za deploy na **nabava.polleosport.com**.

## Što je

Interna app za demand planning + supply chain za Polleo Sport. Single-host deploy.

## Stack

- **FastAPI** (Python 3.12)
- **React + Vite** (TypeScript, output `npm run build` → `frontend/dist/`)
- **PostgreSQL 16+**
- **nginx + Let's Encrypt**
- **systemd** servis `nabava-api`

## Putanje

| | |
|---|---|
| App direktorij | `/var/www/html/nabava.polleosport.com` |
| Javni URL | `https://nabava.polleosport.com` |
| GitHub repo | https://github.com/polleosport/polleo-demand |

## Sve što ti treba je u `deploy/`

- **`CI_CD.md`** ← GitHub Actions CI/CD upute
- **`VPS_DAY1_CHECKLIST.md`** ← printable checklist (počni ovdje)
- **`HANDOFF.md`** ← overview + production checklist
- **`DEPLOY.md`** ← detaljni step-by-step
- **`nginx.conf.example`** ← drop-in nginx site
- **`nabava-api.service`** ← drop-in systemd unit
- **`smoke_test.sh`** ← pokreni nakon deploya

Plus `.env.example` u rootu — copy → `.env`, popuni:
- `APP_ENV=production`
- `DATABASE_URL=postgresql://polleo:STRONG_PW@localhost:5432/polleo_demand`
- `JWT_SECRET=` (generiraj: `python -c "import secrets; print(secrets.token_urlsafe(64))"`)
- `CORS_ORIGINS=https://nabava.polleosport.com`

## CI/CD (GitHub Actions)

Nakon ručnog setupa servera:
1. Sudoers + SSH ključ + GitHub Secrets (`VPS_HOST`, `VPS_USER`, `VPS_SSH_KEY`)
2. `git push origin master` → automatski deploy

Detalji: `deploy/CI_CD.md`

## Što trebam od tebe

1. Host s Python 3.12 + Postgres 16 + nginx + Node 20+
2. DNS za `nabava.polleosport.com` → server
3. TLS cert (Let's Encrypt)
4. Slijedi `deploy/VPS_DAY1_CHECKLIST.md`
5. `python scripts/init_passwords.py` → pošalji mi printane lozinke
6. `bash deploy/smoke_test.sh https://nabava.polleosport.com`
7. Javi kad smoke test prođe

## Moj kontakt

Lovro Ljutić, lljutic@polleosport.com

**Pozdrav,**
Lovro
