How yeizermarrugo/dilodepartededios works
1. Overall shape
- This is a Laravel 12 monolith with an Inertia.js + React 19 frontend. The browser never talks to a separate SPA API for normal navigation; instead, Laravel controllers return Inertia responses that hydrate React pages from resources/js/pages.
2. Request path
- A typical user request enters through Laravel routing in routes/web.php, routes/auth.php, routes/settings.php, or routes/api.php.
- Controllers in app/Http/Controllers fetch or mutate data through Eloquent models in app/Models, then return either Inertia pages, redirects, JSON responses, file downloads, or webhook acknowledgements.
3. Content platform core
- The main domain model is Devocional, which represents more than one content type: daily devotionals, Bible studies, and series episodes.
- Ensenanza is the separate series container model, while Devocional rows can belong to a series via ensenanza_id.
- The public content pages are mostly driven by DevocionalController, EnsenanzaController, PostController, and related React pages under resources/js/pages.
4. Public interaction features
- Likes, shares, and views are treated as first-class subsystems rather than simple counters.
- LikeController and ContentLike support anonymous likes using a cookie-based visitor identifier and a hash, not a logged-in identity.
- ShortUrlController generates short codes and resolves shared links back to the underlying content.
- DevocionalView records view analytics, including anonymized network/location metadata.
5. Media and file handling
- Uploads are split by type: ImageUploadController, BulkUploadController, and PdfUploadController.
- Files are stored through the Laravel filesystem configuration, with AWS S3 explicitly supported in the environment and config.
- PostImage and the upload controllers indicate a content-heavy system with associated images and downloadable resources.
6. External service integrations
- TTSController integrates with Voice RSS to generate text-to-speech audio for content.
- PaymentController handles ePayco donation webhooks and stores Donation records.
- PushSubscriptionController manages Web Push subscriptions; the app uses VAPID keys and the Visitor model to keep subscription state.
- YouTubeController likely acts as a cached feed bridge to YouTube content for the podcast/media section.
7. Communication and notifications
- ContactController accepts contact form submissions, persists them as ContactMessage, and sends email through ContactFormMail.
- NuevoContenidoNotification and the scheduled command NotificarDevocionalDiario.php support outbound notifications about new content.
- Push notifications and email are therefore two separate outbound channels with different persistence and delivery paths.
8. Admin and dashboard boundary
- The admin area lives in the same application and is rendered through Inertia pages like resources/js/pages/dashboard.tsx and dashboard components under resources/js/components/dashboard.
- This area appears to manage publications, contact messages, and content CRUD without a separate backend service.
9. Middleware and cross-cutting concerns
- AssignVisitorId establishes anonymous tracking identity through a long-lived cookie.
- HandleAppearance manages theme preferences, HandleInertiaRequests injects global shared props, and AddSecurityHeaders enforces security-related HTTP headers.
- These middlewares shape every request, so they are important boundary layers in the architecture.
10. Frontend structure
- The frontend is organized as reusable React components, page-level views, and hooks.
- resources/js/components contains shared UI and feature widgets such as likes, sharing, TTS controls, upload widgets, navigation, and layout shells.
- resources/js/hooks encapsulates client-side behaviors like liking, sharing, appearance, and mobile navigation.
- The presence of bootstrap/ssr assets shows server-side rendering support for the Inertia frontend.
11. Data storage and schema
- The database schema is migration-driven and includes UUID-heavy tables for content and series, plus analytics, donations, visitors, likes, subscriptions, and contact messages.
- There is clear separation between content records, user/account records, anonymous interaction records, and operational/audit data.
- Factories and seeders exist for test and bootstrap data, especially around devocionales and enseñanzas.
12. Client/runtime extras
- The app includes a service worker (public/sw.js) and a web manifest, which suggests PWA-like behavior such as offline handling and push support.
- Frontend assets are built with Vite, and the presence of SSR assets indicates both client-side hydration and server-rendered initial pages.
13. Operational/testing boundary
- CI is present for linting and tests via GitHub Actions.
- Feature tests cover authentication, dashboard access, uploads, likes, settings, devocionales, and enseñanzas, which reflects the main functional boundaries of the system.
Main entry points: DevocionalController.php Content controllers · app.php Config · web.php Routes · pages Pages
Components 24
HTTP boundary
Laravel routes, middleware, controllers, and requests
- Routes · Entry points for web, auth, settings, API, and console flows
routes/web.php - Middleware · Anonymous visitor identity, appearance, Inertia props, and security headers
app/Http/Middleware - Auth controllers · Registration, login, verification, and password recovery controllers
app/Http/Controllers/Auth - Settings · Profile and password settings controllers and forms
app/Http/Controllers/Settings
Content domain
Core models and flows for devocionales, enseñanzas, posts, and interactions
- Content controllers · Public content pages and CRUD for devocionales, enseñanzas, posts, and sitemap
app/Http/Controllers/DevocionalController.php - Devocional · Primary content record for devotionals, studies, and episodes
app/Models/Devocional.php - Ensenanza · Series container that devocionales can belong to
app/Models/Ensenanza.php - Likes · Cookie-based content likes and stored like records
app/Models/ContentLike.php - Views · Tracked content views with anonymized metadata
app/Models/DevocionalView.php - Post images · Associated images and downloadable post assets
app/Models/PostImage.php
Media & integrations
Uploads, sharing, notifications, payments, TTS, and web push
- Short links · Short-code generation and resolution for shared content
app/Services/ShortCodeService.php - Uploads · Image, bulk, and PDF upload controllers with validation
app/Http/Controllers/ImageUploadController.php - Text to speech · Voice RSS-backed audio generation for content
app/Http/Controllers/TTSController.php - Notifications · Push subscriptions, email notifications, and scheduled new-content notices
app/Notifications/NuevoContenidoNotification.php - Donations · ePayco donation handling and persistence
app/Http/Controllers/PaymentController.php - Contact form · Contact submissions, stored messages, and mail delivery
app/Http/Controllers/ContactController.php
Frontend
Inertia React pages, layouts, components, and client hooks
- Pages · React page views for public content, auth, settings, and dashboard
resources/js/pages - Components · Shared layout, feature widgets, and dashboard components
resources/js/components - Hooks · Like, share, appearance, and mobile navigation hooks
resources/js/hooks
Data layer
Migrations, seeders, factories, and persistent schema
Operations
SSR, service worker, config, and CI/testing
- SSR assets · Prebuilt server-side rendering bundle for Inertia pages
bootstrap/ssr/ssr.js - Service worker · Offline and push-support browser runtime
public/sw.js - Config · Filesystem, mail, webpush, inertia, queue, session, and services settings
config/app.php
Connections 24
- Routes → Middleware: passes through · Requests are shaped by shared request middleware before controllers run
- Routes → Auth controllers: auth routes · Authentication endpoints are routed to dedicated controllers
- Routes → Settings: settings routes · Profile and password settings are handled separately
- Routes → Content controllers: content routes · Public content, dashboard, sitemap, and related pages flow through controllers
- Content controllers → Devocional: reads/writes · Content controllers fetch and mutate the primary content model
- Content controllers → Ensenanza: series · Series pages and relations use the enseñanzas model
- Content controllers → Post images: media · Post and gallery controllers work with stored post images
- Devocional → Ensenanza: belongs to · Devocionales can be attached to a series container
- Content controllers → Likes: likes · Like actions are stored as first-class interaction records
- Content controllers → Views: tracks views · View tracking is persisted for analytics and ranking
- Content controllers → Short links: share links · Controllers generate and resolve short URLs for shared content
- Uploads → Post images: stores media · Uploads feed content image and document storage
- Uploads → Config: filesystem · Upload storage depends on configured filesystem drivers and S3 support
- Text to speech → Config: external api · Text-to-speech uses configured service credentials
- Notifications → Config: push/email · Notification delivery depends on mail and web push configuration
- Notifications → Service worker: push support · Web push subscriptions and service worker runtime cooperate for browser notifications
- Donations → Config: gateway · Donation webhooks and payment settings are driven by service config
- Contact form → Config: mail · Contact messages are sent through configured mail transport
- Contact form → Schema: persists · Contact submissions are stored in the database schema
- Pages → Components: composes · Pages are built from shared React components and layouts
- Pages → Hooks: uses · Pages consume hooks for likes, sharing, appearance, and mobile UX
- Pages → SSR assets: hydrates from · Initial page rendering is supported by the SSR bundle
- Middleware → Pages: shares props · Inertia middleware injects global data for React pages
- Schema → Seed data: bootstraps · Factories and seeders populate the schema for development and tests