The Floralé admin panel is the backstage interface for managing everything that appears in the storefront — products, categories, images, and pricing. It lives atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/dlampatricio/florale/llms.txt
Use this file to discover all available pages before exploring further.
/admin and is protected by Supabase email/password authentication, so only authorised users can reach it. The panel is built as a client-side Next.js app; the layout checks for a valid Supabase session on every route and instantly redirects unauthenticated visitors to the login page.
Authentication
Access to every route under/admin (except /admin/login itself) requires an active Supabase session. The admin layout calls supabase.auth.getSession() on mount and also subscribes to onAuthStateChange, so if a session expires mid-session the user is redirected to the login page automatically.
Logging in
Open the login page
Navigate to
/admin/login in your browser. You will see the Panel de Administración form with email and password fields.Enter your credentials
Type the email address and password for your Supabase admin account. These are the credentials stored in your Supabase project’s Authentication → Users table — not environment variables.
Submit the form
Click Ingresar. The form calls If the credentials are incorrect, Supabase returns
supabase.auth.signInWithPassword({ email, password }) using the browser Supabase client."Invalid login credentials" and the UI displays a friendly error message.supabase.auth.signOut() and redirects back to /admin/login.
The Dashboard
The dashboard at/admin gives you a quick snapshot of the store at a glance. On load, it fires two count: 'exact' queries in parallel — one against the products table and one against the categories table — and displays the totals on summary cards.
Products
Displays the total number of registered products. Click to open the product list where you can search, edit, or delete items and add new ones.
Categories
Displays the total number of categories. Click to manage the category list that organises products in the storefront.
View Storefront
Opens the public Floralé storefront in a new tab so you can preview how your changes look to customers without leaving the admin panel.
Supabase Clients
Floralé uses two separate Supabase client instances with different permission levels.| Client | File | Key used | Where it runs |
|---|---|---|---|
supabase | lib/supabase.ts | NEXT_PUBLIC_SUPABASE_ANON_KEY | Browser (client components) |
supabaseAdmin | lib/supabase-service.ts | SUPABASE_SERVICE_ROLE_KEY | Server only |
supabase) is created with the public anon key and is safe to ship in client bundles. It respects Row Level Security policies, so unauthenticated requests can only SELECT from public tables and authenticated users can mutate data.
supabaseAdmin) is initialised with the service role key, which bypasses all RLS policies. It has autoRefreshToken and persistSession disabled because it is intended for short-lived server-side operations only.
Row Level Security
Bothproducts and categories tables enforce RLS policies that mirror the two-client setup:
supabase client for all CRUD operations. Because the user is signed in via signInWithPassword, each request carries a valid JWT and satisfies the auth.role() = 'authenticated' check automatically.