How alejo09g/proyecto_bolipuerto works
1. Repository shape
- This is a monorepo, but the only production system is SIRAP/: a Laravel 11 application for port access control.
- The other top-level documents and the “Port Access Control System” mockup area are reference material, not part of the runtime system.
2. Runtime and stack
- The app is a server-rendered Laravel application using Blade views, MySQL persistence, and frontend assets built with Vite plus Alpine.js/TailwindCSS style utilities.
- The application is deployed as a traditional PHP web app behind the public/ front controller.
3. Request entry and routing
- Web traffic enters through public/index.php and is routed via routes/web.php.
- Requests are mediated by custom middleware such as:
- SesionUnica for enforcing one active session
- TurnoActivo for shift-based access
- PreventBackHistory for security on authenticated pages
- DevPanelAuth for protected developer/admin tooling
- HandleInertiaRequests exists, but the visible UI is predominantly Blade-based
4. Role-based application boundaries
- The UI and controllers are clearly split into three main operational areas:
- Operador: day-to-day gate operations
- Admin: administration, reporting, configuration
- Superadmin: higher-privilege control, infrastructure, user management, audit, and dev-panel access
- Separate Blade view folders reflect these boundaries: resources/views/operador, admin, and superadmin.
5. Controllers as orchestration layer
- Key controllers are:
- AuthController for login/session flow
- RegistroController for access-entry and exit records
- TurnoController for shift handling
- IncidenteController for incident reporting
- PreferenciaController for user/system preferences
- AdminController, SuperadminController, and DevPanelController for role-specific dashboards and tools
- Controllers appear to coordinate validation, authorization, and persistence rather than embedding domain logic.
6. Core domain model
- The main persistent entities are:
- Usuario, Persona, Vehiculo
- Institucion, PuntoControl, TipoVehiculo
- RegistroAcceso, PreAutorizacion, ListaNegra
- Incidente, Notificacion, Auditoria, Ajuste
- The database migrations show the system evolved around port-access operations: vehicle entry/exit, people/driver identity, checkpoints, blacklist handling, preauthorization, and traceability.
7. Primary operational data flow
- A typical access flow is:
- operator authenticates
- selects a control point and shift context
- captures or looks up a person/vehicle
- creates or updates an access record in registro_accesos
- possibly checks blacklist or preauthorization status
- records notes, exit user, and historical fields
- This is the system’s central transaction path and the most important flow for an architecture diagram.
8. Security, identity, and access control
- Authentication is backed by Laravel auth plus a permissions layer indicated by config/permission.php and create_permission_tables.
- There are user-level fields for modo_oscuro, turno, session_token, and persona_id, implying profile settings, shift assignment, and strict session binding.
- The architecture emphasizes operational safety: single-session enforcement, back-history prevention, and shift-aware gating.
9. Auditability and traceability
- The app is designed for accountability:
- Auditoria model and auditorias table
- Auditable trait for reusable change tracking
- TelescopeServiceProvider and telescope entries for runtime observability
- This means state changes are likely logged both at the business level and at the framework/diagnostic level.
10. Reporting and document output
- The resources/views/pdf/ folder contains dedicated PDF templates for:
- access history
- incidents
- blacklist
- users
- pre-authorizations
- turn summaries
- operational reports
- This suggests a reporting pipeline where database records are rendered into printable/exportable documents from server-side templates.
11. Background/maintenance tasks
- Console commands show two important scheduled/ops concerns:
- CheckVehiculosLargaEstancia for long-stay vehicle detection
- DatabaseBackup for operational backups
- These are supporting processes, not user-facing workflows, but they are important for the architecture because they extend the system beyond request/response handling.
12. Storage and infrastructure touchpoints
- The app uses standard Laravel storage areas for logs, cached views, sessions, and file uploads/public assets.
- Mail, queue, cache, session, and logging configs are present, so the deployment is built around normal Laravel infrastructure services, with MySQL as the primary system of record.
13. Frontend structure
- Presentation is organized into reusable layouts and partials:
- shared app shell
- header, sidebar, footer
- role-specific layouts
- modal fragments for forms and detail views
- The UI is therefore composed from Blade templates rather than a separate SPA frontend.
14. Testing and seed data
- The repo includes PHPUnit feature/unit tests and at least one feature test for synchronization-related behavior.
- Seeders exist for bootstrap data such as blacklist entries, indicating the system can be initialized with realistic operational defaults.
15. Diagram guidance
- If you draw the architecture, the main boxes should be:
- Browser/UI
- Laravel routes/middleware
- Role-specific controllers
- Domain models
- MySQL database
- PDF/report generation
- Console jobs/maintenance
- Telescope/logging/backup as support services
- The most important boundary is between operator/admin/superadmin presentation flows and the shared access-control data model centered on persons, vehicles, checkpoints, and access records.
Main entry points: web.php Web routes · Models Core models · RegistroController.php Accesses · AdminController.php Admin ctrl
Components 22
UI & Entry
Browser entry, Blade presentation, and request routing
- Front controller · Web entry point for all browser requests
SIRAP/public/index.php - Web routes · Main HTTP route definitions and request dispatch
SIRAP/routes/web.php - Blade shell · Shared layouts, header/sidebar/footer, and app shells
SIRAP/resources/views/layouts - Operador UI · Day-to-day gate operation screens
SIRAP/resources/views/operador - Admin UI · Administration, reporting, and operational management screens
SIRAP/resources/views/admin - Superadmin UI · Higher-privilege control, infrastructure, and user management screens
SIRAP/resources/views/superadmin
Laravel App
Controllers, middleware, providers, and command orchestration
- Auth · Login and session flow
SIRAP/app/Http/Controllers/AuthController.php - Accesses · Entry, exit, and access record orchestration
SIRAP/app/Http/Controllers/RegistroController.php - Shifts · Shift selection and active-turn handling
SIRAP/app/Http/Controllers/TurnoController.php - Admin ctrl · Admin dashboard and management actions
SIRAP/app/Http/Controllers/AdminController.php - Superadmin ctrl · Superadmin dashboard and privileged tooling
SIRAP/app/Http/Controllers/SuperadminController.php - Dev panel · Protected developer/admin tooling
SIRAP/app/Http/Controllers/DevPanelController.php - Middleware · Session, shift, back-history, and dev-panel gates
SIRAP/app/Http/Middleware
Domain & Data
Core entities and persistence layer
- Core models · Person, vehicle, institution, checkpoint, and access entities
SIRAP/app/Models - Auditable · Reusable change-tracking behavior
SIRAP/app/Traits/Auditable.php - Schema · Database evolution for access control, roles, audit, and reporting
SIRAP/database/migrations - Seed data · Bootstrap data such as blacklist entries
SIRAP/database/seeders - MySQL config · Primary persistence and Laravel database setup
SIRAP/config/database.php
Ops & Output
Reporting, observability, backups, and maintenance
- PDF reports · Printable/exportable operational documents
SIRAP/resources/views/pdf - Console jobs · Scheduled maintenance such as long-stay checks and backups
SIRAP/app/Console/Commands - Telescope · Runtime diagnostics and entry capture
SIRAP/app/Providers/TelescopeServiceProvider.php - Storage · Sessions, cache, logs, uploads, and generated artifacts
SIRAP/storage
Connections 28
- Front controller → Web routes: dispatches · Front controller hands requests to route definitions
- Web routes → Middleware: applies · Web routes are protected by session, shift, and security middleware
- Web routes → Auth: auth flow · Login and session endpoints
- Web routes → Accesses: access flow · Entry and exit operations
- Web routes → Shifts: shift flow · Shift selection and validation
- Web routes → Admin ctrl: admin area · Admin dashboard and management screens
- Web routes → Superadmin ctrl: superadmin area · Privileged administration routes
- Web routes → Dev panel: dev tools · Protected developer tooling routes
- Auth → Core models: reads/writes · User session and profile data
- Accesses → Core models: persists · Creates and updates access, person, vehicle, blacklist, and notification records
- Shifts → Core models: reads/writes · Shift state and user assignment
- Admin ctrl → Core models: manages · Operational admin data
- Superadmin ctrl → Core models: manages · Privileged user, audit, and infrastructure-related data
- Dev panel → Telescope: uses · Developer panel is aligned with observability tooling
- Core models → Schema: defined by · Tables and relationships are shaped by migrations
- Auditable → Core models: tracks · Reusable audit behavior for change history
- Schema → MySQL config: targets · Schema is stored in the Laravel/MySQL database
- Seed data → Schema: populates · Seed data assumes the evolved schema
- Accesses → PDF reports: exports · Access history and report output
- Admin ctrl → PDF reports: exports · Admin reporting and printable summaries
- Superadmin ctrl → PDF reports: exports · High-privilege reports and audit views
- Console jobs → MySQL config: operates on · Maintenance jobs run against the database
- Console jobs → Storage: writes · Backups and maintenance artifacts
- Telescope → Storage: records · Diagnostics and runtime capture rely on app storage
- Middleware → Storage: uses · Sessions and request security state are stored in Laravel storage/services
- Operador UI → Blade shell: composes · Role-specific screens use shared layouts
- Admin UI → Blade shell: composes · Admin screens use shared layouts
- Superadmin UI → Blade shell: composes · Superadmin screens use shared layouts