How sadekbd/prosper works
1. Overall shape
- This is a Laravel monolith for a content/marketing site with a separate admin CMS.
- The app is split into two major user-facing areas: a public website and an authenticated admin area.
- Views are Blade templates, data access is Eloquent models, and the app is configured through standard Laravel config/* plus a custom config/prosper.php.
2. Request entry and routing
- All HTTP traffic enters through public/index.php.
- Routing is organized by concern: routes/web.php for public pages, routes/admin.php for the back office, and routes/console.php for command-line actions.
- The route structure likely maps directly to the controller namespaces under app/Http/Controllers/Public and app/Http/Controllers/Admin.
3. Public website subsystem
- Public controllers include Home, About, Services, Portfolio, Blog, Contact, Newsletter, and Sitemap.
- The public views live in resources/views/public/* with shared header/footer/SEO components under resources/views/components/public.
- This area serves marketing pages, content detail pages, contact forms, newsletter signup, and sitemap/SEO output.
4. Admin CMS subsystem
- The admin area is a separate controller set under app/Http/Controllers/Admin.
- It manages blog articles and categories, portfolio items, services, contact messages, newsletter subscribers, site settings, and users.
- Corresponding admin views are grouped under resources/views/admin/*, with shared admin layout pieces in resources/views/components/admin.
5. Authentication and role-based access
- Admin authentication is handled by dedicated auth controllers: login, signup, and forgot-password.
- Access control is enforced with custom middleware: AdminAuth, AdminOrAbove, SuperAdminOnly, ArticleWriterAccess, and RedirectIfAdminAuthenticated.
- This indicates role-aware authorization rather than a single flat admin login.
6. Domain model layer
- Core persistent entities include BlogArticle, BlogCategory, PortfolioProject, Service, ServiceFeature, Page, ContactMessage, NewsletterSubscriber, SiteSetting, AdminUser, User, and ActivityLog.
- These models represent the content and operational data used by both public pages and admin CRUD screens.
- ActivityLog suggests audit/history tracking in the admin workflow.
7. Data flow from content to UI
- Public controllers read from Eloquent models and render Blade views with site content.
- Admin controllers perform CRUD operations on the same domain models, which then immediately affect what the public site shows.
- Shared data like SEO metadata and site settings likely flows through the settings model and seo-meta component into layouts and pages.
8. Forms, validation, and message ingestion
- Form validation is separated into request classes: Admin/LoginRequest, Admin/SignupRequest, and Public/ContactFormRequest.
- Public contact submissions and newsletter signups feed into persisted models and are visible in the admin interface.
- This creates a clear boundary between user input validation and controller logic.
9. Database and bootstrap data
- The project uses standard Laravel migrations plus seeders for initial content.
- Seeders populate blog categories/articles, pages, portfolio items, services, site settings, and a super admin account.
- database/factories exists for test data, suggesting the domain is meant to be exercised through automated tests as well.
10. Operational and install path
- There is a custom console command, InstallProsperMedia, which implies a first-run setup or onboarding flow.
- DEPLOYMENT.md and the presence of seeded site content suggest the application is designed to be deployed with preloaded CMS data.
- Standard Laravel runtime pieces are present for cache, queue, session, logging, and mail configuration.
11. Front-end asset pipeline
- Front-end assets are built with Vite, Tailwind CSS, and JavaScript entrypoints under resources/js and resources/css.
- A standalone public/js/prosper_chat_widget.js indicates at least one shipped browser-side widget outside the main build pipeline.
- The UI is primarily server-rendered, with asset bundling supporting styling and small interactive enhancements.
12. Security and presentation boundaries
- SecurityHeaders middleware indicates response hardening at the HTTP layer.
- Error pages are custom-branded for 404, 500, and 503 conditions.
- The app also includes robots and sitemap support, showing attention to public-site discoverability and crawl behavior.
Main entry points: Models Content models · admin.php Admin routes · Public Public controllers · web.php Web routes
Components 18
Runtime
Laravel bootstrap, HTTP entrypoint, and route dispatch
- index.php · Front controller that receives all web requests.
public/index.php - Web routes · Routes for the public site.
routes/web.php - Admin routes · Routes for the back office and admin workflows.
routes/admin.php - Console routes · Command-line route definitions and scheduled actions.
routes/console.php
Public site
Marketing pages, content rendering, and public forms
- Public controllers · Home, about, services, portfolio, blog, contact, newsletter, and sitemap handlers.
app/Http/Controllers/Public - Public views · Server-rendered pages for the public-facing website.
resources/views/public - Public UI · Shared header, footer, and SEO metadata pieces.
resources/views/components/public
Admin CMS
Authenticated back office and CRUD management
- Admin controllers · CRUD controllers for content, settings, messages, subscribers, and users.
app/Http/Controllers/Admin - Auth controllers · Login, signup, and password reset flows for administrators.
app/Http/Controllers/Admin/Auth - Admin views · Dashboard and management screens for the CMS.
resources/views/admin - Admin UI · Shared sidebar and topbar used by admin layouts.
resources/views/components/admin
Domain models
Persistent content, settings, and operational records
- Content models · Articles, pages, services, portfolio, messages, subscribers, settings, users, and audit logs.
app/Models
Infrastructure
Middleware, requests, commands, and build assets
- Middleware · Authentication, role checks, redirect rules, and security headers.
app/Http/Middleware - Form requests · Request validation for admin auth and public contact submissions.
app/Http/Requests - Install command · First-run installation and setup command.
app/Console/Commands/InstallProsperMedia.php - Seeders · Initial content and super-admin provisioning for a fresh install.
database/seeders - Assets · Vite, Tailwind, and app JavaScript/CSS entrypoints plus a standalone chat widget.
resources/js - Config · Laravel configuration plus custom prosper and role settings.
config/prosper.php
Connections 22
- index.php → Web routes: dispatches · HTTP entrypoint hands requests to the web router.
- index.php → Admin routes: dispatches · Admin requests are routed through the back office route file.
- Web routes → Public controllers: maps to · Public routes invoke site controllers.
- Admin routes → Admin controllers: maps to · Admin routes invoke CMS controllers.
- Admin routes → Auth controllers: maps to · Authentication routes are handled by dedicated auth controllers.
- Public controllers → Content models: reads/writes · Public pages read content and persist submissions.
- Admin controllers → Content models: crud · CMS controllers manage the shared domain records.
- Auth controllers → Content models: auth data · Admin login and signup operate on user records.
- Public controllers → Public views: renders · Site controllers return Blade templates.
- Admin controllers → Admin views: renders · CMS controllers return admin Blade templates.
- Public views → Public UI: uses · Public pages compose shared header, footer, and SEO metadata.
- Admin views → Admin UI: uses · Admin screens share common layout elements.
- Web routes → Middleware: protected by · Public and mixed routes use HTTP middleware for security and access control.
- Admin routes → Middleware: protected by · Admin area depends on auth and role middleware.
- Public controllers → Form requests: validates with · Public form submissions use request validation.
- Auth controllers → Form requests: validates with · Login and signup forms use dedicated requests.
- Install command → Seeders: bootstraps · Install command complements seeded initial content and admin setup.
- Seeders → Content models: creates · Seed data populates the main content and settings models.
- Assets → Public views: styles/scripts · Bundled assets support the server-rendered public UI.
- Assets → Admin views: styles/scripts · Bundled assets also support admin interface styling.
- Config → Middleware: configures · Role and security behavior are driven by configuration.
- Config → Content models: drives · Site settings and role configuration shape model behavior.