How everyscript/trabajonautas works
1. Overall shape
- This is a Laravel monolith with a server-rendered UI built mainly from Blade + Livewire, not a separate SPA.
- The app is organized around a few core business domains: announcements, notices, users/clients, companies, professions/areas/locations, accounts/subscriptions, and reporting.
2. Primary user-facing surfaces
- There are three major UI boundaries:
- a public/web area (resources/views/welcome.blade.php, app/Livewire/Web/*)
- an authenticated application/dashboard area (resources/views/dashboard.blade.php, app/Livewire/Panel/*, app/Livewire/User/*, etc.)
- an auth/profile management area powered by Jetstream/Fortify (app/Actions/Fortify/*, resources/views/auth/*, resources/views/profile/*)
- The public area handles discovery and purchase/registration flows; the authenticated area manages operational CRUD and dashboards.
3. Core domain model
- The central entities are:
- Announcement and AnnouncementFile
- Notice
- User and client/user configuration
- Company, CompanyType, Location, Area, Profesion
- Account, AccountType, Subscription
- NotificationLog, TbnSetting
- The migration history shows this app evolved into a subscription/notification system with rich segmentation by location, profession, company, and grade/profile metadata.
4. Content publishing and distribution flow
- AnnouncementObserver and SendAnnouncementNotifications indicate that creating/updating announcements can trigger downstream delivery work.
- Notification delivery is abstracted through FirebaseNotificationService, so push notifications are a distinct integration boundary.
- NotificationLog is the persistence layer for delivery/audit tracking, which implies announcement publishing is asynchronous or at least externally side-effecting.
5. Background processing and scheduled maintenance
- The app uses Laravel console commands for periodic operations:
- SendUnnotifiedClientsCommand
- UpdateExpiredAccounts
- These commands likely scan stored state and enqueue/trigger notifications or account status changes.
- The presence of jobs and a jobs table migration shows that queue-backed processing is part of the architecture, not just synchronous HTTP requests.
6. Authentication and account lifecycle
- Authentication is handled by Fortify/Jetstream, with custom actions for:
- creating users
- updating passwords/profile information
- deleting users
- password validation/reset flows
- There are custom auth-related controllers and middleware such as:
- CheckIfUserEnable
- CheckOnlyOneSession
- social login controller
- This suggests the app enforces account-state rules beyond standard login, including single-session and enabled/disabled user checks.
7. Authorization and multi-role access
- The app includes config/permission.php, implying role/permission-based access control.
- AuthorizeClients trait and CheckIfUserEnable middleware show that some data and routes are restricted based on user type or account status.
- The architectural boundary is therefore not just authenticated vs guest, but also admin/operator vs client and possibly account-tier based.
8. Livewire as the main application layer
- Most business features are implemented as Livewire components rather than traditional controllers:
- CRUD screens for announcements, areas, companies, professions, notices, users/clients
- dashboard widgets and charts
- report/configuration flows
- public web modules like search and recent content
- app/Http/Controllers is comparatively small, which means Livewire owns most request/response interaction and stateful UI behavior.
9. Reporting and analytics
- The Charts/* components show dashboards for:
- account status
- client age, gender, grade, location, profession
- unregistered clients
- ReportClient and ConfigQr indicate report/export/configuration features tied to client records.
- UsersExport further confirms the app supports data extraction for operational/reporting use cases.
10. Notifications and messaging channels
- The app sends email through dedicated mailable classes:
- WelcomeAccount
- RenewAccount
- It also customizes reset/verification notifications.
- On the client side, there is Firebase service worker and browser notification JS in public/, showing web push is a first-class channel alongside email.
11. Public content and engagement
- The web-facing Livewire components (RecentAnnouncement, RecentNotices, SearchAnnouncement, PurchaseAccount, PurchaseCards, WelcomeSection) support content browsing and conversion/purchase flows.
- Markdown-based static pages for FAQ, policy, and terms indicate a mix of dynamic and semi-static public content.
- This public side is separated from operational admin tools but shares the same domain models.
12. Persistence and data setup
- Standard Laravel Eloquent models, factories, seeders, and migrations define the data layer.
- Seeders cover business baseline data such as company types, grade profiles, locations, professions, settings, accounts, and users.
- The schema also includes pivot tables for many-to-many relationships like announcements by location, profession, and user, which is important for understanding how targeting/segmentation works.
13. Infrastructure and runtime boundaries
- The app relies on Laravel’s built-in session, queue, cache, mail, broadcasting, and filesystem subsystems.
- sanctum is present for API/token auth, but the project is primarily server-rendered rather than a public JSON API.
- firebase.php and the service worker assets are the main external integration that materially affect architecture.
14. What to draw in an architecture diagram
- A good diagram would show:
- public web UI and authenticated dashboard UI
- Livewire components as the main presentation/application layer
- Eloquent models + migrations as the persistent domain layer
- queue/jobs/console commands as asynchronous/background processing
- Firebase + email as outbound notification channels
- Fortify/Jetstream/Permissions as the auth and access-control boundary
- The main data flow is: user action → Livewire/app logic → models/database → observers/jobs/notifications → email/Firebase delivery, with scheduled commands handling reconciliation and account expiration.
Main entry points: User.php Users · Models Business models · web.php Routes and views · Web Web Livewire
Components 20
Public web
Guest-facing discovery and purchase flows
- Welcome · Public landing page and guest entry point
resources/views/welcome.blade.php - Web Livewire · Public browsing, search, and purchase components
app/Livewire/Web
Dashboard app
Authenticated operational UI
- Dashboard · Authenticated application shell
resources/views/dashboard.blade.php - Panel · Dashboard cards, onboarding, and summary widgets
app/Livewire/Panel - CRUD modules · Operational screens for announcements, users, companies, areas, professions, and notices
app/Livewire - Reports · Charts and client reporting components
app/Livewire/Report - Routes and views · Laravel route definitions, Blade views, and layouts connecting all surfaces
routes/web.php
Auth and access
Jetstream, Fortify, and permission boundaries
- Fortify actions · Create, profile, password, and delete-account workflows
app/Actions/Fortify - Delete user · Jetstream account deletion flow
app/Actions/Jetstream/DeleteUser.php - Access guards · Enabled-user and single-session checks
app/Http/Middleware - Permissions · Role and permission configuration
config/permission.php
Domain and data
Core models, persistence, and content targeting
- Users · Application users, clients, and account state
app/Models/User.php - Business models · Announcement, notice, company, location, area, profession, account, subscription, and settings entities
app/Models - Delivery log · Persistence for notification delivery and tracking
app/Models/NotificationLog.php
Async work
Observers, jobs, commands, and scheduled reconciliation
- Announcement observer · Triggers side effects when announcements change
app/Observers/AnnouncementObserver.php - Notify job · Queued announcement delivery work
app/Jobs/SendAnnouncementNotifications.php - Console commands · Periodic notification and account-expiration maintenance
app/Console/Commands
Notifications
Outbound email and Firebase delivery
- Firebase service · Push notification delivery boundary
app/Services/FirebaseNotificationService.php - Mailers · Account welcome and renewal messages
app/Mail - Push assets · Service worker and browser notification scripts
public/firebase-messaging-sw.js
Connections 23
- Welcome → Web Livewire: loads · Guest entry point hydrates public Livewire components
- Web Livewire → Business models: reads · Search, recent content, and purchase flows query domain data
- Web Livewire → Users: creates users · Purchase and registration flows can create or configure clients
- Dashboard → Panel: hosts · Dashboard shell renders operational widgets
- Dashboard → CRUD modules: hosts · Authenticated layout renders CRUD modules
- Panel → Business models: aggregates · Dashboard summaries are built from domain records
- CRUD modules → Business models: manages · Livewire modules create and edit core entities
- Reports → Business models: analyzes · Charts and exports read client and account data
- Reports → Users: segments · Reporting is centered on user/client attributes
- Fortify actions → Users: mutates · Fortify actions create and maintain user accounts
- Delete user → Users: deletes · Jetstream handles account removal
- Access guards → Users: guards · Middleware blocks disabled or multi-session access
- Permissions → CRUD modules: authorizes · Roles and permissions gate dashboard features
- Announcement observer → Notify job: dispatches · Announcement lifecycle changes enqueue delivery work
- Notify job → Firebase service: sends push · Queued delivery uses Firebase as the push channel
- Notify job → Delivery log: records · Delivery outcomes are written for tracking and audit
- Console commands → Delivery log: reconciles · Scheduled jobs scan stored state and update delivery/account status
- Console commands → Business models: updates · Commands handle expired accounts and unnotified clients
- Mailers → Users: emails · Welcome and renewal mail target users and clients
- Push assets → Firebase service: supports · Browser push depends on service worker and client scripts
- Routes and views → Welcome: serves · Routes connect HTTP entry points to the public landing page
- Routes and views → Dashboard: serves · Routes connect authenticated requests to the dashboard shell
- Routes and views → Fortify actions: uses · Authentication routes rely on Fortify/Jetstream actions