This is working standard PHP restfull API setup application with routing system and user Authentication
Frontend --> React JS
Hi, I am Lesly Chuo. Checking out this PHP Development Stack challenge.
This is working standard PHP restfull API setup application with routing system. It serves data in a Javascript Object Notation (JSON) format which could easily be integrated in any application. Object Oriented Programming with namespace system is highly in use includeing features such as.
Using PHP namespace system to organize an import class object into API.php page for further validation
// Importing Class Obj
use App\Config\Router;
// use App\Config\ErrorHandler;
use App\Controllers\ProductController;
use App\Controllers\CategoryController;
use App\Controllers\UserController;
use App\Config\CustomErrorValidator;
Object Oriented Programming provides a variety of methods and approach to resolve a coding procedue. Making use of PHP associative arrays and call_user custom fuctions make this process quite interesting..
// Sample Rout Display
$routes = array(
// Products
"GET@/api/products/books" => [ProductController::class, 'index'],
"DELETE@/api/products/books" => [ProductController::class, 'delete'], // delete_key, auth_key
"POST@/api/category/books" => [CategoryController::class, 'update'], // key, name, author, is_read
"POST@/api/create/category" => [CategoryController::class, 'create'], // name, author
// User
"POST@/api/user/signup" => [UserController::class, 'signup'], // signup user data
"POST@/api/user/login" => [UserController::class, 'login'], // login user data
/* ... */
);
Here we get a route mapped to a controller class pointing to a specific method in execution.
Custom errors and exception handling to catch customize and return errors or exceptions when need be
Full featured user signup/login registration system with token authentication
User data control, profile, create products and category pages
Development still in progress... I will be updating promply
- Portfolio - @Lesly, Dev_lee
-
Twitter - @ankain-lesly
-
Linkedin - @ankain-lesly
-
Whatsapp - +237 670710480
Complete rest API using pure objecti oriented PHP w