Giter Club home page Giter Club logo

crud-api-slim-4's Introduction

SLIM 4 - API SKELETON

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

Used technologies: PHP 8, Slim 4, MySQL, PHPUnit, dotenv, Docker & Docker Compose.

Software License Build Status Coverage Status Packagist Version

โš™๏ธ QUICK INSTALL:

Requirements:

  • Composer.
  • PHP >= 8.1
  • MySQL/MariaDB.
  • or Docker.

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 use 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:

  • Engine: 18.03+
  • Compose: 1.21+

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:

  • slim/slim: Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
  • slim/psr7: PSR-7 implementation for use with Slim 4.
  • pimple/pimple: A small PHP dependency injection container.
  • vlucas/phpdotenv: Loads environment variables from .env to getenv(), $_ENV and $_SERVER automagically.

LIST OF DEVELOPMENT DEPENDENCIES:

๐Ÿ”– ENDPOINTS:

BY DEFAULT:

  • Hello: GET /

  • Health Check: GET /status

๐Ÿ“น TUTORIAL:

Develop a RESTful API with PHP and Slim 4. [:movie_camera: :sound: :es: :argentina:]

Desarrollar.una.API.RESTful.con.PHP.y.Slim.4.mp4

โค๏ธ WOULD YOU LIKE TO SUPPORT THIS PROJECT?

You can support this project inviting me a coffee โ˜• ๐Ÿ˜‹ or giving a star to this repo โญ ๐Ÿ˜Š.

ko-fi

๐Ÿ˜Ž THAT'S IT!

Now go build a cool RESTful API.

crud-api-slim-4's People

Contributors

ulrichlegeni avatar

Watchers

Bamba avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.