chore: initial scaffold (Whitelabel-Fork von Pfandsystem)
- Source-Copy von /root/entwicklung/pfandsystem - docker-compose.yml umgeschrieben: pfandsystem-demo-* Container, Ports 3308/8083/3003 (alle localhost) - Traefik-Label fuer pfandsystem.dockly.de - Erweitertes Multi-Tenant-Schema (tenants, tenant_id auf allen Tabellen) - Neue Tabellen: kunden_bilder, geraete - Neue Spalten: kunden.anlieferungshinweis, kunden.lieferzeit_bis - Rollen: superadmin, admin, user, fahrer - .env.example + README Code-Refactor (Tailwind, Multi-Tenant-Middleware, Erweiterungen) folgt.
This commit is contained in:
41
src/SupabaseTest.jsx
Normal file
41
src/SupabaseTest.jsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { createClient } from '@supabase/supabase-js';
|
||||
|
||||
const supabaseUrl = import.meta.env.VITE_SUPABASE_URL;
|
||||
const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY;
|
||||
const supabase = createClient(supabaseUrl, supabaseAnonKey);
|
||||
|
||||
export default function SupabaseTest() {
|
||||
const [data, setData] = useState([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
async function fetchData() {
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
// Passe den Tabellennamen ggf. an
|
||||
const { data, error } = await supabase.from('test').select('*').limit(10);
|
||||
if (error) setError(error.message);
|
||||
setData(data || []);
|
||||
setLoading(false);
|
||||
}
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div style={{ marginTop: 24, padding: 16, border: '1px solid #eee', borderRadius: 8 }}>
|
||||
<h2>Supabase Test</h2>
|
||||
<div style={{ fontSize: 14 }}>
|
||||
<strong>Supabase URL:</strong> {supabaseUrl}
|
||||
</div>
|
||||
{loading && <p>Lade Daten...</p>}
|
||||
{error && <p style={{ color: 'red' }}>Fehler: {error}</p>}
|
||||
<ul>
|
||||
{data && data.length > 0 ? data.map((row, idx) => (
|
||||
<li key={idx}>{JSON.stringify(row)}</li>
|
||||
)) : !loading && <li>Keine Daten gefunden.</li>}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user