PHPackages                             pawanmore/stackvel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. pawanmore/stackvel

ActiveProject[Framework](/categories/framework)

pawanmore/stackvel
==================

Minimal MVC. Maximum Control. A lightweight, secure PHP MVC framework.

1.0.3(9mo ago)13MITPHPPHP &gt;=8.0

Since Aug 6Pushed 9mo agoCompare

[ Source](https://github.com/pawan1793/stackvel)[ Packagist](https://packagist.org/packages/pawanmore/stackvel)[ RSS](/packages/pawanmore-stackvel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Stackvel Framework
==================

[](#stackvel-framework)

**Minimal MVC. Maximum Control.**

A lightweight, secure PHP MVC framework, designed to provide maximum developer control with minimal overhead.

🚀 Features
----------

[](#-features)

- **Lightweight &amp; Fast**: Minimal overhead, optimized for performance
- **Secure by Default**: Built with security best practices
- **Eloquent-style ORM**: PDO-based database operations with familiar syntax
- **Blade Templating**: Powerful template engine with layouts and components
- **Email Support**: PHPMailer integration for HTML emails
- **CLI Commands**: Console tools for development and maintenance
- **Cronjob Support**: Scheduled task execution
- **PSR-4 Autoloading**: Modern PHP standards compliance
- **Environment Configuration**: Flexible configuration management
- **Session Management**: Secure session handling with CSRF protection

📁 Project Structure
-------------------

[](#-project-structure)

```
Stackvel/
├── app/
│   ├── Controllers/     # Application controllers
│   └── Models/         # Eloquent-style models
├── core/               # Framework core components
│   ├── Application.php # Main application class
│   ├── Router.php      # URL routing system
│   ├── Database.php    # Database connectivity
│   ├── Model.php       # Base model class
│   ├── View.php        # Blade templating engine
│   ├── Mailer.php      # Email functionality
│   ├── Session.php     # Session management
│   └── Config.php      # Configuration management
├── routes/
│   └── web.php         # Web routes definition
├── resources/
│   └── views/          # Blade template files
├── public/
│   ├── index.php       # Application entry point
│   └── .htaccess       # Apache configuration
├── console/
│   └── Kernel.php      # CLI and cronjob support
├── config/             # Configuration files
├── composer.json       # Composer dependencies
├── console.php         # Console entry point
└── README.md           # This file

```

🛠 Installation
--------------

[](#-installation)

For detailed installation instructions, see [INSTALLATION.md](docs/INSTALLATION.md).

### Prerequisites

[](#prerequisites)

- PHP 8.0 or higher
- Composer
- MySQL/MariaDB (or other PDO-supported database)
- Apache/Nginx web server

### Quick Start

[](#quick-start)

#### Option 1: Using Composer Create-Project (Recommended)

[](#option-1-using-composer-create-project-recommended)

1. **Create a new project**

    ```
    composer create-project pawanmore/stackvel my-project
    cd my-project
    ```
2. **Configure environment**

    ```
    cp env.example .env
    # Edit .env with your database and mail settings
    ```
3. **Set up database**

    ```
    # Create your database
    # Update .env with database credentials
    ```
4. **Start development server**

    ```
    php console.php serve
    ```
5. **Visit your application**

    ```
    http://localhost:8000

    ```

#### Option 2: Manual Installation

[](#option-2-manual-installation)

1. **Clone the repository**

    ```
    git clone https://github.com/pawan1793/stackvel.git
    cd stackvel
    ```
2. **Install dependencies**

    ```
    composer install
    ```
3. **Configure environment**

    ```
    cp env.example .env
    # Edit .env with your database and mail settings
    ```
4. **Set up database**

    ```
    # Create your database
    # Update .env with database credentials
    ```
5. **Start development server**

    ```
    php console.php serve
    ```
6. **Visit your application**

    ```
    http://localhost:8000

    ```

⚙️ Configuration
----------------

[](#️-configuration)

### Environment Variables

[](#environment-variables)

Copy `env.example` to `.env` and configure:

```
# Application
APP_NAME=Stackvel
APP_ENV=development
APP_DEBUG=true
APP_URL=http://localhost
APP_TIMEZONE=UTC

# Database
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=stackvel
DB_USERNAME=root
DB_PASSWORD=

# Mail
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS=hello@example.com
MAIL_FROM_NAME=Stackvel
```

🛣 Routing
---------

[](#-routing)

Define routes in `routes/web.php`:

```
// Basic routes
$router->get('/', 'HomeController@index');
$router->post('/users', 'UserController@store');

// Route with parameters
$router->get('/users/{id}', 'UserController@show');

// Route groups
$router->group(['prefix' => 'admin', 'middleware' => ['AuthMiddleware']], function ($router) {
    $router->get('/', 'AdminController@dashboard');
});

// Closure-based routes
$router->get('/test', function () {
    return 'Hello from Stackvel!';
});
```

🎮 Controllers
-------------

[](#-controllers)

Create controllers in `app/Controllers/`:

```
