iviphp / ivi
Ivi.php is a fast, lightweight, and modular PHP framework with expressive routing, built-in ORM, caching, and WebSocket support—ideal for modern APIs and SPAs.
v1.6.1
2026-04-23 19:32 UTC
Requires
- php: >=8.1
- ext-json: *
- cloudinary/cloudinary_php: ^2
- erusev/parsedown: ^1.7
- firebase/php-jwt: ^6.11
- google/apiclient: ^2.15
- predis/predis: ^3.0
- symfony/var-dumper: ^7.0
- vlucas/phpdotenv: ^5.6
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpunit/phpunit: ^10.0
- dev-main
- v1.6.1
- v1.6.0
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.18
- v1.4.17
- v1.4.16
- v1.4.15
- v1.4.14
- v1.4.13
- v1.4.12
- v1.4.11
- v1.4.10
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.8.0
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-dev
This package is auto-updated.
Last update: 2026-04-23 19:34:40 UTC
README
Overview
Ivi.php is a modern PHP framework designed for building APIs and web applications with clarity and control.
It provides a minimal core with a consistent architecture, allowing developers to build production-ready systems without unnecessary complexity.
The framework focuses on:
- predictable structure
- explicit behavior
- fast development cycles
- real-world features out of the box
Installation
composer create-project iviphp/ivi my-app
cd my-app
Run the application:
ivi serve
Quick Example
use Ivi\Core\Bootstrap\App; use Ivi\Http\Request; $app = new App(__DIR__); $app->router->get('/', fn() => ['hello' => 'ivi.php']); $app->router->post('/echo', fn(Request $req) => [ 'you_sent' => $req->json() ]); $app->run();
Routing
$app->router->get('/users', fn() => ['users' => []]); $app->router->get('/user/{name}', function (array $params) { return ['name' => $params['name']]; });
Request Handling
$app->router->post('/data', function (Request $req) { return [ 'json' => $req->json(), 'all' => $req->all() ]; });
Views
use Ivi\Core\View\View; $app->router->get('/', function () { return View::make('home', [ 'title' => 'Welcome', 'message' => 'Ivi.php running' ]); });
Validation
use Ivi\Core\Validation\Validator; $input = [ 'email' => 'user@example.com', 'password' => 'secret123' ]; $validated = (new Validator($input, [ 'email' => 'required|email', 'password' => 'required|min:6' ]))->validate();
Update scenario:
$post = ['password' => '']; if (trim($post['password']) === '') { unset($post['password']); } $validated = (new Validator($post, [ 'password' => 'sometimes|min:6' ]))->validate();
ORM
Model
use Ivi\Core\ORM\Model; final class User extends Model { protected static array $fillable = ['name', 'email', 'password', 'active']; }
CRUD
$user = User::create([ 'name' => 'Alice', 'email' => 'alice@example.com' ]); $found = User::find(1); $found->fill(['name' => 'Updated'])->save(); $found->delete();
Query Builder
$users = User::query() ->where('status = ?', 'active') ->orderBy('id DESC') ->limit(5) ->get(); $count = User::query() ->where('status = ?', 'active') ->count();
Repository Pattern
use Ivi\Core\ORM\Repository; final class UserRepository extends Repository { protected function modelClass(): string { return User::class; } public function findByEmail(string $email): ?User { $row = User::query()->where('email = ?', $email)->first(); return $row ? new User($row) : null; } }
JWT Authentication
use Ivi\Core\Jwt\JWT; $jwt = new JWT(); $token = $jwt->generate([ 'sub' => 123 ], [ 'key' => 'secret', 'alg' => 'HS256', 'validity' => 3600 ]); $jwt->check($token, ['key' => 'secret']);
Logging
log_info("Application started"); log_error("Database error", "Database"); log_debug([ 'user_id' => 1 ], "Debugging");
Features:
- daily log rotation
- JSON support
- trace mode
- automatic log directory creation
Collections
$v = vector([1, 2, 3]); $v->push(4); $m = hashmap(['name' => 'Ivi']); $m->put('version', '1.0'); $s = hashset(['apple']); $s->add('banana'); $t = str(" hello ")->trim()->upper();
CLI
Ivi.php provides a built-in CLI for development and deployment.
Project
ivi new my-app
Database
ivi migrate ivi migrate:status ivi migrate:reset ivi seed
Modules
ivi make:module Blog ivi modules:publish-assets
Development
ivi serve
ivi test
ivi coverage
Deployment
ivi deploy
Project Structure
.
├── bootstrap/
├── config/
├── core/
├── public/
├── src/
├── views/
├── scripts/
├── docs/
└── vendor/
Configuration
Example .env:
APP_ENV=local APP_DEBUG=true DB_DRIVER=mysql DB_HOST=127.0.0.1 DB_NAME=iviphp DB_USER=root DB_PASS=secret
Philosophy
Ivi.php is built around a simple idea:
- keep the core minimal
- expose real capabilities
- avoid hidden magic
- favor explicit code over abstraction
Documentation
Download
git clone https://github.com/iviphp/ivi.git
cd ivi
composer install
License
10) Validation
use Ivi\Http\Request; use Ivi\Validation\Validator; $validator = Validator::make($request->all(), [ 'name' => 'required|min:2|max:120', 'email' => 'required|email', ]); if ($validator->fails()) { return response()->json(['errors' => $validator->errors()], 422); }
11) Responses
use Ivi\Http\JsonResponse; use Ivi\Http\HtmlResponse; return new JsonResponse(['ok' => true]); return new HtmlResponse('<h1>Hello</h1>');
12) Production Tips
- Set
APP_ENV=production - Use
APP_DEBUG=false - Configure opcache
- Serve from
public/ - Minify assets
Happy building with ivi.php 🚀
⚖️ License
MIT License © 2026 Gaspard Kirira