feat(app): optional Supabase connection in runtime config + lazy typed client
- env.ts: supabase: SupabaseConnection | null resolved from env.js (supabaseUrl/supabaseAnonKey), VITE_SUPABASE_*, else null; half config refused - lib/supabase.ts: getSupabaseClient() null when unconfigured, one client per URL - entrypoint.sh writes the two public values; .env.example placeholders - Dockerfile copies packages/supabase manifest for the install layer - no UI change; 7 new tests (278 app)
This commit is contained in:
1 parent
ce76c6597a
commit
d239374d81
9 files changed
+153
-23
No files matched your search
@@ -17,13 +17,19 @@ SITE_NAME=$(js_escape "${APP_SITE_NAME:-Faunosteo}")
|
||||
BRAND_NAME=$(js_escape "${APP_BRAND_NAME:-Faunosteo}")
|
||||
FOOTER_NAME=$(js_escape "${APP_FOOTER_NAME:-Faunosteo}")
|
||||
TAGLINE=$(js_escape "${APP_TAGLINE:-Outils pour ostéopathes animaliers}")
|
||||
# Supabase public connection (anon key only; empty = backend disabled).
|
||||
# The service-role key must never be set here.
|
||||
SUPABASE_URL=$(js_escape "${APP_SUPABASE_URL:-}")
|
||||
SUPABASE_ANON_KEY=$(js_escape "${APP_SUPABASE_ANON_KEY:-}")
|
||||
|
||||
cat > "$ENV_JS" <<EOF
|
||||
window.__APP_CONFIG__ = {
|
||||
siteName: "${SITE_NAME}",
|
||||
brandName: "${BRAND_NAME}",
|
||||
footerName: "${FOOTER_NAME}",
|
||||
tagline: "${TAGLINE}"
|
||||
tagline: "${TAGLINE}",
|
||||
supabaseUrl: "${SUPABASE_URL}",
|
||||
supabaseAnonKey: "${SUPABASE_ANON_KEY}"
|
||||
};
|
||||
EOF
|
||||
|
||||
|
||||
Reference in new issue
Block a user