# EU Media Guide CMS CMS basato su Grav per la gestione dei contenuti multilingua della media guide. ## Struttura del Progetto ``` grav-cms-mediaguide/ ├── docker-compose.yml # Config Docker per Coolify ├── config/ │ ├── system.yaml # Config sistema (24 lingue EU) │ └── site.yaml # Config sito ├── blueprints/ │ └── station.yaml # Blueprint per le stazioni/moduli ├── pages/ │ └── stations/ │ └── test-module/ # Modulo di test ├── plugins/ │ └── json-export/ # Plugin per export JSON + API └── README.md ``` ## Deploy su Coolify ### 1. Crea Repository Git ```bash cd grav-cms-mediaguide git init git add . git commit -m "Initial CMS setup" git remote add origin git push -u origin main ``` ### 2. Deploy su Coolify 1. In Coolify, crea un nuovo servizio **Docker Compose** 2. Collega il repository Git 3. Imposta la porta pubblica su `8080` 4. Deploy! ### 3. Setup Iniziale Grav Dopo il primo deploy, accedi al container e crea l'utente admin: ```bash # Accedi al container docker exec -it mediaguide-cms bash # Crea utente admin bin/plugin login new-user ``` ### 4. Installa Plugin Admin ```bash bin/gpm install admin ``` ## API Endpoints Il plugin `json-export` espone questi endpoint: | Endpoint | Descrizione | |----------|-------------| | `GET /api/stations?lang=en` | Lista tutte le stazioni | | `GET /api/station/{id}?lang=en` | Contenuto singola stazione | | `GET /api/translations?lang=en` | Traduzioni UI | | `GET /api/export` | Esporta tutto in file JSON | ### Esempio Risposta `/api/station/test-welcome?lang=en` ```json { "id": "test-welcome", "type": "intro", "language": "en", "title": "Welcome to the European Parliament", "description": "Your interactive guide to European democracy", "components": [ { "id": "welcome-heading", "type": "heading", "level": "h1", "content": "Welcome to the European Parliament" }, { "id": "intro-text", "type": "text", "content": "

Welcome to the heart of European democracy...

" }, { "id": "welcome-video", "type": "video", "src": "/media/videos/welcome-en.mp4", "poster": "/media/images/video-poster.jpg", "caption": "A brief introduction to the European Parliament" } ] } ``` ## Lingue Supportate (Ordine Protocollo UE) | Codice | Lingua | |--------|--------| | bg | български | | es | español | | cs | čeština | | da | dansk | | de | Deutsch | | et | eesti | | el | ελληνικά | | en | English | | fr | français | | ga | Gaeilge | | hr | hrvatski | | it | italiano | | lv | latviešu | | lt | lietuvių | | hu | magyar | | mt | Malti | | nl | Nederlands | | pl | polski | | pt | português | | ro | română | | sk | slovenčina | | sl | slovenščina | | fi | suomi | | sv | svenska | ## Gestione Contenuti ### Creare una Nuova Stazione 1. Accedi all'admin panel: `http://your-domain:8080/admin` 2. Vai su **Pages** → **Add** → **Station** 3. Compila i campi multilingua 4. Aggiungi i componenti (heading, text, video, audio, tabs, slideshow) 5. Salva ### Struttura File Markdown Ogni stazione è un file `.md` con frontmatter YAML: ```yaml --- title: Station Title station_id: unique-id station_type: exhibit active: true order: 1 title_translations: en: English Title fr: Titre français components: - type: heading id: heading-1 level: h1 content: en: English Heading fr: Titre français --- ``` ## Prossimi Passi 1. [ ] Deploy del CMS su Coolify 2. [ ] Configurare l'admin panel 3. [ ] Creare il container React per l'app 4. [ ] Collegare l'app agli endpoint API del CMS