This software is an open-source project developed for the community and is not affiliated with any organization or institution.
It is shared purely for educational purposes, software development testing, and to contribute to the growth of the open-source community.
By using this software, you agree that:
- All responsibility lies with you, the user.
- The platform and its contributors provide this software "as is", without any warranty of any kind, express or implied.
This includes, but is not limited to, the warranties of merchantability, fitness for a particular purpose, or non-infringement.
β οΈ Use it at your own risk.
The primary purpose of this project is to:
- Educate the community by sharing open-source code.
- Facilitate learning and encourage innovation through open collaboration.
β This software is not intended for production use.
We strongly recommend purchasing and using professionally licensed software for your needs.
If you would like to support the community and this project, consider making a donation:
If you encounter any abuse or misuse of this software, please report it to:
π§ [email protected]
Thank you for being a part of the open-source community! π
Coff PHP Framework is a modern, lightweight, and AI-friendly PHP framework designed for speed, efficiency, and predictability.
With version 2.0, the framework has been re-architected to support microservices, strict typing, and modern dependency injection patterns while maintaining its simplicity.
- AI-Friendly Architecture: Strict typing, predictable interfaces, and PSR standards make it easy for AI assistants to understand and generate code.
- Modern Core: A completely refactored kernel (
src/Core) with a powerful Dependency Injection Container. - Microservice Ready: Built-in support for JSON APIs, Stateless Authentication (JWT-ready), and standardized API Responses.
- Dual Routing System: Supports both modern Route definitions (
routes/web.php,routes/api.php) and legacy folder-based routing (?path=Handler). - Robust Logging: Integrated Monolog support for professional-grade logging.
- Lightweight: Minimal overhead compared to Laravel or Symfony.
The framework follows a clean separation of concerns:
coff-framework/
βββ app/ # Application Logic (Your Code)
β βββ Controllers/ # Web Controllers
β βββ Models/ # Database Models
β βββ Services/ # Business Logic
βββ config/ # Configuration Files
βββ public/ # Web Entry Point (index.php)
βββ routes/ # Route Definitions
β βββ api.php # API Routes (Microservices)
β βββ web.php # Web Routes
βββ src/ # Framework Core (Do Not Edit)
β βββ Auth/ # Authentication Guards
β βββ Core/ # Container, Application, Logger
β βββ Http/ # Kernel, Router, Request, Response
βββ vendor/ # Composer Dependencies
- PHP 7.4 or higher
- Composer
- Clone the repository:
git clone https://github.com/ubden/coff-framework.git
- Install dependencies:
composer install
- Set up your environment:
Copy
.env.exampleto.env(if available) and configure your database.
Define your routes in routes/web.php or routes/api.php.
// routes/api.php
$router->get('/users', 'App\Controllers\UserController@index');
// routes/web.php
$router->get('/', function() {
echo "Welcome to Coff Framework!";
});The new Container supports auto-wiring. You can type-hint dependencies in your controller constructors.
use Coff\Framework\Core\Logger;
class UserController {
protected $logger;
public function __construct(Logger $logger) {
$this->logger = $logger;
}
public function index() {
$this->logger->info('User list accessed');
// ...
}
}Use the ApiResponse helper for consistent JSON output.
use Coff\Framework\Http\ApiResponse;
public function index() {
return ApiResponse::success(['id' => 1, 'name' => 'John Doe']);
}The framework maintains backward compatibility with the old ?path=Page routing style, ensuring your existing modules continue to work while you migrate to the new structure.
- Performance: Coff is significantly lighter and faster for small-to-medium projects and microservices.
- Simplicity: No complex facades or magic methods; just pure, understandable PHP.
- Flexibility: Coff provides a minimal structure, giving you total freedom over your architecture.
- Learning Curve: You can understand the entire core code in an afternoon.
Have questions or need support? Feel free to reach out!
- Name: Ubden Developer Community (coff.dev)
- Email: [email protected]
For more details, visit our website or open an issue on our GitHub page.