2026-03-05 23:04:27 +01:00
# Compagnie AspiRêves
2026-02-21 13:51:19 +01:00
2026-03-05 23:04:27 +01:00
Site web de la Compagnie AspiRêves, compagnie de spectacle vivant basée dans le Tarn.
2026-02-21 13:51:19 +01:00
2026-03-05 23:04:27 +01:00
Construit avec [Astro ](https://astro.build/ ) et [StoryBlok ](https://www.storyblok.com/ ) comme CMS headless.
2026-02-21 13:51:19 +01:00
2026-03-05 23:04:27 +01:00
## Prérequis
2026-02-21 13:51:19 +01:00
2026-03-05 23:04:27 +01:00
- Node.js >= 20
- Un fichier `.env` (voir `.env.example` )
2026-02-21 13:51:19 +01:00
2026-03-05 23:04:27 +01:00
## Développement
2026-02-21 13:51:19 +01:00
2026-03-05 23:04:27 +01:00
```bash
npm install
npm run dev
```
2026-02-21 13:51:19 +01:00
2026-03-05 23:04:27 +01:00
Le serveur démarre sur `http://localhost:3030` .
## Builds
2026-03-07 01:27:43 +01:00
Le projet supporte deux modes de build via la variable `PUBLIC_STORYBLOK_IS_PREVIEW` :
2026-03-05 23:04:27 +01:00
### Production (SSG)
Site statique, performant, sans serveur Node.js. Utilise le **Public Access Token** StoryBlok et ne récupère que le contenu **publié** .
```bash
npm run build
```
Génère des fichiers HTML statiques dans `dist/` . Le rebuild doit être déclenché par un **webhook StoryBlok** (Settings > Webhooks) à chaque publication de contenu.
### Preview (SSR)
Serveur Node.js avec le **visual editor StoryBlok** (bridge + live preview). Utilise le **Preview Access Token** et récupère le contenu en **draft** .
```bash
2026-03-07 01:27:43 +01:00
PUBLIC_STORYBLOK_IS_PREVIEW=true npm run build
2026-03-05 23:04:27 +01:00
HOST=0.0.0.0 node dist/server/entry.mjs
```
Le serveur démarre sur le port `8080` par défaut (configurable via `PORT` ).
### Variables d'environnement
| Variable | Production | Preview |
|---|---|---|
2026-03-07 01:27:43 +01:00
| `PUBLIC_STORYBLOK_TOKEN` | Public Access Token | Preview Access Token |
| `PUBLIC_STORYBLOK_IS_PREVIEW` | *(non défini)* | `true` |
2026-03-07 22:03:01 +01:00
| `STORYBLOK_WEBHOOK_SECRET` | - | Secret du webhook StoryBlok |
2026-03-07 20:00:57 +01:00
| `CLEVER_TOKEN` | - | Token OAuth Clever Cloud |
2026-03-07 22:37:36 +01:00
| `CLEVER_ORGA_ID` | - | ID de l'organisation (orga_xxx) |
2026-03-07 20:00:57 +01:00
| `CLEVER_APP_ID_PRODUCTION` | - | ID de l'app production (app_xxx) |
2026-03-05 23:04:27 +01:00
| `CC_POST_BUILD_HOOK` | `npm run build` | `npm run build` |
| `HOST` | - | `0.0.0.0` |
### Configuration StoryBlok
- **Settings > Visual Editor** : mettre l'URL de l'instance preview comme environnement par défaut
2026-03-07 20:00:57 +01:00
- **Settings > Webhooks** : configurer un webhook `POST` vers `https://<preview-instance>/api/rebuild` pour déclencher le rebuild production à chaque publication