Skip to content

shimijallores/zen-framework

Repository files navigation

Zen - PHP Framework

Zen is a lightweight PHP framework designed for building web applications with an MVC architecture. It includes built-in routing, dependency injection, authentication, validation, and session management.

Features

  • MVC Architecture: Organized structure with Models, Views, and Controllers.
  • Routing: Simple and flexible routing system with middleware support.
  • Dependency Injection: Container-based DI for managing dependencies.
  • Database: PDO-based database abstraction for MySQL.
  • Authentication: Built-in login, register, and logout functionality with role-based access.
  • Validation: Form validation with error handling and flashing.
  • Sessions: Session management with flash messages.
  • Styling: Integrated with Tailwind CSS for modern UI.

Installation

  1. Clone the repository:

    git clone https://github.com/shimijallores/zen.git
    cd zen
  2. Install PHP dependencies:

    composer install
  3. Install Node.js dependencies (for Tailwind CSS):

    npm install
  4. Set up environment variables:

    • Copy .env.example to .env and configure your database settings.
  5. Set up the database:

    • Create a MySQL database.
    • Run the SQL schema from database/database.sql (if provided).
  6. Start the development server:

    php -S localhost:8000 -t public
  7. Build CSS (in a separate terminal):

    npm run dev

Usage

  • Access the application at http://localhost:8000.
  • Default route redirects to /airlines.
  • Admin routes require authentication.
  • Use the provided controllers and models as examples to build your application.

Project Structure

  • Core/: Framework core classes (App, Database, Router, etc.)
  • Http/controllers/: Application controllers
  • Http/models/: Data models
  • Http/views/: View templates
  • Http/Services/: Service classes
  • database/: Database schema and migrations
  • public/: Public assets (CSS, JS, images)
  • routes.php: Route definitions
  • config.php: Configuration settings
  • bootstrap.php: Application bootstrap

Requirements

  • PHP 8.0+
  • MySQL
  • Composer
  • Node.js (for CSS compilation)

License

This project is licensed under the MIT License.

About

Zen is a light php framework used for quick scaffolding of PHP systems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages