The application uses a single MySQL (or MariaDB) database namedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/gavafue/registroComponentesMultimedia/llms.txt
Use this file to discover all available pages before exploring further.
isbo_prestamos with two tables: loans, which records every equipment checkout and return, and users, which stores administrator credentials. This guide walks you through creating the database, defining the schema, and seeding the first admin account.
Create the Database
Connect to the MySQL shell as root (or another user with theCREATE privilege):
Create the Tables
Create the loans table
The Column reference:
loans table is the core of the application. It stores the full lifecycle of each equipment loan, from checkout through return, including digital signatures captured in the browser as Base64-encoded PNG data URLs.| Column | Type | Description |
|---|---|---|
id | INT | Auto-incremented primary key |
ci | VARCHAR(10) | Borrower’s national ID (cédula de identidad) |
name | VARCHAR(150) | Borrower’s full name |
group_name | VARCHAR(100) | Class or group the borrower belongs to (optional) |
equipment_details | TEXT | Description of the borrowed equipment |
checkout_time | DATETIME | Timestamp when the loan was created |
checkout_signature | LONGTEXT | Base64 PNG data URL of the borrower’s signature at checkout |
return_time | DATETIME | Timestamp when the equipment was returned (NULL if active) |
return_signature | LONGTEXT | Base64 PNG data URL of the borrower’s signature at return |
return_observation | VARCHAR(500) | Optional notes recorded at return time |
status | ENUM | 'active' while on loan; 'returned' once equipment is back |
checkout_signature and return_signature store Base64-encoded PNG data URLs generated by the browser’s signature canvas. These strings can be several kilobytes each — LONGTEXT (up to ~4 GB) is used to ensure no data is silently truncated. If you use an external signature storage solution in the future, these columns can be changed to VARCHAR(2048) for a URL reference instead.Insert the First Admin User
Generate the password hash
Run this one-liner on the server (or any machine with PHP installed) to produce a bcrypt hash for your chosen password:The output will look similar to:Copy the entire hash string, including the leading
$2y$.Changing an Admin Password
To update an existing administrator’s password, generate a new hash with the PHP one-liner above and run the followingUPDATE statement:
Connecting the Application to the Database
The database connection is configured inapi/config.php. After creating the database and tables, open that file and verify the credentials match your environment:
PDO::ERRMODE_EXCEPTION and PDO::FETCH_ASSOC, so any connection failure will return a JSON error response with HTTP 500 rather than a raw PHP fatal error.