Installation Guide
This guide covers installing GIMA for production environments with security best practices, performance optimization, and deployment considerations.System Requirements
Before installing GIMA, ensure your server meets these requirements:Required Software
PHP
Version: 8.2 or higherRequired Extensions:
- OpenSSL
- PDO
- Mbstring
- Tokenizer
- XML
- Ctype
- JSON
- BCMath
PostgreSQL
Version: 12 or higherConfiguration:
- UTF-8 encoding
- At least 1GB allocated memory
- Connection pooling recommended
Composer
Version: 2.0 or higherPHP dependency manager required for installing Laravel packages.
Node.js & npm
Version: 18 or higherRequired for compiling frontend assets with Vite.
Optional But Recommended
- Web Server: Nginx or Apache with mod_rewrite
- Process Manager: Supervisor for queue workers
- Caching: Redis for cache and session storage
- SSL Certificate: For HTTPS in production
Installation Steps
Install PHP Dependencies
Install Laravel and all required packages:Key dependencies installed:
The
--no-dev flag excludes development dependencies for production. For development environments, use composer install without this flag.- Laravel Framework 12.0
- Laravel Sanctum 4.0 (API authentication)
- Spatie Laravel Permission 6.23 (role management)
- Laravel Tinker 2.10.1 (REPL)
Configure Environment Variables
Copy the example environment file and configure it:
Essential Configuration
- Application Settings
- Database Configuration
- Session & Cache
- Logging & Mail
.env
Generate Application Key
Generate a unique encryption key for your application:This creates a secure random key and adds it to your
.env file.Set File Permissions
Ensure Laravel can write to storage and cache directories:Adjust
www-data to match your web server user (may be nginx, apache, etc.).Create Database Tables
Run migrations to create all database tables:This creates tables for:
- User authentication and roles
- Asset management (activos, articulos, ubicaciones)
- Maintenance operations (mantenimientos, calendario_mantenimientos)
- Inventory (repuestos, proveedores)
- Reports and audits
- Session and cache storage
- Job queue
The
--force flag is required in production environments. It bypasses the confirmation prompt.Seed Roles and Permissions
Initialize the role-based access control system:This creates:Four User Roles:
admin- Full system accesssupervisor- Asset and maintenance managementtecnico- Field operationsreporter- Basic reporting
gestionar usuarios- User management (admin)gestion maestra- Master data CRUD (admin)gestionar activos- Asset management (supervisor)gestionar mantenimientos- Maintenance scheduling (supervisor)gestionar reportes- Report assignment (supervisor)ver mis tareas- View assigned tasks (technician)registrar actividad tecnica- Log maintenance work (technician)registrar repuestos usados- Record parts usage (technician)crear reporte fallas- Submit failure reports (all)ver mis reportes- View own reports (all)ver catalogo activos- View asset catalog (all)
| Role | Name | Password | |
|---|---|---|---|
| Admin | Admin User | [email protected] | 12345678 |
| Supervisor | Roberto Supervisor | [email protected] | 12345678 |
| Technician | Juan Técnico | [email protected] | 12345678 |
| Reporter | Ana Reportes | [email protected] | 12345678 |
Compile Frontend Assets
Install Node.js dependencies and build assets:This compiles all frontend assets using Vite for optimal performance.
Web Server Configuration
Nginx Configuration
Create a new Nginx server block:/etc/nginx/sites-available/gima
Apache Configuration
Create a virtual host:/etc/apache2/sites-available/gima.conf
Queue Worker Setup
GIMA uses Laravel queues for background jobs. Set up a queue worker with Supervisor:Scheduled Tasks (Cron)
Laravel’s task scheduler requires a single cron entry:SSL/TLS Configuration
Secure your installation with Let’s Encrypt:Database Backup
Set up automated PostgreSQL backups:backup.sh
Security Checklist
Before going live, verify these security measures:- Environment
- Database
- Web Server
- Application
-
APP_DEBUG=falsein.env -
APP_ENV=productionin.env - Strong, unique
APP_KEYgenerated -
.envfile not accessible via web - Git repository not exposed (
.gitblocked)
Performance Optimization
Redis Cache (Recommended)
For better performance, use Redis for cache and sessions:Database Optimization
PostgreSQL
Monitoring and Logging
Log Files Location
Log Rotation
Configure logrotate:/etc/logrotate.d/gima
Troubleshooting
500 Internal Server Error
500 Internal Server Error
Check Laravel logs:Common causes:
- Incorrect file permissions on
storage/orbootstrap/cache/ - Database connection failure
- Missing or incorrect
APP_KEY
Database Connection Failed
Database Connection Failed
Verify:Ensure
.env credentials match your database setup.Queue Jobs Not Processing
Queue Jobs Not Processing
Check queue worker status:View worker logs:Restart workers:
Permission Denied Errors
Permission Denied Errors
Reset permissions:
Updating GIMA
To update to a new version:Support Resources
Laravel Documentation
Official Laravel framework documentation
PostgreSQL Documentation
PostgreSQL database documentation
Spatie Permission
Role and permission package docs
Laravel Sanctum
API authentication documentation
Your GIMA installation is now complete and ready for production use!