Date : 30 décembre 2024 (04h00) Priorite : HAUTE - CETTE SEMAINE Objectif : Tester le mode local après migration StorageService
Suite à la session du 29/12/2024 où on a :
getDataService() vers getStorage(sharedMap)mainLes pages de test créées précédemment n'avaient pas le champ template requis :
Avant :
{
"id": "hero-1",
"type": "hero",
"data": {...}
}
Après (corrigé) :
{
"id": "hero-1",
"type": "hero",
"template": "HeroModule",
"enabled": true,
"data": {...}
}
Pages corrigées :
home - HeroModule + FeaturesModuleabout - HeroModule + TextBlockModuleservices - HeroModule + ServicesGridModulecontact - HeroModule + CtaModuletestimonials - HeroModule + TestimonialsModuleRemplacé l'ancienne config "Nova Automobile" par une config de test propre avec :
Problème : .env avait STORAGE_PATH=./STORAGE/data
Mais le code ajoute /data/ au chemin, donc ça donnait ./STORAGE/data/data/config.json
Solution : Changé en STORAGE_PATH=./STORAGE
Le serveur démarre mais renvoie toujours l'erreur :
Site configuration not found
File: file-storage.service.ts:217
STORAGE/data/config.json EXISTE et est valide.env a STORAGE_PATH=./STORAGE (correct)[STORAGE] Initialisé en mode fichier./STORAGE pourrait être interprété depuis un mauvais répertoireFileStorageService.getConfig() pour voir le chemin exact/home/gouroubleu/WS/qwikpress-gitlab/STORAGE dans .envrm -rf node_modules/.vite| Fichier | Modification |
|---|---|
STORAGE/data/config.json |
Config de test propre |
STORAGE/data/pages/home/content.json |
Ajout champ template |
STORAGE/data/pages/about/content.json |
Ajout champ template |
STORAGE/data/pages/services/content.json |
Ajout champ template |
STORAGE/data/pages/contact/content.json |
Ajout champ template |
STORAGE/data/pages/testimonials/content.json |
Ajout champ template |
.env |
STORAGE_PATH=./STORAGE (corrigé) |
.env.local |
Template pour mode local |
.env.supabase |
Template pour mode Supabase |
| Type | Template | Description |
|---|---|---|
| hero | HeroModule | Section hero avec titre/texte/boutons |
| features | FeaturesModule | Grille de fonctionnalités |
| text-block | TextBlockModule | Bloc de texte riche |
| services-grid | ServicesGridModule | Grille de services |
| cta | CtaModule | Call-to-action |
| testimonials | TestimonialsModule | Témoignages clients |
| children-links | ChildrenLinksModule | Liens vers pages enfants |
| filter-bar | FilterBarModule | Barre de filtres |
| dressing-showcase | DressingShowcaseModule | Showcase produits |
# Se connecter à vscode.local
ssh gouroubleu@vscode.local
# Aller dans le projet
cd ~/WS/qwikpress-gitlab
# Lancer en mode local
cp .env.local .env && bun run dev
# Lancer en mode Supabase
cp .env.supabase .env && bun run dev
# Tester le serveur
curl http://192.168.1.154:4500/
1. STORAGE_PATH
./STORAGE ne fonctionnait pas/home/gouroubleu/WS/qwikpress-gitlab/STORAGE2. Format content.json
content.json était un tableau [...]{"modules": [...]}MODE LOCAL VALIDÉ - TOUTES LES PAGES FONCTIONNENT
| Page | URL | Modules |
|---|---|---|
| Accueil | / | HeroModule + FeaturesModule |
| À propos | /about/ | HeroModule + TextBlockModule |
| Services | /services/ | HeroModule + ServicesGridModule |
| Contact | /contact/ | HeroModule + CtaModule |
| Témoignages | /testimonials/ | HeroModule + TestimonialsModule |
.env:
STORAGE_PATH=/home/gouroubleu/WS/qwikpress-gitlab/STORAGE
STORAGE/data/pages/*/content.json:
Format: {"modules": [...]}
Test mode Supabase avec .env.supabase
1. require() non supporté en ESM
src/routes/plugin@data.ts:77const { createClient } = require('@supabase/supabase-js')2. .env.local override .env
.env.local sur .env.env.local en .env.local.backup quand on veut tester Supabase3. Permissions schema manquantes
permission denied for schema qwikpress_testservice_role, authenticated, anonGRANT USAGE ON SCHEMA qwikpress_{slug} TO service_role;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA qwikpress_{slug} TO service_role;
GRANT USAGE ON SCHEMA qwikpress_{slug} TO authenticated;
GRANT SELECT ON ALL TABLES IN SCHEMA qwikpress_{slug} TO authenticated;
GRANT USAGE ON SCHEMA qwikpress_{slug} TO anon;
GRANT SELECT ON ALL TABLES IN SCHEMA qwikpress_{slug} TO anon;
ALTER DEFAULT PRIVILEGES IN SCHEMA qwikpress_{slug}
GRANT ALL ON TABLES TO service_role;
LES 2 MODES FONCTIONNENT !
| Mode | Config | Pages | Status |
|---|---|---|---|
| Local (file) | STORAGE/data/config.json | STORAGE/data/pages/* | ✅ OK |
| Supabase | qwikpress_test.config | qwikpress_test.pages | ✅ OK |
# Mode local
mv .env.supabase .env.supabase.backup 2>/dev/null
mv .env.local.backup .env.local 2>/dev/null
cp .env.local .env
bun run dev
# Mode Supabase
mv .env.local .env.local.backup 2>/dev/null
cp .env.supabase .env
bun run dev
Les fichiers modifiés:
src/routes/plugin@data.ts - Import createClient statiquescripts/supabase-new-project.sql - Ajout section permissionsSESSION COMPLÈTE - SUCCÈS TOTAL !