A lightweight, modern PHP MVC framework designed for rapid development with zero configuration, interactive UI components, and production-ready features out of the box.
Hoist includes comprehensive API documentation for all framework components:
- CLI Tool Documentation - Revolutionary database migration, code generation, and development tools
- FileDatabase API - Zero-configuration JSON database with SQL-like queries (default storage)
- Components API - Dynamic component system for reusable UI elements and modular architecture
- Authentication API - User authentication, sessions, and role-based access
- Database API - MySQL and FileDatabase operations with query building
- Model API - Active Record pattern with security features and validation
- Request API - HTTP request handling, data validation, and file uploads
- Response API - JSON responses, redirects, and content delivery
- Router API - URL routing, parameter extraction, and nested controllers-Components-purple)
Hoist isn't just another PHP framework - it's a complete development ecosystem that gets you from idea to production faster than ever before. With zero configuration setup, interactive UI components, and enterprise-grade security, Hoist eliminates the complexity while delivering professional results.
🚀 Start building in under 60 seconds
🎨 Beautiful UI components included
🔐 Security-first architecture
📦 Docker-ready deployment
🗂️ Flexible database options
- 30+ Pre-built Components: Forms, modals, tables, badges, cards, and more
- Tailwind CSS Integration: Beautiful, responsive design out of the box
- JavaScript Interactivity: Modal dialogs, confirmations, dynamic tables
- Organized Architecture: Logical separation into Form/, UI/, and Layout/ components
- Convention-based Routing:
/users/create→UsersController::create() - Automatic Component Loading: Render components with simple syntax
- FileDatabase System: Start building without database setup
- Docker Container: Single command deployment
- 🎯 CLI Migration Tool: One-command FileDatabase → MySQL conversion
The feature that changes everything! Hoist's CLI tool enables instant migration from development to production:
# 1. Develop with FileDatabase (0 setup time)
# Build your entire MVP with JSON-based storage
# 2. Scale to MySQL (1 command)
php hoist migrate:to-mysql --database=myapp
# 3. Production ready!
# Same code, production databaseWhat the migration does:
- ✅ Discovers all tables automatically from FileDatabase
- ✅ Analyzes data types from existing records
- ✅ Generates MySQL schemas with proper column types
- ✅ Migrates all data preserving relationships
- ✅ Zero downtime - works with live applications
This eliminates the development bottleneck:
- No more "database setup before coding"
- No more "different storage for dev vs prod"
- No more complex migration scripts
- Start coding immediately, scale when ready!
- Service Injection: Clean dependency management throughout
- Nested Controllers: Organize code in logical subdirectories
- Flexible Models: Dual FileDatabase/MySQL support
- Secure Views: Built-in XSS protection and validation
- Input Validation: 30+ validation rules with custom messages
- XSS Protection: Automatic output escaping and cleaning
- Authentication System: Role-based access with session management
- CSRF Protection: Built-in security against cross-site attacks
- Admin Panel: Complete user management interface
- Caching System: Redis, Memcached, and file-based options
- Error Handling: Graceful degradation with detailed debugging
- RESTful APIs: JSON responses with proper HTTP status codes
Visit the live admin panel to see Hoist's capabilities:
- Start the application:
docker-compose up -d - Visit: http://localhost:8080
- Login as admin: Navigate to user authentication demo
- Explore admin panel: See interactive tables, modals, and confirmations
Admin Panel Features:
- ✅ Interactive user management with modals
- ✅ Dynamic data tables with action buttons
- ✅ Confirmation dialogs for destructive actions
- ✅ Real-time statistics and activity feeds
- ✅ Role-based access control
- ✅ Responsive design on all devices
git clone https://github.com/RobertGrubb/hoist-php.git
cd hoist-php
docker-compose up -dThat's it! Open http://localhost:8080 and start building.
Hoist includes a powerful CLI tool that revolutionizes the development-to-production workflow:
📚 Complete CLI Documentation →
The most innovative feature - seamlessly migrate from FileDatabase to MySQL:
# Start with FileDatabase (zero setup)
# Build your entire MVP with file-based storage
# When ready for production, ONE COMMAND:
php hoist migrate:to-mysql --database=myapp --user=root --password=secret
# ✅ Automatically converts ALL your data
# ✅ Generates proper MySQL schemas
# ✅ Preserves all relationships
# ✅ Zero downtime migrationThis solves the classic development dilemma:
- 🎯 Development: FileDatabase (instant setup, zero configuration)
- 🚀 Production: MySQL (scalable, production-ready)
- ✨ Migration: One command transition!
# Generate code scaffolding
php hoist generate:controller UserController
php hoist generate:model User
php hoist generate:component Form.CustomInput
# Development server
php hoist serve --port=8080
# Clear cache
php hoist cache:clear
# See all commands
php hoist --help📖 View Complete CLI Reference →
Create an interactive user interface in minutes:
// In any controller
$this->instance->view->render('dashboard', [
'users' => $users
]);<!-- In your view -->
<!-- Render a beautiful data table -->
<?= $components->render('Layout.DataTable', [
'headers' => ['Name', 'Email', 'Status'],
'rows' => array_map(function($user) {
return [
'data' => $user,
'cells' => [
htmlspecialchars($user['name']),
htmlspecialchars($user['email']),
$components->render('UI.Badge', [
'text' => $user['status'],
'color' => $user['status'] === 'active' ? 'green' : 'red'
])
]
];
}, $users),
'actions' => [
[
'icon' => 'fas fa-edit',
'class' => 'text-blue-600 hover:text-blue-900',
'title' => 'Edit',
'onclick' => 'openModal(\'editUserModal\'); loadUser(\'{id}\')'
]
]
]) ?>
<!-- Add a modal dialog -->
<?= $components->render('UI.Modal', [
'id' => 'editUserModal',
'title' => 'Edit User',
'content' => '<!-- Your form content -->'
]) ?>Create beautiful, accessible forms with zero custom CSS:
// Text input with validation styling
<?= $components->render('Form.Input', [
'type' => 'email',
'name' => 'email',
'label' => 'Email Address',
'placeholder' => 'Enter your email',
'required' => true
]) ?>
// Select dropdown with options
<?= $components->render('Form.Select', [
'name' => 'role',
'label' => 'User Role',
'options' => ['user' => 'User', 'admin' => 'Administrator'],
'required' => true
]) ?>
// Styled button with icon
<?= $components->render('Form.Button', [
'text' => 'Save Changes',
'icon' => 'fas fa-save',
'variant' => 'primary',
'onclick' => 'handleSave()'
]) ?>Interactive elements that bring your interface to life:
// Status badges with colors
<?= $components->render('UI.Badge', [
'text' => 'Active',
'icon' => 'fas fa-check-circle',
'color' => 'green'
]) ?>
// Information cards
<?= $components->render('UI.Card', [
'title' => 'User Statistics',
'content' => 'Your dashboard content here'
]) ?>
// Modal dialogs with JavaScript integration
<?= $components->render('UI.Modal', [
'id' => 'confirmDialog',
'title' => 'Confirm Action',
'size' => 'lg',
'content' => 'Modal content with forms or information'
]) ?>
// Confirmation dialogs
<?= $components->render('UI.Confirmation', [
'id' => 'deleteConfirm',
'title' => 'Delete Item',
'message' => 'This action cannot be undone.',
'variant' => 'danger',
'confirmAction' => 'handleDelete()'
]) ?>Display data beautifully with built-in interactivity:
// Interactive data tables
<?= $components->render('Layout.DataTable', [
'headers' => ['User', 'Email', 'Role', 'Actions'],
'rows' => $userRows,
'actions' => [
['icon' => 'fas fa-eye', 'onclick' => 'viewUser(\'{id}\')'],
['icon' => 'fas fa-edit', 'onclick' => 'editUser(\'{id}\')'],
['icon' => 'fas fa-trash', 'onclick' => 'deleteUser(\'{id}\')']
]
]) ?>
// Statistics cards
<?= $components->render('Layout.AdminStatCard', [
'title' => 'Total Users',
'value' => count($users),
'icon' => 'fas fa-users',
'color' => 'blue'
]) ?>
// Feature showcase cards
<?= $components->render('Layout.FeatureCard', [
'title' => 'Zero Configuration',
'description' => 'Start building immediately with smart defaults',
'icon' => 'fas fa-rocket',
'color' => 'blue'
]) ?>Application/Components/
├── Form/ # Input elements
│ ├── Input.php # Text inputs, email, password
│ ├── Button.php # Interactive buttons
│ ├── Select.php # Dropdown selections
│ └── Checkbox.php # Toggle inputs
├── UI/ # Interface elements
│ ├── Modal.php # Dialog windows
│ ├── Confirmation.php # Action confirmations
│ ├── Badge.php # Status indicators
│ ├── Card.php # Content containers
│ └── Alert.php # Notification messages
└── Layout/ # Display components
├── DataTable.php # Interactive tables
├── FeatureCard.php # Feature showcases
├── AdminStatCard.php # Dashboard statistics
└── DefinitionList.php # Key-value displays
Every component follows the clean service injection pattern:
return function ($instance, $data = []) {
// Access to all framework services
$auth = $instance->auth;
$request = $instance->request;
$validation = $instance->validation;
// Component logic with security and validation
$content = htmlspecialchars($data['content'] ?? '');
return $html;
};URL Pattern → Controller Location
/ → Controllers/IndexController::index()
/users → Controllers/UsersController::index()
/admin/users → Controllers/Admin/UsersController::index()
/admin/users/edit → Controllers/Admin/UsersController::edit()
/api/v1/users → Controllers/Api/V1Controller::users()
/dashboard/analytics → Controllers/Dashboard/AnalyticsController::index()
Perfect for development and rapid prototyping:
// Automatic JSON storage
$users = $this->instance->models->user->all();
$user = $this->instance->models->user->create([
'name' => 'John Doe',
'email' => 'john@example.com',
'created_at' => date('Y-m-d H:i:s')
]);Seamless upgrade path for complex applications:
// Automatic detection and fallback
class UserModel extends Model {
public function getAll() {
if ($this->instance->database->hasMySQL()) {
return $this->instance->database->client->select('users', '*');
}
return $this->fileDatabase->all('users');
}
}// Built-in validation with 30+ rules
$validated = $this->instance->request->validate([
'email' => 'required|email|unique:users',
'password' => 'required|min:8|strong',
'age' => 'required|integer|min:18|max:120'
]);
// Automatic XSS protection
$safeContent = $this->instance->cleaner->clean($userInput);// Role-based access control
$this->instance->auth->requireGroup('admin');
// Session management
if ($this->instance->auth->login($email, $password)) {
$user = $this->instance->auth->user();
}// Multi-tier caching with automatic fallback
$data = $this->instance->cache->remember('expensive.query', 3600, function() {
return $this->instance->models->analytics->getComplexData();
});
// Tagged cache for group operations
$this->instance->cache->tags(['users'])->flush();// Automatic content negotiation
public function api() {
$data = $this->instance->models->user->all();
if ($this->instance->request->wantsJson()) {
return $this->instance->response->json($data);
}
$this->instance->view->render('users/index', ['users' => $data]);
}Complete administrative interface with:
- ✅ User management with modals and confirmations
- ✅ Real-time statistics and activity monitoring
- ✅ Role-based access control
- ✅ Interactive data tables with action buttons
- ✅ Responsive design for mobile administration
# Development
docker-compose up -d
# Production
docker build -t my-app .
docker run -d -p 80:80 my-app# Upload files and set document root to source/public/
chmod -R 755 Application/Database/Hoist includes comprehensive API documentation for all framework components:
- FileDatabase API - Zero-configuration JSON database with SQL-like queries (default storage)
- Authentication API - User authentication, sessions, and role-based access
- Database API - MySQL and FileDatabase operations with query building
- Model API - Active Record pattern with security features and validation
- Request API - HTTP request handling, data validation, and file uploads
- Response API - JSON responses, redirects, and content delivery
- Router API - URL routing, parameter extraction, and nested controllers
- View API - Template rendering, component integration, and data passing
- Controller API - Base controller functionality and MVC patterns
- Security API - CSRF protection, form security, and request validation
- Validation API - Input validation with 50+ rules and custom messages
- Session API - Session management, flash data, and state persistence
- Cache API - Multi-driver caching with Redis, Memcached, and file support
- Utilities API - Helper functions for UUIDs, HTTP requests, and data processing
- ✅ Complete method documentation with parameters and return types
- ✅ Real-world examples for every API method and CLI command
- ✅ Security best practices and implementation guidelines
- ✅ Framework integration patterns and advanced usage
- ✅ Enterprise-grade standards with comprehensive coverage
- ✅ Revolutionary CLI tool with migration and code generation guides
📚 Browse All API Documentation →
🎯 View CLI Tool Documentation →
We welcome contributions! Hoist is built by developers, for developers.
# Development setup
git clone https://github.com/RobertGrubb/hoist-php.git
cd hoist-php
docker-compose up -d
# Make your changes
git checkout -b feature/amazing-feature
# ... your improvements ...
git commit -m "Add amazing feature"
git push origin feature/amazing-featureContribution Areas:
- 🎨 New UI components
- 🔧 Framework enhancements
- 📚 Documentation improvements
- 🧪 Test coverage expansion
- 🌟 Example applications
MIT License - build amazing things with Hoist!
git clone https://github.com/RobertGrubb/hoist-php.git
cd hoist-php
docker-compose up -dOpen http://localhost and start building the future! 🌟
Built with ❤️ by developers who believe great software should be simple, secure, and beautiful.