TruCMS Repository Layout

A guided tour of the repository so you know where to look — and where not to put things.

Top level

trucms/
  app/                     Core application (CMS), namespace App\
  bootstrap/               app.php (middleware/routing), providers.php, cache/
  config/                  Laravel and TruCMS configuration
  database/                migrations, factories, seeders (niches, demos, templates)
  lang/                    Core translations (en ar de es fr hi pt ru tr) + vendor/
  Modules/                 Business modules and plugins, namespace Modules\{Name}\
  public/                  Web root (build/, themes/, modules/, storage symlink)
  resources/
    themes/{admin,echo,default}/   The three themes (views + assets)
    sass/shared/                   Sass shared between themes
    views/                         Package view overrides (components, vendor)
  routes/                  web, front, app, auth, admin, admin_auth, api, breadcrumbs, console, channels
  scripts/                 Template kit build, screenshot capture tools
  storage/                 Framework files, generated theme CSS, private plugin staging
  tests/                   Core tests (Pest): Feature/ Unit/ and Pest.php helpers
  modules_statuses.json    Enabled/disabled map for modules
  vite.config.js           The single Vite config listing every entry point
  phpunit.xml  pint.json  phpstan.neon  composer.json  package.json

app/ — the core

app/
  Actions/Auth/            Fortify-style invokable (unused scaffolding)
  Casts/                   DateFormatCast, DatetimeFormatCast
  Console/Commands/        dotartisan:*, slugs:backfill, pages:refresh-bound, templates:*
  Contracts/               MenuInterface, ResolvableSlug, ResolvedSlugRenderer, TicketReference
  Events/                  AdminBooting + Ticket events
  Exceptions/              Plugins\PluginOperationException, Slugs\SlugConflictException
  Facades/                 Facades for the manager singletons
  Helpers/
    Helper.php             Global helper functions (autoloaded through composer "files")
    Admin/                 AdminAsideMenu, BuilderMenu, RegisterSettings
    Classes/               ArtisanApi, Installer*Service, UniqueSlug, FileStore, FileManager ...
    PageBuilder/           CoreShortcodes
  Http/
    Controllers/           Public + user-area controllers; Admin/ and Auth/ subfolders
    Middleware/            AdminTheme, FrontTheme, TwoFactor, DemoClearance ...
    Requests/              Form requests (Admin/, Auth/)
  Jobs/                    RefreshBoundPages
  Listeners/               Ticket and registration listeners
  Mail/                    TeamInvitation (the only Mailable)
  Models/                  Eloquent models (flat); Translations/ and Scopes/
  Notifications/           Ticket and goodbye notifications
  Observers/               Ticket, Advertisement, PageTemplate, PageTranslation
  Policies/                TeamPolicy, TicketPolicy (the only policies)
  Providers/               App, Dotartisan, MetaTags, Widgets, FrontendRouting
  Repositories/            PostRepository, CategoryRepository (query helpers for widgets)
  Rules/                   Custom validation rules
  Services/                Feature services (table below)
  Shortcodes/              Core shortcode definitions (blog, ads, contact, social share ...)
  Support/                 ThemeCssPrefix, TopbarHtml
  Traits/                  ClearCache, HasSlug, HasTeams, HandlesMediaUploads ...
  View/
    Components/            Class-based Blade components (layouts + shortcode components)
    Composer/              HeaderComposer, FooterComposer
    Presenters/            Admin/ and Echo/ presenters (data shaping for views)
  Widgets/                 Front widgets (Menu, Text, Html, Posts, Tags ...), Admin/ and Dashboard/

app/Services/ map

Folder / classResponsibility
Settings/Settings registry, Section, Page, Navigation, Fields and Fields/* (field types)
Menu/, MenuManager, MenuBuilderManagerAdmin sidebar items and menu-builder containers
Dashboard/DashboardRegistry, DashboardDefinition, DashboardRow, DashboardItem
AppPages/PageRegistry, PageDefinition (page types mapped to CMS pages)
Plugins/Plugin manager, installer, archive validator, dependency resolver, status store
PageBuilder/Shortcode registry/definition/traits, asset registry, Bindings/ (data-bound sections), AI/ (providers), Templates/ (CSS purger and template assets)
Slugs/Slug manager, resolver, normalizer, backfill and Renderers/
Themes/ThemeOptionsSchema, ThemeOptionStore, ThemeCssCompiler
WebsiteTemplates/Importer and Packages/ (the .trucms.zip export/import format)
ResponseCache/CacheProfile, CacheHasher, ResponseCacheInvalidator, replacers
Blog/Publication.phpComposition for the fixed blog design
Fonts/Google Fonts catalogue and stylesheet builder
DynamicCss, UpdatesManager, Authenticator, GeoLocationService, RoleManager, WidgetManagerCross-cutting services

resources/themes/

resources/themes/
  default/                 theme.json, assets/images, assets/js/ckeditor   (shared parent)
  admin/
    theme.json
    layouts/               app.blade.php, guest.blade.php
    components/            sidebar, header, breadcrumbs, fields/*, forms
    settings/index.blade.php        the generic settings renderer
    page-builder/          editor.blade.php (GrapesJS host)
    pages posts users roles plugins widgets support ...   one folder per feature
    assets/{js,sass}       app.js, page-builder.js, grapesjs/*, coreui/*
  echo/
    theme.json             name, extends, version AND the theme-option schema ("defaults")
    layouts/               app-layout, fullwidth-layout, guest-layout, error-page
    components/            application-header/footer, headers/* presets, placeholders/
    menu/                  bootstrap, megamenu, mobile, footer, topbar, list, inline
    pages/ blog/ posts/    page, blog and article views
    shortcodes/ widgets/   shortcode and widget Blade views
    user/ teams/ tickets/  logged-in visitor area
    auth/ auth-card/       login, register and reset screens
    emails/ errors/ vendor/        notification mail, error pages, package view overrides
    demo/                  public template showcase (demo mode only)
    page-templates/        template library (catalog.php, sections/*.html, scripts/)
    assets/{sass,js,images}

A module's anatomy (Modules/{Name})

Modules/Booking/
  module.json              manifest: name, alias, requires, providers, public_paths, protected ...
  composer.json            PSR-4  "Modules\\Booking\\": "app/"  (+ Seeders/Factories/Tests mappings)
  config/config.php        merged under config('booking')
  app/
    Providers/             BookingServiceProvider (extends ModuleServiceProvider), RouteServiceProvider, EventServiceProvider
    Http/Controllers/      Admin/, Front/, Provider/
    Models/ Services/ Events/ Listeners/ Jobs/ Console/ Helpers/ Widgets/ Shortcodes/ View/Components/
  routes/                  admin.php, front.php, public.php, provider.php, breadcrumbs.php
  database/                migrations/, seeders/, factories/
  lang/en/                 module translations (namespace booking::)
  resources/
    views/                 namespace booking::
    js/ scss/              Vite entry points (also listed in the root vite.config.js)
    page-templates/        Template-library layouts that use this module's shortcodes
    assets/images/         Layout screenshots
  tests/                   Feature/ and Unit/ (picked up by tests/Pest.php)

The full walkthrough is in Tutorial: build a plugin.

What lives where

If you are adding…Put it in…
An admin screen for a feature that belongs to a pluginModules/{Name}/resources/views/admin/…, route in Modules/{Name}/routes/admin.php
A generic CMS feature (rare)app/… + resources/themes/admin/… + routes/admin.php, wired like Pages
A new public view for an existing core featureresources/themes/echo/…
A settingAn AdminBooting listener that calls SettingsManager::add() (Settings screens)
A theme colour or typography optionThe defaults block of resources/themes/echo/theme.json
A page-builder blockA shortcode class registered in your provider's boot()
A template-library layoutEcho: resources/themes/echo/page-templates/sections/…; plugin: Modules/{Name}/resources/page-templates/
Business logic for a moduleModules/{Name}/app/Services/… (never app/Services)
A testtests/ for core behaviour, Modules/{Name}/tests/ for module behaviour

Files you should not edit by hand