restjs/rest-api

RESTful API Boilerplate with OOP & MVC Pattern

3.0.0 2025-07-07 06:35 UTC

This package is auto-updated.

Last update: 2025-07-07 06:37:55 UTC


README

Latest Stable Version License PHP Version Require

A minimalist, framework-free PHP RESTful API boilerplate you can fork to rapidly build your own CRUD endpoints backend by MySQL.

Installation

It's recommended that you use Composer to install Rest API.

composer create-project restjs/rest-api

This will install Rest API and all required dependencies. It requires PHP 8.2 or newer.

Folder Structure

├─── src
│     ├─── Api                                              # API Endpoint Folder
│     │     └─── [Slug]                                     # Route Folder
│     │             ├─── [Slug].php                         # Entity File
│     │             ├─── Controller.php                     # Controllers File
│     │             ├─── Model.php                          # Models File
│     │             └─── Router.php                         # Routes File
│     │
│     ├─── Middleware                                       # Middleware Folder
│     │     └─── Authorization.php                          # Authorization Middleware File
│     └─── function.php                                     # All External Functions file
│
├─── index.php                                              # Application Execute File 
├─── .env                                                   # Environment Variable File 
├─── .gitignore
├─── .htaccess 
├─── composer.json 
└─── README.md 

You may quickly test this using the built-in PHP server:

composer start

Going to http://localhost:8888/api/.

License

MIT License. © 2025 FullStackOnDemand