Categories are the organisational backbone of the Floralé storefront. They group products into meaningful collections — such as gift boxes or breakfast sets — making it easy for customers to browse the catalogue. The admin panel’s category section 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/categories lets you list all existing categories, add new ones, rename or re-describe them, and remove ones that are no longer needed. All changes persist immediately to the categories table in Supabase.
Category List
The list view at/admin/categories fetches all categories ordered alphabetically by name using supabase.from('categories').select('*').order('name'). Each row in the list shows:
- A coloured initial avatar (first letter of the category name)
- The category name in bold
- The category description (if one exists), truncated to a single line
- An edit (pencil) icon linking to
/admin/categories/[id]/edit - A delete (trash) icon with a confirmation dialog
Creating a Category
Navigate to/admin/categories/new or click Nueva categoría on the list page. The form has two fields:
| Field | Required | Notes |
|---|---|---|
| Nombre | ✅ | Display name for the category; also used to derive the ID |
| Descripción | — | Optional short description shown in the admin list |
id and inserts a new row:
ID Auto-Generation
Category IDs follow the exact same slug algorithm used for products. For example:| Name entered | Generated ID |
|---|---|
Cajas de Regalo | cajas_de_regalo |
Desayunos | desayunos |
Ramos Personalizados | ramos_personalizados |
ñ, and all non-alphanumeric characters are stripped silently — "Niño" and "Nino" would produce the same ID nino.
Editing a Category
Click the pencil icon on any row or navigate directly to/admin/categories/[id]/edit. The page loads the current category with supabase.from('categories').select('*').eq('id', id).single() and pre-fills both fields. If the ID is not found, the page redirects back to the list.
On submit, only name and description are updated — the id is never regenerated:
"Cajas" to "Cajas de Regalo") without affecting any of the products that reference it via category_id, because the slug ID remains unchanged.
Deleting a Category
Click the trash icon on a category row. The confirmation dialog explicitly warns that products will not be deleted:¿Eliminar la categoría ”…”? Los productos no se eliminarán pero quedarán sin categoría.After confirmation,
supabase.from('categories').delete().eq('id', id) removes the row and the category disappears from the list.
Categories Table Schema
Primary key. Derived from the category name at creation time using the lowercase underscore slug algorithm. The ID never changes after insert — renaming a category only updates
name, not id.The human-readable display name shown in the storefront catalogue and the admin list. This is the value customers see when browsing by category.
Optional short description of the category. Defaults to an empty string
''. Currently displayed in the admin list only; not rendered on the public storefront in the default layout.Default Seeded Categories
The database schema seeds two starter categories so new installations have something to work with immediately:| ID | Name |
|---|---|
cajas | Cajas de Regalo |
desayunos | Desayunos |
/admin/categories/new.
For the full database schema including table definitions, foreign key constraints, RLS policies, and seed data, see the Database Schema reference page.