Download the PHP package maurobonfietti/rest-api-slim-php without Composer
On this page you can find all versions of the php package maurobonfietti/rest-api-slim-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maurobonfietti/rest-api-slim-php
More information about maurobonfietti/rest-api-slim-php
Files in maurobonfietti/rest-api-slim-php
Package rest-api-slim-php
Short Description Example of REST API with Slim PHP Framework.
License MIT
Homepage https://github.com/maurobonfietti/rest-api-slim-php
Informations about the package rest-api-slim-php
REST API IN SLIM PHP
This is an example of a RESTful API built using the Slim PHP micro-framework.
The API allows you to manage resources such as users, tasks, and notes.
You can also read this README IN SPANISH.
đĨī¸ TECHNOLOGIES USED:
The leading technologies used in this project are:
- PHP 8
- Slim 3
- MySQL
- Redis
- dotenv
- PHPUnit
- JSON Web Tokens (JWT)
Additional tools:
Also, I use other additional tools like:
- Docker & Docker Compose
- Travis CI
- Swagger
- Code Climate
- Scrutinizer
- Sonar Cloud
- PHPStan
- PHP Insights
- Heroku
- CORS
âī¸ QUICK INSTALL:
Requirements:
- Git
- Composer
- PHP >= 8.0
- MySQL/MariaDB
- Redis (Optional)
- or Docker
With Composer:
You can create a new project running the following commands:
With Git:
In your terminal, execute these commands:
With Docker:
You can use this project using docker and docker-compose.
Minimal Docker Version:
- Engine: 18.03+
- Compose: 1.21+
Commands:
đ ī¸ TROUBLESHOOTING:
If you get stuck, you can try this guide step by step.
đĻ TUTORIALS:
Watch this mini-series of videos about Slim PHP (Spanish Audio :sound: :es: :argentina:).
:video_camera: VIDEO #1
How to install and configure this API.
:movie_camera: VIDEO #2
How to use JWT for Authentication.
:video_camera: VIDEO #3
:movie_camera: VIDEO #4
đĻ DEPENDENCIES:
LIST OF REQUIRE DEPENDENCIES:
- slim/slim: Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
- respect/validation: The most awesome validation engine ever created for PHP.
- palanik/corsslim: Cross-origin resource sharing (CORS) middleware for PHP Slim.
- vlucas/phpdotenv: Loads environment variables from
.env
togetenv()
,$_ENV
and$_SERVER
automagically. - predis/predis: Flexible and feature-complete Redis client for PHP and HHVM.
- firebase/php-jwt: A simple library to encode and decode JSON Web Tokens (JWT) in PHP.
LIST OF DEVELOPMENT DEPENDENCIES:
- phpunit/phpunit: The PHP Unit Testing framework.
- phpstan/phpstan: PHPStan - PHP Static Analysis Tool.
- pestphp/pest: Pest is an elegant PHP Testing Framework with a focus on simplicity.
- nunomaduro/phpinsights: Instant PHP quality checks from your console.
- vimeo/psalm: A static analysis tool for finding errors in PHP applications.
- rector/rector: Instant Upgrades and Instant Refactoring of any PHP 5.3+ code.
đĨ TESTING:
Run all PHPUnit tests with composer test
.
đ¸ SCREENSHOOTS:
đ DOCUMENTATION:
ENDPOINTS:
INFO:
-
Help:
GET /
- Status:
GET /status
USERS:
-
Login User:
POST /login
-
Create User:
POST /api/v1/users
-
Update User:
PUT /api/v1/users/{id}
- Delete User:
DELETE /api/v1/users/{id}
TASKS:
-
Get All Tasks:
GET /api/v1/tasks
-
Get One Task:
GET /api/v1/tasks/{id}
-
Create Task:
POST /api/v1/tasks
-
Update Task:
PUT /api/v1/tasks/{id}
- Delete Task:
DELETE /api/v1/tasks/{id}
NOTES:
-
Get All Notes:
GET /api/v1/notes
-
Get One Note:
GET /api/v1/notes/{id}
-
Create Note:
POST /api/v1/notes
-
Update Note:
PUT /api/v1/notes/{id}
- Delete Note:
DELETE /api/v1/notes/{id}
Also, you can see the API documentation with the complete list of endpoints.
IMPORT WITH POSTMAN:
All the API information is prepared for download and use as Postman collection: Import Collection.
đ DEPLOY:
You can deploy this API with Heroku.
âšī¸ MORE INFORMATION:
For more information about this project, check out my blog post: How to create a REST API using Slim PHP.
You can also look at the to-do list web app I developed using this API in Angular.
đŦ CONTRIBUTING:
If you would like to contribute to the project, please open an issue or submit a pull request. Contributions are always welcome!
:heart: DO YOU LIKE THE PROJECT?
You can support this project by inviting me a coffee :coffee: :yum: or giving a star to this repo :star: :sunglasses:.
:page_facing_up: LICENSE
The MIT License (MIT). Please see License File for more information.
All versions of rest-api-slim-php with dependencies
composer/composer Version ^2.0
firebase/php-jwt Version ^5.0
palanik/corsslim Version dev-slim3
predis/predis Version ^1.1
respect/validation Version ^1.1
slim/slim Version ^3.12.3
vlucas/phpdotenv Version ^5.1