Download the PHP package mardev/starter-kit without Composer

On this page you can find all versions of the php package mardev/starter-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package starter-kit

![Version](https://img.shields.io/badge/version-1.1.4-4F46E5?style=for-the-badge) ![PHP](https://img.shields.io/badge/PHP-8.0+-777BB4?style=for-the-badge&logo=php&logoColor=white) ![MySQL](https://img.shields.io/badge/MySQL-5.7+-4479A1?style=for-the-badge&logo=mysql&logoColor=white) ![TailwindCSS](https://img.shields.io/badge/Tailwind_CSS-3.x-06B6D4?style=for-the-badge&logo=tailwindcss&logoColor=white) ![Alpine.js](https://img.shields.io/badge/Alpine.js-3.x-8BC0D0?style=for-the-badge&logo=alpine.js&logoColor=white) ![jQuery](https://img.shields.io/badge/jQuery-3.7.1-0769AD?style=for-the-badge&logo=jquery&logoColor=white) ![REST API](https://img.shields.io/badge/REST_API-JSON-FF6B6B?style=for-the-badge&logo=postman&logoColor=white) ![PHPUnit](https://img.shields.io/badge/PHPUnit-11.x-3F9142?style=for-the-badge&logo=php&logoColor=white) ![Tests](https://img.shields.io/badge/tests-77%20passing-22C55E?style=for-the-badge) # πŸš€ Vanilla PHP MVC Starter Kit ### A clean PHP 8+ MVC boilerplate with a structured `js/` layer, split route files, super admin + admin panels, session auth with live password strength validation, role-based routing, OAuth (Google + GitHub), flash toast system, AJAX fetch helpers, Alpine.js reactive UI, Tailwind CSS, and PHPUnit β€” zero frameworks, zero fluff. [⭐ Star on GitHub](https://github.com/rodrigomarcelo643/php-vanilla-mvc-starterkit) Β· [πŸ“– Docs](#️-installation) Β· [πŸ§ͺ Tests](#-testing)

πŸ“Œ About

Vanilla PHP MVC Starter Kit is a lightweight, zero-framework boilerplate for developers who want a clean starting point without the overhead of Laravel or Symfony. Built on pure PHP 8+, it ships with a hand-rolled MVC architecture, session-based authentication, role-based routing, and a full admin panel β€” all wired up and ready to go.

The frontend uses Tailwind CSS and Alpine.js via CDN, so there's no build pipeline to configure. AJAX helpers, avatar uploads, password reset flow, and a responsive multi-panel layout (super admin, admin, app, client) are included out of the box.

Backed by PHPUnit with 77 tests across unit and feature suites, GitHub Actions workflows for linting, quality checks, and deployment, and a single SQL file to get your database running in minutes.

Start building in minutes, not hours.

What's included


πŸ€” Why This Over Laravel?

This starter kit is intentionally built without Laravel β€” and that's the point.

πŸŽ“ Built for Students

If you are learning PHP for the first time or studying MVC architecture, Laravel's abstractions (Eloquent, Facades, Service Containers) can hide what's actually happening under the hood. This kit exposes everything β€” the router, the auth system, the database layer β€” in plain, readable PHP so you can see exactly how it works.

Start here. Understand MVC fundamentals. Then move to Laravel with confidence.

🏒 Built for Small to Medium Projects

Not every project needs the full weight of a framework. This kit is:

πŸš€ A Natural Laravel On-ramp

This Kit Laravel Equivalent
Router::get() Route::get()
php kit make:controller php artisan make:controller
php kit db:seed php artisan db:seed
php kit migrate php artisan migrate
.env config .env config
Middleware classes Middleware classes
MVC structure MVC structure

The patterns here are intentionally Laravel-inspired β€” so once you understand this kit, transitioning to Laravel feels familiar, not foreign.

⚑ When to Use This vs Laravel

Scenario Use This Kit Use Laravel
Learning MVC from scratch βœ… ❌ Too much magic
Small business site / portfolio βœ… βœ…
Shared hosting (cPanel) βœ… ⚠️ Can be tricky
Large enterprise SaaS ⚠️ βœ…
Understanding routing internals βœ… ❌ Hidden behind framework
Rapid API with auth/queues/etc ⚠️ βœ…

πŸ–ΌοΈ UI Visuals

**Home** ![Home](public/starter_home.png) **Sign In** ![Sign In](public/starter_login.png) **Sign Up** ![Sign Up](public/starter_signup.png) **Forgot Password** ![Forgot Password](public/starter_forgot_password.png) **Admin Dashboard** ![Admin Dashboard](public/starter_admin.png) **User Panel** ![User Panel](public/starter_user.png)

See the full visual walkthrough in VISUALS.md


πŸ“ Project Structure


βš™οΈ Installation

Requirements

Steps

1. Create the project via Composer

Place it inside your server's web root (e.g., htdocs/ or www/). Composer will automatically download the kit, install all vendor dependencies, and trigger the interactive setup wizard automatically.

3. Set up the database

4. Configure environment

Edit .env with your values:

5. Visit the app

Default Credentials

Role Email Password
Super Admin [email protected] password
Admin [email protected] password
User [email protected] password

🧩 Installer Presets

When you run composer install, the setup wizard automatically launches and asks you to pick an installation mode:

Option 1 β€” Full Stack (Alpine.js + AJAX Monolith) (default)

The classic MVC full stack mode. All views are rendered server-side. AJAX calls use the /ajax/ route prefix and return JSON. The /api/ routes are also registered and available for external consumers alongside the HTML interface.

Option 2 β€” REST API (Full Stack with JS)

Identical to Option 1 but injects the smart Controller which auto-detects /api/ prefixed requests and switches them to JSON output mode. All HTML views remain intact. The frontend JS layer drives data via /api/ fetch calls.

Option 3 β€” Backend Only (REST API, No UI)

Pure JSON API mode. All frontend assets (views, JS, CSS, client routes) are removed. Every request returns JSON. Use this when building a decoupled frontend (React, Vue, mobile app) that communicates with this backend via the /api/ endpoints.

Option 4 β€” jQuery Stack (Full Stack with jQuery AJAX)

Full stack traditional monolith mode leveraging jQuery instead of Alpine.js for interactive views and AJAX forms. The installer automatically downloads and incorporates the dynamic jQuery libraries.

Comparison

Feature Option 1 Option 2 Option 3 Option 4
HTML Views βœ… βœ… ❌ βœ…
Session Auth (Browser) βœ… βœ… βœ… βœ…
/ajax/ AJAX endpoints βœ… βœ… ❌ βœ…
/api/ REST endpoints (JSON) βœ… βœ… βœ… βœ…
Smart JSON/HTML auto-switch ❌ βœ… βœ… ❌
Root / returns HTML βœ… βœ… ❌ βœ…
Root / returns JSON ❌ ❌ βœ… ❌
Primary Frontend Driver Alpine.js Alpine.js N/A jQuery

You can re-run the installer at any time with: php kit env:setup


πŸ› οΈ Kit CLI Developer Tool

The starter kit comes with Kit (a custom PHP command-line interface helper) to streamline database setup, route inspection, scaffolding, cache management, and server management.

You can run commands using:

Available Commands

πŸ—„οΈ Database Management

πŸ—οΈ Code Scaffolding

πŸ—ΊοΈ Routing

πŸ’» System & Development Utilities

βš™οΈ Environment & Routing Intelligence


πŸ—ΊοΈ Routes Overview

File Prefix Description
client/pages.php / Public pages (home, about, blog…)
superadmin/pages.php superadmin/ Super admin dashboard, admins, users
superadmin/ajax.php ajax/admins/ Admin CRUD AJAX endpoints
admin/pages.php admin/ Admin dashboard, users, settings
app/pages.php app/ Authenticated user pages
auth/ajax.php ajax/ Login, register + AJAX endpoints
auth/oauth.php oauth/ Google + GitHub OAuth redirect/callback
routes/api.php api/ Unified REST API β€” JSON-only endpoints for all roles

πŸ”„ Dynamic Routing Behavior by Preset Option

The active installation preset dynamically alters how routing and request handling are structured:

πŸ›£οΈ Routing Architecture: AJAX vs. REST API vs. jQuery

Depending on the chosen installation preset, routing matches one of three distinct endpoint protocols:

1. Standard AJAX Routes (/ajax/*)

Used in Option 1 (Full Stack). These routes are designed for the monolith's frontend and return JSON.

2. REST API Routes (/api/*)

Universal endpoints returned in JSON. Under Option 3 (Backend Only), these are the only routes loaded. Under Option 2, they auto-switch dynamically.

3. jQuery Stack Routes (/jquery/*)

Active in Option 4 (jQuery Stack). This rewrites the monolith's entire route and controller layers to use jQuery standard interfaces.


REST API Endpoints (routes/api.php)

All /api/ routes return JSON only, regardless of installation mode.

Method Endpoint Description
GET /api/ping Health check
GET /api API info + endpoint list
POST /api/auth/login Login
POST /api/auth/register Register
POST /api/auth/logout Logout
POST /api/auth/forgot-password Request password reset
POST /api/auth/reset-password Complete password reset
GET /api/admin/users Get all users (admin)
POST /api/admin/users Create user (admin)
POST /api/admin/users/update Update user (admin)
POST /api/admin/users/delete Delete user (admin)
GET /api/admin/dashboard Admin dashboard stats
GET /api/superadmin/admins Get all admins (superadmin)
POST /api/superadmin/admins Create admin (superadmin)
POST /api/superadmin/admins/update Update admin (superadmin)
POST /api/superadmin/admins/delete Delete admin (superadmin)
GET /api/superadmin/users Get all users (superadmin)
GET /api/superadmin/dashboard Superadmin dashboard stats
GET /api/profile Get current user profile
POST /api/profile/avatar Upload avatar
POST /api/profile/update Update profile
POST /api/profile/change-password Change password
GET /api/app/home Authenticated user home data

πŸ‘‘ Super Admin Panel

The super admin is the highest-privilege role in the system. It has its own dedicated panel at /superadmin/dashboard with a purple-accented UI to distinguish it from the regular admin panel.

What super admin can do

Database table

Super admins are stored in a dedicated super_admins table, separate from both users and admins.

New files added

Modified files

File Change
app/core/Controller.php Added superadmin() layout method
app/core/Router.php Added app/controllers/superadmin/ to auto-discovery
app/models/Admin.php Added update(), delete(), adminCreate() methods
app/controllers/auth/AuthController.php Login checks super_admins table, redirects to /superadmin/dashboard
app/controllers/auth/ProfileController.php Avatar upload, profile update, and password change support superadmin role
app/controllers/admin/UserController.php Guard allows both admin and superadmin roles
routes/web.php Loads super admin page + AJAX route files
database/starter.sql Added super_admins table + seed account

πŸ” OAuth Login

Google and GitHub OAuth are wired up and ready β€” just add credentials to .env to activate.

Flow

  1. User clicks Google or GitHub on login or register page
  2. Redirected to provider β†’ user authenticates
  3. Existing email β†’ logged in directly, flash toast shown, redirect to dashboard
  4. New email β†’ redirected to /register with name + email auto-filled and locked, user only sets a password
  5. On register submit β†’ OAuth prefill cleared from session

Setup

Add to .env:

πŸ”” Flash Toast System

Session::flash() stores a one-time message that fires as a toast on the next page load. All layout footers (auth, app, admin, superadmin) read and display it automatically.

The toast renders bottom-right with a gradient background, progress bar, and auto-dismisses after 4 seconds.


The project uses PHPUnit 11 with 77 tests and 98 assertions across two suites.

Suite Tests Needs DB
Unit 32 No
Feature 45 Yes
Total 77 β€”

Running tests

Or via Composer:

Feature tests hit the real database. Make sure your .env credentials are correct and database/starter.sql has been imported before running the feature suite. Test data is created and cleaned up automatically β€” no permanent records are left behind.


βš™οΈ GitHub Workflows

All workflows live in .github/workflows/ and are inactive by default β€” they only run when manually triggered via Actions β†’ Run workflow. Uncomment the push/pull_request triggers inside each file to activate them.

File Purpose Activate on
php-lint.yml Syntax-checks every .php file with php -l push / PR
php-quality.yml PHPMD mess detection + PHPCS PSR-12 style check on app/ push / PR
secret-scan.yml Gitleaks scan for hardcoded credentials and API keys push / PR
sql-validate.yml Imports database/starter.sql into MySQL and verifies all tables SQL file changes
deploy.yml rsync deploy to remote server over SSH push to main

Enabling a workflow

  1. Open the workflow file in .github/workflows/
  2. Uncomment the push / pull_request block under on:
  3. Commit and push β€” GitHub Actions picks it up automatically

Deploy secrets

Before enabling deploy.yml, add these in Settings β†’ Secrets β†’ Actions:

Secret Value
SSH_HOST Server IP or hostname
SSH_USER SSH username
SSH_PRIVATE_KEY Contents of your id_rsa private key
DEPLOY_PATH Absolute path on server e.g. /var/www/html/project

πŸ€– Agent Context (AI Coding Assistant)

This project ships with ready-made context files for AI coding assistants so they understand the architecture, conventions, and patterns without you having to explain them every time.

πŸ“ˆ Star History

[![Star History Chart](https://api.star-history.com/svg?repos=rodrigomarcelo643/vanilla-php-mvc-starterkit&type=Date)](https://star-history.com/#rodrigomarcelo643/vanilla-php-mvc-starterkit&Date)

πŸ“„ License

This project is open-source software licensed under the MIT License. Created and maintained by Marcelo Rodrigo (MarDev) - Software Developer.

You are free to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, subject to the conditions outlined in the LICENSE file.


**Developed by [MarDev](https://github.com/rodrigomarcelo643) β€” Software Developer**

All versions of starter-kit with dependencies

PHP Build Version
Package Version
Requires phpmailer/phpmailer Version ^7.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mardev/starter-kit contains the following files

Loading the files please wait ...