Skip to content

mjclavillas/mjd-core

Repository files navigation

📦 mjd-core

High-Performance PHP Framework with Dependency Injection

PHP License Build


📖 Overview

mjd-core is a minimalist, industrial-grade PHP framework designed for developers who value transparency, speed, and clean code. Built with a custom Dependency Injection container and a reflection-based Routing Engine, it eliminates framework bloat while providing the essential tools for modern web applications.


✨ Key Features

  • Reflection-Based DI: Automatic "Auto-Wiring" of controller dependencies.
  • 🛣️ Grouped Routing: Support for route prefixes, middleware pipelines, and API grouping.
  • 🏗️ Active Record ORM: Fluent database interactions and schema management.
  • 🛠️ MJDC Binary: A dedicated CLI assistant for scaffolding (Controllers, Models, Migrations).
  • 🎨 Twig Integration: Native support for Twig templates with custom session/auth extensions.
  • 💻 Interactive Console: Built-in API testing suite directly in the dashboard.

🏗️ Core Architecture

The framework follows a strict Request-Response pipeline:

  1. Entry Point: All traffic is funneled through public/index.php.
  2. Bootstrapping: Environment variables and Sessions are initialized.
  3. Routing: The Router resolves the URI and injects dependencies into the target Controller.
  4. Middleware: Requests pass through security layers (Auth, CSRF, etc.).
  5. Output: The Controller returns a View (HTML) or a JSON stream.

📂 Directory Structure

├── app/                # Application Logic
│   ├── Controllers/    # Request Handlers
│   ├── Models/         # Database Entities
│   └── Middleware/     # Security Layers
├── bootstrap/          # Framework Boot Logic
├── public/             # Web Root (index.php, Assets)
├── routes/             # Web & API Route Definitions
├── src/                # MJD-Core Engine (Framework Source)
├── storage/            # Logs, Cache, and File Uploads
└── views/              # Twig Templates

🛠️ Installation

1. Clone & Install

git clone https://github.com/mjclavillas/mjd-core.git
cd mjd-core
composer install

2. Environment Setup

cp .env.example .env

Update DB_DATABASE and APP_URL in your .env file

3. Database & Scaffolding

php mjdc migrate
php mjdc db:seed

4. Launch Server

php mjdc serve

⌨️ CLI Assistant (mjdc)

Command Description
serve [host] [port] Boots the PHP development server : Default localhost 8000
make:controller Generates a new Controller in app/Controllers
make:model Creates a Model and a Migration file
migrate Executes pending migrations
db:seed Populates tables with test data

📄 License

This project is open-sourced software licensed under the MIT License.

About

A minimalist, industrial-grade PHP framework designed for developers who value transparency, speed, and clean code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors