Overview
The Clients module allows you to maintain a comprehensive directory of your business clients. Each client record includes a logo, category assignment, and metadata for organization and display purposes.Key Features
Logo Management
Upload and store client logos in Supabase Storage
Category Organization
Organize clients by business categories
Pagination
Browse large client lists with configurable page sizes
CRUD Operations
Create, view, update, and delete client records
Adding a New Client
Fill in Client Details
Required fields:
- Name (
nombre): Client company name - Category (
categoria): Select from existing categories - Logo: Upload an image file (PNG, JPG, SVG)
Logo Upload Process
Logos are stored in Supabase Storage with category-based paths:clientes.php
Storage Path Structure
Client Record Structure
Pagination
The client list supports pagination for better performance:clientes.php
- Rows per page: 10
- Configurable: Users can change the page size
- URL parameters:
?page=2&rowsPerPage=20
Category Integration
Clients are organized by categories defined in thecategorias table. Each client must be assigned to a valid category.
Categories help organize clients by industry, service type, or any custom classification system.
Category Selection
When creating or editing a client:Editing Clients
To update an existing client:Modify Fields
Update any of the following:
- Client name
- Category assignment
- Logo (optional - upload a new one to replace)
When uploading a new logo, the old logo file remains in storage. Consider implementing cleanup routines for unused files.
Deleting Clients
Deleting a client:Viewing Client Projects
Clients are linked to projects in the Projects module. When viewing a client, you can see all associated projects.Database Table
Table Name:clientes
| Column | Type | Description |
|---|---|---|
id | integer | Auto-incrementing primary key |
nombre | text | Client company name |
categoria | integer | Foreign key to categorias.id |
logo_url | text | Storage path to logo file |
created_at | timestamptz | Record creation timestamp |
API Endpoints
The Clients module uses Supabase REST API:- GET
/rest/v1/clientes- List all clients - POST
/rest/v1/clientes- Create new client - PATCH
/rest/v1/clientes?id=eq.{id}- Update client - DELETE
/rest/v1/clientes?id=eq.{id}- Delete client
Best Practices
Troubleshooting
Logo Upload Fails
Possible causes:- File size exceeds server limits
- Invalid file format
- Insufficient storage permissions
upload_max_filesize and Supabase Storage bucket policies.
Category Not Found
Problem: “Categoría inválida” error Solution: Ensure you’ve selected a valid category from the dropdown. If no categories exist, create one in the Categories module first.Next Steps
Projects
Link clients to projects
Dashboard
View client statistics