Historical v1.x reference.
These examples describe the original API. Read the current v2.x guides
or the upgrade guide.
π Squehub Project Directory Structure
After installing Squehub, your project will have the following directory structure. Each folder is designed with a specific purpose to help maintain a clean and scalable application.
myapp/
βββ app/ # Core application and framework source files
β βββ Clis/ # CLI command logic and generators
β β βββ dump/ # Data dumpers (seeders)
β β β βββ dump.php # Data dumping entry point
β β βββ make/ # Code generators for controllers, models, etc.
β β β βββ MakeController.php
β β β βββ MakeDumper.php
β β β βββ MakeMiddleware.php
β β β βββ MakeMigration.php
β β β βββ MakeModel.php
β β βββ clis.php # CLI command registry
β βββ Components/ # Blade-like directive handlers
β β βββ ControlStructuresComponent.php # @if, @foreach, etc.
β β βββ DateTimeComponent.php # @date, @time, @datetime directives
β β βββ Notification.php # Flash notifications handling
β βββ Core/ # Core framework engine classes
β β βββ Exceptions/ # Custom exception handlers
β β β βββ CustomPrettyPageHandler.php
β β β βββ debug.php
β β βββ Controller.php # Base controller class
β β βββ Database.php # Database connection and query handling (PDO wrapper)
β β βββ Dumper.php # Base dumper class for seeders
β β βββ Helper.php # Global helper functions
β β βββ Mail.php # Mail sending functionality
β β βββ MiddlewareHandler.php # Middleware management
β β βββ Model.php # Base ORM-style model class
β β βββ Notification.php # Notification dispatcher
β β βββ Service.php # Base service layer class
β β βββ Task.php # Cron-style scheduled task base
β β βββ Verification.php # Email/SMS/code verification logic
β β βββ View.php # Blade-like template engine
β βββ Routes/
β βββ web.php # Default application route definitions
β
βββ assets/ # Frontend assets (optional)
β βββ css/
β βββ js/
β βββ images/
β
βββ config/ # App-wide configuration files
β βββ debug.php # Debug settings
β βββ mail.php # Mail server credentials
β
βββ database/ # Database-related files
β βββ dumper/ # Seeder files
β βββ migrations/ # Database migration scripts
β βββ mg.sql # Optional SQL schema dump
β
βββ project/ # Developer's business logic & custom code
β βββ controllers/ # Project-level controllers
β βββ Middleware/ # Project-specific middleware
β βββ Models/ # Project-specific models
β βββ Utils/ # Project-level utility classes and helper functions
β β
β βββ Views/ # Project-specific Blade-like templates (overrides or custom views)
β βββ Package/ # Local packages or feature modules
β βββ Routes/ # Project-level route files
β
βββ public/ # Public web root
β βββ assets/ # Public static assets
β βββ .htaccess # Apache URL rewrite rules
β βββ index.php # Web app entry point
β
βββ scripts/ # Install & helper scripts
β βββ message/ # CLI/install messages
β
βββ storage/ # Generated files, caches, logs, backups
β βββ backups/
β βββ dev/ # Developer backup zips
β
βββ vendor/ # Composer dependencies
β
βββ views/ # Framework root Blade-like UI templates
β βββ layouts/ # Layout templates with @yield sections
β βββ partials/ # Shared view snippets like headers, footers, navbars
β βββ default/
β β βββ error/
β β βββ 404.php # Plain fallback error page
β β βββ 404.squehub.php # Custom 404 template
β β βββ 500.php # Plain 500 fallback page
β β βββ 500.squehub.php # Custom 500 template
β βββ home/
β βββ welcome.squehub.php # Default homepage
β βββ welcome2.squehub.php # Alternate example view
β
βββ .env # Environment configuration (not committed)
βββ .gitignore # Git exclusions
βββ .htaccess # Apache routing (root/fallback)
βββ bootstrap.php # Framework bootstrapper
βββ composer.json # Project package config
βββ composer.lock # Locked dependencies
βββ config.php # Global config bootstrap
βββ index.php # Root fallback entry point
βββ Router.php # Core routing engine
βββ squehub # CLI launcher file
βββ README.md # Project documentation
π Quick Summary of Key Folders
- /app/ β Core application logic, CLI tools, and framework engine files.
- /views/ β Framework root Blade-like templates using the
.squehub.phpextension. - /project/Views/ β Project-specific view templates allowing overrides or custom UI views.
- /project/Utils/ β Project-level utilities, helper classes, and functions (auto-loaded globally).
- /config/ β Application configuration files such as mail and debug settings.
- /project/ β Developer-defined business logic: controllers, middleware, models, packages, routes, and utilities.
- /database/ β Database migration and seeder files.
- /public/ β Public web root for static assets and entry point.
- /storage/ β Generated files, caches, logs, and backups.
π‘ Tip:
For security and proper routing, configure your production server to use
Use the root-level
/public as the web root.Use the root-level
index.php only on shared hosting environments without document root control.
π Detailed Explanation of Squehub Directories
This section expands on the structure above, explaining the purpose and typical contents of each main directory.
π§ /app/ β Core Application Logic
- /Clis/ β Contains CLI tools and command generators:
/dump/β Data seeders or dumpers for populating database test data./make/β Code generator classes for scaffolding controllers, models, migrations, middleware, etc.clis.phpβ CLI command registry for all commands.
- /Components/ β Blade-like template directive processors:
ControlStructuresComponent.phpβ Handles directives like@if,@foreach, etc.DateTimeComponent.phpβ Renders date/time directives (@date,@time).Notification.phpβ Manages flash and alert message rendering.
- /Core/ β Core framework engine classes:
Database.phpβ PDO database connection and query wrapper.Model.phpβ Base ORM model class.View.phpβ Blade-like templating engine handling.squehub.phpfiles.Controller.php,MiddlewareHandler.php,Helper.phpβ Core routing, middleware, and helper utilities.Task.phpβ Base class for scheduled (cron) tasks.Verification.phpβ Logic for email/SMS/code verification.Notification.phpβ Notification dispatch system.Mail.phpβ Mail sending functionality.Exceptions/β Custom error handlers.
- /Routes/ β Core framework routes (e.g.,
web.php).
πΌ /project/ β Developer Logic
- /controllers/ β Project-specific controllers (e.g.,
AuthController.php). - /Middleware/ β Custom middleware classes like
AuthMiddleware.php. - /Models/ β Business domain models extending the core Model class.
- /Utils/ β Project utilities, helper classes, and functions (auto-loaded globally).
- /Views/ β Project-specific Blade-like templates allowing overrides or additional views.
- /Package/ β Local packages or feature modules.
- /Routes/ β Application-specific route definitions.
π /views/ β Framework Root Blade-like UI Templates
- /layouts/ β Base layout templates with
@yieldplaceholders. - /partials/ β Shared view snippets like headers, footers, navigation.
- /default/error/ β Custom error pages (404, 500).
- /home/ β Main site pages (e.g.,
welcome.squehub.php).
π§© /config/ β Configuration Files
mail.phpβ SMTP or mail service configuration.debug.phpβ Debugging and error reporting settings.
πΎ /database/ β Migrations and Seeders
- /migrations/ β Database schema migration scripts.
- /dumper/ β Data seeders to populate tables for testing.
mg.sqlβ Optional raw SQL database backup.
π /public/ β Web Root
index.phpβ Front controller entry point..htaccessβ Apache rewrite rules for clean URLs.- /assets/ β Public static files: CSS, JavaScript, images.
π¦ /storage/ β Generated Files
- /backups/dev/ β Developer backups (zip archives).
- Future use: Caching, logs, file uploads.
βοΈ Root-Level Files
.envβ Environment variables (database credentials, keys).composer.jsonβ PHP dependencies and autoload configuration.Router.phpβ Core routing engine.squehubβ CLI launcher file.bootstrap.phpβ Framework bootstrap and initialization.
β
Best Practice: Avoid modifying core files in
/app/Core/. Instead, extend or override within /project/ to keep your code upgrade-safe.

