📁 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 # 2025-08-02, 11:55:16, 2025-08-02time 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.php
extension. - /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 (2025-08-02
,11:55:16
).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.php
files.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
@yield
placeholders. - /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.