How imaa-dev/tallerapp works
1. System shape and entry points
TallerAdmin is a multi-tenant repair-workshop management system. It contains a Laravel application with an Inertia/React web client plus an Expo/React Native mobile client. Web requests enter Laravel through server-app/public/index.php and route definitions in server-app/routes/web.php, server-app/routes/api.php, and server-app/routes/auth.php. The mobile app is file-routed from tallerapp-app/src/app/_layout.tsx.
2. Backend application boundary
Laravel owns authentication, authorization, persistence, workflow rules, payments, files, and notifications. Controllers are HTTP adapters, with domain operations delegated to service classes and typed DTOs: server-app/app/Http/Controllers/ServiController.php, server-app/app/Services/ServiService.php, server-app/app/DTO/UpdateServiceDTO.php. API-specific controllers under server-app/app/Http/Controllers/api support the mobile client separately from Inertia web routes.
3. Tenancy, identity, and access control
Organizations are the tenancy boundary; users can be linked to organizations and act under a selected/resolved tenant. Request middleware resolves the tenant, requires organization selection and active status, and gates administrative actions: server-app/app/Http/Middleware/ResolveTenant.php, server-app/app/Http/Middleware/EnsureOrganizationSelected.php, server-app/app/Http/Middleware/EnsureOrganizationIsActive.php. Core identity/tenant records are server-app/app/Models/User.php, server-app/app/Models/Organization.php, and server-app/app/Models/OrganizationUser.php. Session/browser auth and Sanctum-style personal access tokens support web and API/mobile access.
4. Repair-service lifecycle
The central aggregate is Servi: a repair service progresses through status-driven stages, with client/product context, diagnoses, reasons, spare parts, attached files, and repair documents. Main orchestration is in server-app/app/Services/ServiService.php; related stage services include server-app/app/Services/DiagnosisService.php and server-app/app/Services/SparePartsService.php. Persistence models such as server-app/app/Models/Servi.php, server-app/app/Models/StatusService.php, and server-app/app/Models/RepairDocument.php represent the historical operational record.
5. Evidence, documents, and customer communication
Files and service-specific attachments cross from multipart HTTP inputs into storage through a file-service boundary: server-app/app/Http/Controllers/FileController.php, server-app/app/Services/FileService.php, server-app/app/Models/ServiceFiles.php. Repair reports and receipts are rendered from Blade templates, including server-app/resources/views/receipt/repair_receipt.blade.php and server-app/resources/views/emails/repair.blade.php. Queued jobs send inspection/repair notifications and generate receipts: server-app/app/Jobs/InspectNotify.php, server-app/app/Jobs/RepairNotify.php, server-app/app/Jobs/ProcessReceipt.php.
6. Subscription and payment integration
Organizations have plans and subscription state. Payment logic is isolated behind payment, subscription, and PayPal services, while webhook handling records external events before changing subscription/payment state: server-app/app/Http/Controllers/PayPalWebhookController.php, server-app/app/Services/PayPalService.php, server-app/app/Services/SubscriptionService.php. Relevant domain records are server-app/app/Models/Subscription.php, server-app/app/Models/PaymentSubscription.php, and server-app/app/Models/WebhooksEvent.php. Scheduled commands expire subscriptions and clear pending logins.
7. Client applications and runtime infrastructure
The web UI is React/TypeScript delivered through Inertia and Vite, bootstrapped at server-app/resources/js/app.tsx; service-management screens live in server-app/resources/js/pages/service/, and browser API calls are grouped under server-app/resources/js/api/. The Expo mobile client authenticates, selects an organization, then presents status-partitioned service views via tallerapp-app/src/app/login.tsx, tallerapp-app/src/app/select-organization.tsx, and tallerapp-app/src/app/(protected)/(servicios)/_layout.tsx. Laravel/PHP, MySQL, queue/cache, mail, filesystem storage, PayPal, Docker Compose, and Laravel Cloud are material runtime/infrastructure dependencies; deployment settings are expressed through compose.yml and server-app/compose.yaml.
Main entry points: ServiController.php Controllers · ServiService.php Repair service orchestration · ResolveTenant.php Tenant and access middleware · FileService.php File service
Components 20
Client applications
- Inertia React web · Service screens and browser API calls.
server-app/resources/js/app.tsx - Expo mobile app · Authenticates, selects an organization, and shows services by status.
tallerapp-app/src/app/_layout.tsx
Laravel HTTP boundary
- Laravel entry point
server-app/public/index.php - Web, API and auth routes
server-app/routes/web.php - Tenant and access middleware · Resolves the organization and enforces selection, active status, and access.
server-app/app/Http/Middleware/ResolveTenant.php - Controllers · Web controllers and separate API controllers dispatch application operations.
server-app/app/Http/Controllers/ServiController.php
Domain services
- Repair service orchestration · Coordinates the status-driven repair lifecycle.
server-app/app/Services/ServiService.php - Diagnosis and parts
server-app/app/Services/DiagnosisService.php - Service DTOs
server-app/app/DTO/UpdateServiceDTO.php - File service · Moves multipart service evidence into storage.
server-app/app/Services/FileService.php - Subscription service
server-app/app/Services/SubscriptionService.php
Records and storage
- Users and organizations · Organization membership establishes the multi-tenant boundary.
server-app/app/Models/OrganizationUser.php - Repair records · Servi status and repair documents retain operational history.
server-app/app/Models/Servi.php - Service file records
server-app/app/Models/ServiceFiles.php - MySQL
- Filesystem storage
Async and external services
- Notification and receipt jobs · Sends repair updates and generates receipts asynchronously.
server-app/app/Jobs/RepairNotify.php - Email and receipt templates
server-app/resources/views/receipt/repair_receipt.blade.php - PayPal payment integration · Processes payment activity and subscription changes.
server-app/app/Services/PayPalService.php - PayPal webhook handler · Records external events before billing state changes.
server-app/app/Http/Controllers/PayPalWebhookController.php
Connections 22
- Inertia React web → Laravel entry point: browser requests
- Expo mobile app → Laravel entry point: API requests
- Laravel entry point → Web, API and auth routes: dispatches
- Web, API and auth routes → Tenant and access middleware: applies
- Tenant and access middleware → Controllers: authorizes tenant request
- Tenant and access middleware → Users and organizations: resolves membership
- Controllers → Service DTOs: maps input
- Controllers → Repair service orchestration: delegates lifecycle actions
- Controllers → File service: uploads attachments
- Repair service orchestration → Diagnosis and parts: coordinates stages
- Repair service orchestration → Repair records: updates history
- Diagnosis and parts → Repair records: records diagnosis and parts
- File service → Service file records: creates metadata
- File service → Filesystem storage: stores evidence
- Users and organizations → MySQL: persists
- Repair records → MySQL: persists
- Service file records → MySQL: persists
- Repair service orchestration → Notification and receipt jobs: queues notifications and receipts
- Notification and receipt jobs → Email and receipt templates: renders
- PayPal webhook handler → Subscription service: applies recorded events
- Subscription service → PayPal payment integration: manages billing
- Subscription service → MySQL: persists subscription state