Categories define how products are classified in Bicyblex Store. Every product must belong to a category, and the category’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/bicyblex/bicyblexStore/llms.txt
Use this file to discover all available pages before exploring further.
slug does more than act as a URL identifier — it is the key that the product form uses to look up which dynamic spec fields to render. Getting slugs right is therefore critical: a category whose slug doesn’t match a CONFIG entry in ProductForm.jsx will produce no spec fields in the product form. Category management is handled by the CategoryManager component (src/components/dashboard/category/categoryManager.jsx), which reads from and writes to the Supabase categories table.
The CATEGORÍAS tab is hidden from the dashboard sidebar by default. Its entry in the
TABS array inside src/components/dashboard/dashboard.jsx has visible: false. To expose the tab to the admin sidebar, change this value to true. See Dashboard Overview for the full TABS configuration.Category fields
Thecategories table has a minimal schema:
| Field | Type | Description |
|---|---|---|
id | integer (auto) | Primary key, auto-incremented by Supabase |
name | text | Display name shown in product form dropdowns and the category filter |
slug | text (unique) | URL-safe identifier, auto-generated from the category name on save |
name field is entered by the administrator. The slug is always derived automatically.
Auto-generated slugs
When you save a new category (or update an existing one), thecategoryManager component generates the slug from the name field using a deterministic normalisation pipeline:
"Bicicletas"→"bicicletas""Bicimotos Eléctricas"→"bicimotos-electricas""Kits Eléctricos"→"kits-electricos""Accesorios"→"accesorios"
CONFIG spec-field mapping until ProductForm.jsx is also updated.
Slug to spec fields mapping
Theslug value of a category must exactly match a key in the CONFIG object inside src/components/dashboard/product/ProductForm.jsx for spec fields to appear when creating or editing a product of that category. The four built-in slugs and their associated spec fields are:
| Slug | Spec Fields |
|---|---|
bicicletas | aro, material, freno |
bicimotos-electricas | autonomia, potencia, velocidad |
kits-electricos | descripcion |
accesorios | Dato 1, Dato 2, Dato 3 |
CONFIG, the fields array resolves to [] and no spec section is shown in the product form — the product will be saved with an empty specs: {} object.
CRUD operations
TheCategoryManager interface provides the full create / read / update / delete cycle through a table view and two modal dialogs.
Create
Clicking the AGREGAR CATEGORÍA button opens the form modal in "create" mode. Enter the category name and submit — the slug is auto-generated on save and the new record is inserted into categories via supabase.from('categories').insert(...).
Edit
Clicking the pencil icon on a category row opens the same form modal in "edit" mode, pre-filled with the current category name. On submit, the name and the newly regenerated slug are written back via supabase.from('categories').update(...).eq('id', selectedCategory.id).
Delete
Clicking the trash icon opens a confirmation modal that displays the category name. Confirming the deletion calls supabase.from('categories').delete().eq('id', selectedCategory.id). If the category is still referenced by products via category_id, the deletion may fail depending on your Supabase foreign key constraints — ensure products are reassigned or deleted first.