vetalforge/jumpix-app

Starter application for the Jumpix PHP framework

Maintainers

Package info

github.com/vetalforge/jumpix-app

Type:project

pkg:composer/vetalforge/jumpix-app

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-06-04 17:30 UTC

This package is auto-updated.

Last update: 2026-06-04 17:30:41 UTC


README

Jumpix App is a starter application for the Jumpix PHP framework. It gives you a ready MVC project structure with routing, controllers, views, database examples, and DI configuration already wired together.

Features

  • MVC application structure
  • Ready public/index.php entry point
  • Route definitions in config/routes.php
  • Dependency injection bindings in config/dependencies.php
  • Native Active Record model example
  • Doctrine entity example
  • Template engine example
  • Custom 404 and error pages

Requirements

  • PHP 8.1 or higher
  • Composer
  • MySQL or MariaDB
  • Apache with mod_rewrite enabled

Installation

Create a project from this repository:

composer create-project vetalforge/jumpix-app my-app

Or clone it manually:

git clone https://github.com/vetalforge/jumpix-app.git my-app
cd my-app
composer install

Configuration

Main application settings are in config/app.php.

Important values:

define('HOST', env_value('HOST', 'http://localhost'));
define('DOMAIN_ADDITION', env_value('DOMAIN_ADDITION', '/jumpix-app'));
define('DB_HOST', env_value('DB_HOST', 'localhost'));
define('DB_USER', env_value('DB_USER', 'root'));
define('DB_PASS', env_value('DB_PASS', ''));
define('DB_NAME', env_value('DB_NAME', 'framework_test'));
define('ORM_DRIVER', env_value('ORM_DRIVER', 'native'));

Use ORM_DRIVER=native for the built-in model layer, or ORM_DRIVER=doctrine for Doctrine repositories.

Structure

app/
  Controllers/   Application controllers
  Entities/      Doctrine entities
  Models/        Native Active Record models
config/
  app.php        Application constants and environment values
  dependencies.php
  routes.php
database/        SQL files and seeder script
public/          Web root
resources/       Views and frontend assets

The framework code itself is installed through Composer as vetalforge/jumpix and uses the Jumpix\ namespace. Your application code stays in the App\ namespace.

Routing

Routes are defined in config/routes.php:

use App\Controllers\MainPageController;
use App\Controllers\DemoController;

return [
    '/' => [
        'controller' => MainPageController::class,
        'action' => 'index',
    ],
    '/usage' => [
        'controller' => DemoController::class,
        'action' => 'index',
    ],
];

Controllers

Controllers live in app/Controllers and can use framework services from the Jumpix\ namespace:

namespace App\Controllers;

use Jumpix\Http\Request;
use Jumpix\Http\Session;

class MainPageController extends Controller
{
    public function __construct(Request $request, Session $session)
    {
        parent::__construct($request, $session);
    }

    public function index(): void
    {
        $this->render('main_page');
    }
}

Models

Native models live in app/Models and extend the framework base model:

namespace App\Models;

use Jumpix\Models\Model;

class User extends Model
{
    protected string $table = 'users';
}

Example usage:

use App\Models\User;

$users = User::all();
$user = User::find(1);

$user = User::create([
    'name' => 'John Doe',
    'email' => 'john@example.test',
]);

$user->name = 'John Updated';
$user->save();
$user->delete();

Database Seeder

The example SQL files are in database/. Run the seeder from the project root:

php database/seeder.php

Views

Views are stored in resources/views and rendered from controllers:

$this->render('header', ['home' => HOST . DOMAIN_ADDITION]);
$this->render('main_page');
$this->render('footer');

Template Engine

Jumpix also includes a template engine supporting variables, loops, and conditionals.

Example template resources/views/template_engine_example.php:

<h1>{{ title }}</h1>
<p>{{ text1 }}</p>

@if($user)
<p>Welcome, {{ user }}</p>
@else
<p>Please log in.</p>
@endif

<ul>
    @foreach($items as $item)
    <li>{{ item }}</li>
    @endforeach
</ul>

Dependency Injection

All classes that should be injected are registered inside app/Container/Dependencies.php.

Error Handling

Custom error pages are supported, including a styled 404 Page Not Found.

License

MIT License.