How eduayme/rescueapp works
1. Overall shape
RescueApp is a monolithic Laravel web application for coordinating rescue missions for lost persons. The runtime is the standard Laravel HTTP stack: requests enter through public/index.php, pass through middleware, reach controllers in app/Http/Controllers, and render Blade templates in resources/views.
2. Core domain boundary: a “search” mission
The central business object is the Search (app/Models/Search.php), which appears to act as the parent aggregate for the rest of the operational data. Most other rescue concepts hang off a search: lost people, incidents, tasks, action plans, and assigned resources. The resources/views/searches/* structure mirrors this hierarchy.
3. Mission operations subsystem
The operational part of the app is split into separate controllers/models for:
- Lost people: victim/person being searched for
- Incidents: situation updates or field events attached to a search
- Tasks: operational work items
- Action plans and to-do task AP: structured planning for a search
This suggests a workflow where users create a search, record the missing person, log incidents, and manage task execution and planning within that search context.
4. Resource management subsystem
The app also manages response teams and personnel through dedicated entities:
- Groups
- Leaders
- Involved people
These live under app/Models and have their own views under resources/views/searches/resources/*, indicating they are operational resources assigned to a specific search rather than global admin records.
5. Authentication, authorization, and user administration
Standard Laravel auth controllers are present, plus role/permission management controllers and views. The presence of config/laratrust.php and database/migrations/2020_03_09_161313_laratrust_setup_tables.php shows the app uses Laratrust for role-based access control. User management is a distinct subsystem with role assignment, permissions, and profile editing.
6. Activity logging and audit trail
There is a dedicated Activity model/controller and a custom middleware named AcitivityLog (note the spelling). That implies user actions are recorded as operational history, which is important in emergency-response software where accountability and traceability matter.
7. File and image handling
File uploads are a first-class part of the design. app/Http/Traits/ImageUploadTrait.php and the public/uploads/* directory show that images are stored on disk and organized by search/incident/lost-person context. The app therefore has a filesystem-backed media boundary rather than a separate object storage service in the repository.
8. Presentation layer and localization
UI is server-rendered with Blade layouts and partials (resources/views/layouts, resources/views/parts). The application is heavily multilingual, with language packs in Catalan, German, English, Spanish, French, Italian, and Portuguese. This is a key architectural concern because labels/messages are externalized throughout the UI and forms.
9. Validation and request boundaries
Form input is guarded by Laravel Form Requests, such as Group/StoreUpdateRequest.php and Incident/StoreRequest.php, Incident/UpdateRequest.php. That indicates controller logic is kept relatively thin, with validation and authorization rules separated from business actions.
10. Data model and persistence
Persistence is Eloquent/MySQL-style relational storage via migrations and model classes. The migration set shows the schema evolved around users, searches, lost people, activities, action plans, tasks, groups, leaders, involved people, incidents, and incident images. This is the main data boundary; there is no evidence of a separate service-oriented backend.
11. Documentation and content rendering
The repository includes resources/docs/* in multiple languages and a custom markdown parser service. This suggests some in-app documentation/help content is rendered from Markdown, likely using a custom parser to control formatting or extension behavior.
12. Infrastructure and delivery
The project is containerized with Docker and Docker Compose, built/tested with Composer and Node tooling (package.json, webpack.mix.js). CI is configured through Travis. The app is intended to be deployed as a conventional PHP/Laravel web service with a public web root and local storage directories for runtime data.
13. Testing surface
Tests focus on critical user-facing flows such as authentication and tasks (tests/Feature/Auth/*, tests/Feature/TaskTest.php, tests/Feature/ActivityTest.php). That implies the most important architectural contracts are around login/registration and core operational workflow rather than low-level unit isolation.
14. How to draw the diagram
A good architecture diagram should center on the Laravel application boundary, with three major internal zones: identity/access control, search operations, and resource/task management. Surround those with supporting concerns: localized Blade UI, filesystem uploads, relational database, and audit logging. The strongest parent-child relationship is the search mission as the hub that owns most operational records.
Main entry points: Controllers Controllers · Search.php Search · Kernel.php HTTP kernel · Role.php Roles & perms
Components 22
Laravel runtime
HTTP entry, middleware, controllers, providers, and request handling.
- Front controller · Web entry into the application runtime.
public/index.php - HTTP kernel · Registers and runs request middleware.
app/Http/Kernel.php - Locale · Sets request language and localization context.
app/Http/Middleware/Locale.php - Controllers · Main application controllers for searches, tasks, incidents, resources, and auth.
app/Http/Controllers - Form requests · Request validation for constrained create and update flows.
app/Http/Requests
Search missions
Core rescue mission aggregate and operational records.
- Search · Central mission record that anchors the rescue workflow.
app/Models/Search.php - Lost person · Missing person profile attached to a search.
app/Models/LostPerson.php - Incident · Operational event or update recorded under a search.
app/Models/Incident.php - Task · Operational task tracked within a search.
app/Models/Task.php - Action plan · Structured plan for search execution.
app/Models/ActionPlan.php - Resources · Groups, leaders, and involved people assigned to a search.
app/Models
Identity & access
Authentication, users, roles, permissions, and profile management.
- Auth stack · Built-in authentication controllers and flows.
app/Http/Controllers/Auth - User admin · User profile and user management controllers.
app/Http/Controllers/UserController.php - Roles & perms · Laratrust-backed roles and permissions.
app/Models/Role.php
UI & localization
Blade views, shared layout pieces, docs, and translated text.
- Layouts · Shared application and secondary layouts.
resources/views/layouts - Search views · Search, incident, task, resource, and finalization views.
resources/views/searches - Languages · Localized UI strings across multiple languages.
resources/lang - Docs · Multilingual markdown documentation content.
resources/docs
Support systems
Audit logging, uploads, parsing, persistence, and delivery tooling.
- Activity log · User action history and operational logging.
app/Models/Activity.php - Image upload · Trait for storing uploaded images and files.
app/Http/Traits/ImageUploadTrait.php - Markdown parser · Custom markdown parsing for help content.
app/Services/CustomMarkdownParser.php - Relational DB · MySQL-style persistence defined by migrations and models.
database/migrations
Connections 25
- Front controller → HTTP kernel: bootstraps · Incoming web requests enter the Laravel HTTP pipeline.
- HTTP kernel → Locale: includes · Localization middleware participates in request handling.
- HTTP kernel → Controllers: dispatches · Requests flow onward to application controllers.
- Controllers → Form requests: validates with · Controllers delegate input validation to form requests.
- Controllers → Search: manages · Search controllers coordinate the core mission aggregate.
- Controllers → Lost person: manages · Lost-person controllers operate on missing-person records.
- Controllers → Incident: manages · Incident controllers record field updates and events.
- Controllers → Task: manages · Task controllers handle operational work items.
- Controllers → Action plan: manages · Planning controllers maintain action plans and to-do tasks.
- Controllers → Resources: manages · Resource controllers manage groups, leaders, and involved people.
- Search → Lost person: owns · Lost person records belong to a search.
- Search → Incident: owns · Incidents are attached to a search.
- Search → Task: owns · Tasks are tracked within a search.
- Search → Action plan: owns · Action plans are created for a search.
- Search → Resources: coordinates · Groups, leaders, and involved people are assigned per search.
- Auth stack → Roles & perms: enforced by · Authentication and admin flows are gated by roles and permissions.
- User admin → Roles & perms: assigns · User management includes role and permission assignment.
- Layouts → Search views: wraps · Blade layouts provide the shared UI shell.
- Search views → Languages: renders with · Views use localized strings for multilingual UI.
- Docs → Markdown parser: parsed by · Help content is rendered through a custom markdown parser.
- Controllers → Activity log: logs to · Operational actions are written to the activity trail.
- Controllers → Image upload: uploads via · Controllers use filesystem-backed image handling.
- Search → Relational DB: persists in · Core mission data is stored in the relational database.
- Roles & perms → Relational DB: persists in · Role and permission tables are created through migrations.
- Activity log → Relational DB: persists in · Audit records are stored in relational tables.