Quick Start Guide
This guide will help you get GIMA up and running quickly and take you through the essential steps to start managing your assets.Prerequisites
Before you begin, ensure you have:- PHP 8.2 or higher installed
- Composer dependency manager
- PostgreSQL 12 or higher
- Node.js and npm (for frontend assets)
- Git (to clone the repository)
For detailed installation instructions, see the Installation Guide.
Installation Steps
Configure Environment
Copy the example environment file and generate an application key:Edit
.env and configure your database connection:.env
Run Database Migrations
Create the database tables:This creates all necessary tables including users, assets, maintenance schedules, and more.
Seed Initial Data
Populate the database with roles, permissions, and test users:This creates four test users with different roles:
| Role | Password | |
|---|---|---|
| Admin | [email protected] | 12345678 |
| Supervisor | [email protected] | 12345678 |
| Technician | [email protected] | 12345678 |
| Reporter | [email protected] | 12345678 |
Your First Workflow
Let’s walk through a complete maintenance workflow from login to dashboard view.1. Authenticate as Supervisor
First, log in to get an access token:Save the token - you’ll need it for all subsequent API requests. Include it in the
Authorization header as Bearer {token}.2. View Your Profile
Verify your authentication and see your assigned roles:3. Access the Supervisor Dashboard
As a supervisor, you have access to the supervision area:4. Understanding Role-Based Access
GIMA uses role-based access control. Here’s what each role can access:- Admin Routes
- Supervisor Routes
- Technician Routes
- Reporter Routes
Database Structure Overview
Understanding the core tables will help you work with GIMA effectively:Core Entities
users - System Users
users - System Users
Stores user accounts with authentication details and role assignments.Key fields:
name,email,password- Authentication credentialstelefono- Contact phone numberestado- User status (active/inactive)aprobado_por- Admin who approved the user- Roles assigned via Spatie Permission package
activos - Physical Assets
activos - Physical Assets
Central table for all organizational assets.Key fields:
articulo_id- Links to asset type/categoryubicacion_id- Current asset locationestado- Asset state (operativo, en_mantenimiento, fuera_de_servicio)valor- Asset value for cost tracking
mantenimientos - Maintenance Work Orders
mantenimientos - Maintenance Work Orders
Tracks all maintenance activities on assets.Key fields:
activo_id- Asset being maintainedsupervisor_id- Supervising usertecnico_principal_id- Assigned techniciantipo- Type (preventivo, correctivo)reporte_id- Optional linked failure reportfecha_apertura,fecha_cierre- Maintenance timeframeestado- Status (pendiente, en_proceso, completado)costo_total- Total maintenance cost
calendario_mantenimientos - Maintenance Schedule
calendario_mantenimientos - Maintenance Schedule
Schedules future maintenance activities.Key fields:
activo_id- Asset to be maintainedtipo- Maintenance type (usually preventivo)fecha_programada- Scheduled date/timetecnico_asignado- Assigned technicianestado- Status (pendiente, completado, cancelado)
repuestos - Spare Parts Inventory
repuestos - Spare Parts Inventory
Tracks available spare parts and materials.Usage tracked via:
repuestos_usados- Junction table linking maintenance to consumed partssesiones_mantenimiento- Individual work sessions with time and resource tracking
Next Steps
Detailed Installation
Production-ready setup with security best practices
API Reference
Complete API endpoint documentation
Asset Management
Learn how to register and manage assets
Scheduling Maintenance
Schedule preventive and corrective maintenance
Development Tips
Common Issues
Database Connection Failed
Database Connection Failed
Ensure PostgreSQL is running and the database Verify your
gima_bd exists:.env credentials match your PostgreSQL setup.403 Forbidden on Protected Routes
403 Forbidden on Protected Routes
This means your user doesn’t have the required role. Check:
- Your token is valid and included in the Authorization header
- Your user has the correct role assigned
- The route middleware matches your role
/api/admin/* routes require the admin role.Token Not Working
Token Not Working
Tokens are stored in the
personal_access_tokens table. If you’re having issues:- Ensure Laravel Sanctum is properly installed
- Check your token hasn’t expired
- Verify the
Authorizationheader format:Bearer {token}(note the space)
Testing Your Setup
Run the test suite to verify everything is working:You’re now ready to start building with GIMA! For production deployment, see the Installation Guide for security hardening and optimization tips.