{"id":33988220,"url":"https://github.com/iviphp/ivi","last_synced_at":"2025-12-13T05:54:40.719Z","repository":{"id":322448053,"uuid":"1089397721","full_name":"iviphp/ivi","owner":"iviphp","description":"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.","archived":false,"fork":false,"pushed_at":"2025-11-23T08:22:12.000Z","size":5516,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-23T10:10:51.193Z","etag":null,"topics":["api","caching","framework","lightweight","modular","orm","php","spa","websocket"],"latest_commit_sha":null,"homepage":"https://github.com/iviphp/ivi","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iviphp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support/ide-stubs.php","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-04T09:38:25.000Z","updated_at":"2025-11-23T08:22:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/iviphp/ivi","commit_stats":null,"previous_names":["iviphp/ivi"],"tags_count":59,"template":false,"template_full_name":null,"purl":"pkg:github/iviphp/ivi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iviphp%2Fivi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iviphp%2Fivi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iviphp%2Fivi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iviphp%2Fivi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iviphp","download_url":"https://codeload.github.com/iviphp/ivi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iviphp%2Fivi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27701187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-13T02:00:09.769Z","response_time":147,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","caching","framework","lightweight","modular","orm","php","spa","websocket"],"created_at":"2025-12-13T05:54:38.974Z","updated_at":"2025-12-13T05:54:40.710Z","avatar_url":"https://github.com/iviphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" style=\"margin:0;\"\u003e\n  \u003cimg \n    src=\"https://res.cloudinary.com/dwjbed2xb/image/upload/v1762524618/iviphp_jrpema.png\" \n    alt=\"Ivi.php Banner\" \n    width=\"100%\" \n    style=\"\n      display:block;\n      height:auto;\n      max-width:900px;\n      margin:auto;\n      object-fit:cover;\n      border-radius:8px;\n    \"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eIvi.php\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/PHP-8.2+-blue\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-green\"\u003e\n\u003c/p\u003e\n\n# 🟩 **Ivi.php** — Simple. Modern. Expressive.\n\n\u003e **“Code with clarity.”**  \n\u003e Ivi.php is a modern PHP framework built for developers who value simplicity, speed, and expressive code.  \n\u003e Its minimal core and clean structure make building APIs and web applications a joyful experience.\n\n---\n\n# 🚀 Getting Started\n\nWelcome to **Ivi.php** — a lightweight, modern framework designed to help you build fast and elegant PHP applications.\n\nThis guide will walk you through:\n\n- Bootstrapping a new project\n- Understanding the folder layout\n- Creating your first route, controller, and view\n- Connecting to a database with ease\n\n---\n\n## Requirements\n\n- PHP **8.2+**\n- PDO + driver (e.g. `pdo_mysql` or `pdo_sqlite`)\n- Composer\n- Recommended: `php -S localhost:8000 -t public` for local dev\n\n---\n\n## 1) Installation\n\n### A. Create a project\n\n```bash\ncomposer create-project iviphp/ivi my-app\ncd my-app\n```\n\n\u003e If you cloned the repo directly, run `composer install`.\n\n### B. Project structure (overview)\n\n```bash\n.\n├─ bootstrap/          # app boot strap \u0026 helpers\n├─ config/             # app, routes, database config\n├─ core/               # ivi.php framework core (Bootstrap, Http, ORM, ...)\n├─ public/             # web root (index.php)\n├─ src/                # your application code (Controllers, Models, ...)\n├─ views/              # PHP templates\n├─ scripts/            # migrations, seeds, dev scripts\n├─ docs/               # documentation\n└─ vendor/\n```\n\n---\n\n## 2) First Run\n\nServe the app:\n\n```bash\nphp -S localhost:8000 -t public\n```\n\nOpen: \u003chttp://localhost:8000\u003e\n\nYou should see the default page or a basic route response (see next section).\n\n---\n\n## 3) Routing\n\nRoutes are declared in `config/routes.php`.\n\n```php\n\u003c?php\n\nuse Ivi\\Router\\Router;\nuse App\\Controllers\\HomeController;\nuse App\\Controllers\\User\\UserController;\n\n/** @var Router $router */\n\n$router-\u003eget('/', function () {\n    return 'Hello ivi.php!';\n});\n\n$router-\u003eget('/users', [UserController::class, 'index']);\n$router-\u003eget('/users/{id}', [UserController::class, 'show']);\n```\n\n---\n\n## 4) Controllers\n\n```php\n\u003c?php\n\nnamespace App\\Controllers;\n\nuse Ivi\\Http\\Request;\nuse Ivi\\Http\\HtmlResponse;\n\nfinal class HomeController extends Controller\n{\n    public function index(Request $request): HtmlResponse\n    {\n        return $this-\u003eview('home', [\n            'title' =\u003e 'Welcome to ivi.php',\n            'message' =\u003e 'Fast \u0026 expressive.',\n        ], $request);\n    }\n}\n```\n\n---\n\n## 5) Views\n\n```php\n\u003c!-- views/home.php --\u003e\n\u003c?php $this-\u003elayout('base', ['title' =\u003e $title ?? 'ivi.php']); ?\u003e\n\n\u003csection class=\"section container\"\u003e\n  \u003ch1\u003e\u003c?= htmlspecialchars($title ?? 'Welcome') ?\u003e\u003c/h1\u003e\n  \u003cp\u003e\u003c?= htmlspecialchars($message ?? '') ?\u003e\u003c/p\u003e\n\u003c/section\u003e\n```\n\nLayout example:\n\n```php\n\u003c!-- views/base.php --\u003e\n\u003c!doctype html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"utf-8\"\u003e\n  \u003ctitle\u003e\u003c?= htmlspecialchars($title ?? 'ivi.php') ?\u003e\u003c/title\u003e\n  \u003clink href=\"\u003c?= asset('assets/css/app.css') ?\u003e\" rel=\"stylesheet\"\u003e\n  \u003c?= $styles ?? '' ?\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003cnav class=\"nav\"\u003e\u003ca href=\"/\"\u003eivi.php\u003c/a\u003e\u003c/nav\u003e\n  \u003cmain\u003e\u003c?= $this-\u003esection('content') ?\u003e\u003c/main\u003e\n  \u003c?= $scripts ?? '' ?\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n---\n\n## 6) Markdown Docs\n\n```php\n$router-\u003eget('/docs', [\\App\\Controllers\\Docs\\DocsController::class, 'index']);\n```\n\nView: `views/docs/page.php`\n\n```php\n\u003csection class=\"docs-hero\"\u003e\n  \u003cdiv class=\"container\"\u003e\n    \u003ch1\u003eDocumentation\u003c/h1\u003e\n    \u003cp class=\"lead\"\u003eBuild fast and expressive apps with \u003cstrong\u003eivi.php\u003c/strong\u003e.\u003c/p\u003e\n  \u003c/div\u003e\n\u003c/section\u003e\n\n\u003cmain class=\"docs-content container markdown-body\"\u003e\n  \u003c?= $content ?\u003e\n\u003c/main\u003e\n```\n\n---\n\n## 7) Environment \u0026 Config\n\n```ini\nAPP_ENV=local\nAPP_DEBUG=true\nDB_DRIVER=mysql\nDB_HOST=127.0.0.1\nDB_NAME=iviphp\nDB_USER=root\nDB_PASS=secret\n```\n\n```php\nreturn [\n  'default' =\u003e $_ENV['DB_DRIVER'] ?? 'mysql',\n  'connections' =\u003e [\n    'mysql' =\u003e [\n      'driver' =\u003e 'mysql',\n      'host' =\u003e $_ENV['DB_HOST'] ?? '127.0.0.1',\n      'database' =\u003e $_ENV['DB_NAME'] ?? 'iviphp',\n      'username' =\u003e $_ENV['DB_USER'] ?? 'root',\n      'password' =\u003e $_ENV['DB_PASS'] ?? '',\n    ],\n  ],\n];\n```\n\n---\n\n## 8) ORM Quickstart\n\n```php\n\u003c?php\n\nnamespace App\\Models;\n\nuse Ivi\\Core\\ORM\\Model;\n\nfinal class User extends Model\n{\n    protected string $table = 'users';\n}\n```\n\nUsage:\n\n```php\nuse App\\Models\\User;\n\n$user = User::create(['name' =\u003e 'Ada', 'email' =\u003e 'ada@example.com']);\n$found = User::find(1);\n$found-\u003eupdate(['name' =\u003e 'Ada Lovelace']);\n$found-\u003edelete();\n```\n\n---\n\n## 9) Migrations CLI\n\n```bash\nphp bin/ivi migrate\nphp bin/ivi migrate:status\nphp bin/ivi migrate:reset\n```\n\nExample SQL:\n\n```sql\nCREATE TABLE users (\n  id INT AUTO_INCREMENT PRIMARY KEY,\n  name VARCHAR(120),\n  email VARCHAR(190) UNIQUE\n);\n```\n\n---\n\n## 10) Validation\n\n```php\nuse Ivi\\Http\\Request;\nuse Ivi\\Validation\\Validator;\n\n$validator = Validator::make($request-\u003eall(), [\n  'name' =\u003e 'required|min:2|max:120',\n  'email' =\u003e 'required|email',\n]);\n\nif ($validator-\u003efails()) {\n  return response()-\u003ejson(['errors' =\u003e $validator-\u003eerrors()], 422);\n}\n```\n\n---\n\n## 11) Responses\n\n```php\nuse Ivi\\Http\\JsonResponse;\nuse Ivi\\Http\\HtmlResponse;\n\nreturn new JsonResponse(['ok' =\u003e true]);\nreturn new HtmlResponse('\u003ch1\u003eHello\u003c/h1\u003e');\n```\n\n---\n\n## 12) Production Tips\n\n- Set `APP_ENV=production`\n- Use `APP_DEBUG=false`\n- Configure opcache\n- Serve from `public/`\n- Minify assets\n\n---\n\nHappy building with **ivi.php** 🚀\n\n## ⚖️ License\n\nMIT License © 2025 [GaspardKirira Authors](https://github.com/GaspardKirira)  \nUse freely, modify openly, contribute boldly. 🚀\n# Test Packagist Hook\n- hook test Fri Nov  7 08:07:12 PM EAT 2025\n- packagist hook test\n- packagist hook test\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiviphp%2Fivi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiviphp%2Fivi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiviphp%2Fivi/lists"}