muhammadadela / phplitecore
phpLiteCore is a modern, lightweight, and fast PHP framework for building web applications of any size.
Requires
- php: >=8.3
- ext-bcmath: *
- ext-exif: *
- ext-fileinfo: *
- ext-gd: *
- ext-intl: *
- ext-mbstring: *
- ext-pdo: *
- phpmailer/phpmailer: ^7.0
- symfony/console: ^6.4|^7.0
- symfony/yaml: ^6.4
- vlucas/phpdotenv: ^5.6
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- pestphp/pest: ^2.34
- phpstan/phpstan: ^1.12
- symfony/var-dumper: ^6.4
Suggests
- ext-mysqli: Optional if you implement a MySQLi driver.
- ext-sqlsrv: Optional if you implement a SQLSRV driver.
- dev-master
- v1.0.0
- dev-copilot/setup-wsl2-ubuntu-docker-compose
- dev-copilot/fix-duplicate-else-block
- dev-copilot/optimize-file-download-performance
- dev-copilot/refactor-middleware-type-detection
- dev-copilot/enrich-http-request-response
- dev-copilot/update-composer-and-fix-tests
- dev-copilot/fix-bug-in-console-config
- dev-copilot/add-ci-static-analysis-coverage
- dev-copilot/standardize-web-root-structure
- dev-copilot/add-cli-commands-route-inspection
- dev-copilot/improve-db-layer-documentation
- dev-copilot/introduce-semver-governance
- dev-copilot/add-reverse-url-helper
- dev-copilot/add-psr7-psr15-support
- dev-copilot/add-security-middleware-pack
- dev-copilot/expand-documentation-routing-di
- dev-copilot/review-project-feedback
- dev-copilot/refactor-render-method-for-composers
- dev-copilot/refactor-request-class
- dev-copilot/configure-actions-setup
- dev-copilot/update-translator-class-features
- dev-copilot/add-active-record-relationships
- dev-copilot/add-db-indexes-for-users
- dev-revert-9-copilot/cifix-composer-lock
- dev-copilot/cifix-composer-lock
- dev-copilot/add-migrations-seeders-system
- dev-copilot/add-middleware-pipeline-routing
- dev-copilot/introduce-service-container
- dev-copilot/standardize-counting-api
- dev-copilot/add-csrf-protection-middleware
- dev-copilot/add-global-e-helper
- dev-copilot/fix-duplicate-namespace-and-imports
This package is auto-updated.
Last update: 2026-03-19 20:37:04 UTC
README
phpLiteCore is a modern, lightweight, and fast PHP framework designed for building web applications of any size. It focuses on simplicity, speed, and a clean architecture, providing core essentials without unnecessary bloat.
โจ Features
- โก Ultra-lightweight and Fast: Minimal core for optimal performance.
- ๐งฉ Clean Architecture: Adheres to MVC principles with strict separation of concerns.
- ๐งฑ Hybrid Active Record: Simplifies database interactions (Querying & Manipulation).
- ๐ฃ๏ธ Flexible Routing: Supports GET, POST, dynamic route parameters, named routes, and reverse URL generation.
- ๐ Built-in Translation (i18n): Modular system supporting multiple languages (EN/AR included).
- ๐ก๏ธ Environment-Aware Error Handling: Detailed errors in development, user-friendly messages & developer notifications (SMTP) in production.
- ๐ฆ Asset Management Ready: Integrated with NPM, Webpack, and SCSS for easy frontend workflows.
- โ๏ธ Input Validation: Simple, integrated validation system.
- ๐ Pagination: Built-in pagination logic and renderers (Bootstrap 5).
- ๐ ๏ธ Extensible: Designed to be easily extended with custom components.
๐ Getting Started
Quick Start with Docker (Recommended for Development)
The easiest way to get started is using Docker Compose on WSL2 Ubuntu 24.04:
# Clone the repository git clone https://github.com/MuhammadAdelA/phpLiteCore.git cd phpLiteCore # Run the automated setup script (one-time setup) chmod +x setup-wsl2-ubuntu.sh ./setup-wsl2-ubuntu.sh # Start the development environment docker-compose up -d # Install dependencies and build assets docker-compose exec app composer install docker-compose exec app npm install docker-compose exec app npm run build # Access your application at http://localhost:8080
See the complete Docker Setup Guide for detailed instructions, troubleshooting, and advanced usage.
Manual Setup (Traditional)
-
Clone the repository:
git clone https://github.com/MuhammadAdelA/phpLiteCore.git cd phpLiteCore -
Install Dependencies:
# Install PHP dependencies composer install # Install Node.js dependencies and build assets npm install npm run build # or 'npm run dev' for development
-
Configure Environment:
- Copy
.env.exampleto.env. - Update
.envwith your database credentials, SMTP settings (for production error reporting), andAPP_ENV(developmentorproduction).
- Copy
-
Set Up Database:
- Import the
phplitecore.sqlfile into your MySQL database.
- Import the
-
Configure Web Server:
- Recommended (Secure): Point your web server's document root to the
public/directory. This ensures only the public assets are accessible. - Alternative (Backward Compatible): Point to the project root directory. The
.htaccessfile will redirect requests topublic/, but this is less secure. - Ensure
mod_rewrite(or equivalent for your server) is enabled.
- Recommended (Secure): Point your web server's document root to the
-
Run:
- Open the project URL in your browser. You should see the welcome page!
๐ Documentation
View the live documentation:
https://muhammadadela.github.io/phpLiteCore/
(Includes guides for both English and Arabic, covering core concepts, routing, database interaction, translation, and more.)
Database Layer Quick Start
phpLiteCore provides a powerful yet simple database layer with Active Record pattern:
// Find a user by ID $user = User::find(1); // Query with conditions $activeAdmins = User::where('role', 'admin') ->where('status', 'active') ->orderBy('created_at', 'DESC') ->get(); // Eager load relationships to avoid N+1 queries $users = User::with(['posts', 'profile']) ->where('status', 'active') ->get(); // Use transactions for data integrity $db->beginTransaction(); try { $user->credits -= 100; $user->save(); $otherUser->credits += 100; $otherUser->save(); $db->commit(); } catch (\Exception $e) { $db->rollBack(); }
Comprehensive Guides:
- Database Guide (Markdown) - Complete guide with examples for transactions, relationships, query building, and edge cases
- Query Builder Guide (Interactive) - Visual guide with syntax highlighting
Development Environment:
For a complete Docker-based development environment on WSL2 Ubuntu 24.04, see the Docker Setup Guide with instructions for:
- Automated setup script for WSL2
- Docker Compose configuration
- Development tools (phpMyAdmin, MailHog)
- Troubleshooting and common tasks
Network Configuration:
If you need to configure network access for GitHub Actions or work behind firewalls, see the Network Configuration Guide for detailed setup instructions.
๐ฆ Versioning
phpLiteCore follows Semantic Versioning 2.0.0 (SemVer). We maintain a detailed CHANGELOG.md documenting all notable changes for each release.
Version Support
- Active Support: 12 months (bug fixes, security patches, new features)
- Security Support: Additional 12 months (security patches only)
- Total Support: 24 months per major version
Current Version
Check the latest release for the current stable version.
Learn More:
- Versioning Policy - Complete versioning and release policy
- CHANGELOG - Detailed change history for all versions
- Upgrade Guides - Step-by-step upgrade instructions
๐ก๏ธ Security
Security is a top priority for phpLiteCore. If you discover a security vulnerability, please review our Security Policy for responsible disclosure guidelines.
๐งช Code Quality
phpLiteCore maintains high code quality standards:
- PSR-12 Compliant: All code follows PSR-12 coding standards
- Static Analysis: Uses PHPStan for type safety
- Automated Tests: Comprehensive test suite with Pest PHP
- Code Style: Automated formatting with PHP CS Fixer
Running Quality Checks
# Run tests ./vendor/bin/pest # Run static analysis (requires PHPStan) composer require --dev phpstan/phpstan ./vendor/bin/phpstan analyse # Fix code style (requires PHP CS Fixer) composer require --dev friendsofphp/php-cs-fixer ./vendor/bin/php-cs-fixer fix
๐ค Contributing
Contributions are welcome! Please read the CONTRIBUTING.md guide and our Code of Conduct.
๐ License
phpLiteCore is open-source software licensed under the MIT license.