100% Fully Dynamic Architecture

InterioCRAFT Website Builder Theme

Complete Technical Architecture, Database Flow, Controller Mapping, and Isolated Styling Guide

1. Is this Website Builder Theme Static or Dynamic?

The website builder is 100% FULLY DYNAMIC. None of the text, numbers, images, services, portfolio projects, or testimonials are hardcoded.

How It Works: All data is retrieved live from the Database (wb_agency_settings table) via Eloquent Model WbAgencySetting.php. When a user updates any content in their User Dashboard, the change is written directly to the database and immediately reflected on the live frontend site in real-time.

2. Step-by-Step Data Flow: Database to Browser Screen

1

User Saves in Dashboard

The user edits content (e.g., hero title, 4 stat cards, logos) in their User Dashboard form. Form POST submits to AgencyAdminController.php.

2

Database Persistence

WbAgencySetting.php stores fields into wb_agency_settings table. Stats, services, team & portfolio arrays are stored as JSON strings (cased to array).

3

Route Execution

A visitor accesses /templates/interior or custom subdomain (site.youverse.in). routes/website-builder.php dispatches request to FrontendController.php.

4

Controller Data Fetch

FrontendController::interiorTemplate() executes WbAgencySetting::getInteriorDefaults(), fetching DB records or falling back gracefully if unconfigured.

5

Blade View Rendering

The data object $interior is passed into index.blade.php. Blade loops over $interior->stats_data and renders running counters & components.

6

Isolated CSS & JS

The master layout layout.blade.php links public/css/website_builder/interior_theme.css, providing isolated, encapsulated visual styling.

3. Real Code File Mapping & Code Snapshots

Here is the exact code snippet driving the dynamic data flow in this theme:

A. Model Defaults & Fallbacks (app/Models/WebsiteBuilder/WbAgencySetting.php)

public static function getInteriorDefaults($customerId = null)
{
    $setting = self::where('customer_id', $customerId)->first();
    if (!$setting) {
        $setting = new self();
        $setting->site_title = 'InterioCRAFT';
        $setting->hero_badge = 'Our Home';
        $setting->stats_data = [
            ['number' => '8+',   'label' => 'Years of Experience', 'icon' => 'fa-trophy'],
            ['number' => '250+', 'label' => 'Projects Completed',  'icon' => 'fa-house'],
            ['number' => '98%',  'label' => 'Client Satisfaction', 'icon' => 'fa-star'],
            ['number' => '24/7', 'label' => 'Design Support',      'icon' => 'fa-headset'],
        ];
    }
    return $setting;
}

B. Frontend Controller Rendering (app/Http/Controllers/WebsiteBuilder/FrontendController.php)

public function interiorTemplate()
{
    $interior = \App\Models\WebsiteBuilder\WbAgencySetting::getInteriorDefaults();
    return view('website_builder.interior_template.index', compact('interior'));
}

C. Dynamic Blade Loop in Homepage (resources/views/website_builder/interior_template/index.blade.php)

@php
  $stats = $interior->stats_data ?? [ ... ];
@endphp

<div class="row g-2 g-md-3 mt-3 mt-md-4">
  @foreach($stats as $st)
    <div class="col-6 col-lg-3">
      <div class="card border-0 shadow-sm rounded-4 p-2 p-md-3 bg-white h-100">
        <div class="ic-counter-num fw-bold text-dark" data-target="{{ $st['number'] }}">
          {{ $st['number'] }}
        </div>
        <div class="text-muted fw-semibold ic-stat-label-text">
          {{ $st['label'] }}
        </div>
      </div>
    </div>
  @endforeach
</div>

4. Full Theme File Structure & Responsibilities

Below is the exact folder structure and breakdown of all files handling the InterioCRAFT theme:

Layer / File Path Type Description & Responsibility
app/Models/WebsiteBuilder/WbAgencySetting.php Eloquent Model Handles database table wb_agency_settings, JSON array casting, default fallback values for statistics, portfolio items, services, & site configuration.
routes/website-builder.php Routes Maps URLs (/templates/interior, /about, /portfolio, /contact) and custom subdomains to controller actions.
app/Http/Controllers/WebsiteBuilder/FrontendController.php Frontend Controller Queries WbAgencySetting for the current user site/subdomain, compiles dynamic data, and passes $interior to Blade views.
app/Http/Controllers/WebsiteBuilder/AgencyAdminController.php Admin Controller Handles user dashboard operations, enabling users to edit site titles, hero badges, logos, stat counters, and services in real-time.
resources/views/website_builder/interior_template/layout.blade.php Master Layout Contains HTML5 shell, navigation header, offcanvas mobile menu, global CTA banner, footer grid, scroll observer JS & counter animation script.
resources/views/website_builder/interior_template/index.blade.php Homepage View Hero banner, 4 floating stat card boxes, services slider, featured project grid, blog grid, and testimonials slider.
resources/views/website_builder/interior_template/portfolio.blade.php Portfolio View Filterable project showcase grid, single-row auto-sliding category filter bar, search bar, and hero action buttons.
resources/views/website_builder/interior_template/about.blade.php About Us View Company story section, founder quote, mission/vision cards, full-width stat bar, and single-row mobile team slider.
resources/views/website_builder/interior_template/contact.blade.php Contact Us View Inquiry form, contact info cards, embedded Google Maps iframe, and office hours block.
public/css/website_builder/interior_theme.css Isolated CSS Encapsulated design system CSS tokens (colors, font families, radius, shadows), responsive mobile slider styling, and zero-overflow rules.

5. How Theme Isolation Works

The interior_template is designed to be completely isolated from other website builder themes (such as agency_template):