maurobonfietti / slim4-api-skeleton

Useful skeleton for RESTful API development with PHP and Slim 4.
http://bit.ly/2nNNOZi
MIT License
132 stars 32 forks source link
api-skeleton mysql php rest-api slim slim-micro-framework

SLIM 4 - API SKELETON

Useful skeleton for RESTful API development, using Slim PHP micro-framework.

Software License Build Status Coverage Status Packagist Version

💻 TECHNOLOGIES USED:

The main technologies used in this project are:

⚙️ QUICK INSTALL:

Requirements:

With Composer:

You can create a new project running the following commands:

composer create-project maurobonfietti/slim4-api-skeleton [my-api-name]
cd [my-api-name]
composer test
composer start

Configure your connection to MySQL Server:

By default, the API uses a MySQL database.

You should check and edit this configuration in your .env file:

DB_HOST='127.0.0.1'
DB_NAME='yourMySqlDatabase'
DB_USER='yourMySqlUsername'
DB_PASS='yourMySqlPassword'
DB_PORT='3306'

With Docker:

If you like Docker, you can use this project with Docker and Docker Compose.

Minimal Docker Version:

Docker Commands:

# Create and start containers for the API.
docker-compose up -d --build

# Checkout the API.
curl http://localhost:8081

# Stop and remove containers.
docker-compose down

📦 DEPENDENCIES:

LIST OF REQUIRE DEPENDENCIES:

LIST OF DEVELOPMENT DEPENDENCIES:

🔖 ENDPOINTS:

BY DEFAULT:

📹 TUTORIAL:

Learn how to develop a RESTful API with PHP and Slim 4 by following this video [🎥 🔈 🇪🇸 🇦🇷]

https://user-images.githubusercontent.com/24535949/180607903-7efd2cfc-b1df-4ad6-8295-801585df3b83.mp4

:heart: SUPPORT THE PROJECT

If you would like to support this project, you can:

ko-fi

:sunglasses: AND THAT'S IT!

Now, go to build an excellent RESTful API.