GithubHelp home page GithubHelp logo

odixon / slim4-soccer-api-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maurobonfietti/slim4-soccer-api-demo

0.0 1.0 0.0 55 KB

RESTful API demo that allow you to manage soccer teams and players.

Home Page: http://bit.ly/2nNNOZi

License: MIT License

PHP 86.66% TSQL 12.23% Dockerfile 1.11%

slim4-soccer-api-demo's Introduction

SLIM 4 - API SKELETON

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

Used technologies: PHP, Slim 4, MySQL, PHPUnit, env var, Docker & Docker Compose.

Software License

QUICK INSTALL:

Pre Requisite:

  • PHP.
  • Composer.
  • MySQL/MariaDB.

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 can check and edit this configuration in your .env file:

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

DOCKER READY:

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:

DOCUMENTATION:

DEFAULT ENDPOINTS:

  • Help: GET /

  • Status: GET /status

BUY ME A COFFEE :-)

Buy Me a Coffee at ko-fi.com

That's it!

Now go build a cool RESTful API ;-)

slim4-soccer-api-demo's People

Contributors

maurobonfietti avatar

Watchers

 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.