Code Monkey home page Code Monkey logo

slim-skeleton-1's Introduction

Web Service Scaffolding

Purpose

The aim of this repository is to provide a solid foundation for building a web service with Slim 3 (repo) using modern practices and to provide examples on how you might use some of it's functionality. To that end, some example routes and controllers are provided, as well as a basic logger and APC/APCu cache provided by Stash. Testing is provided by Codeception.

Installation

Via composer:

composer create-project edhaase/slim-skeleton [destination].

Via git:

  • Clone this repo
  • Run composer install
  • Run composer bootstrap or composer run-script post-create-project-cmd
  • Enjoy!

Regarding the autoloader

This project uses PSR-4 autoloading. See composer.json for the mappings. If you change them, you'll have to rebuild the autoloader. You can do this by running composer dump-autoload --optimize.

Structure

docs/   - PHPDoc output
logs/   - Log output
public/ - Site configuration entry point limits what we expose
tests/  - Codeception tests
src/
    Controller/ - Route controllers
    Model/      - Data models
    Service/    - Service providers
    app.php     - Primary application
    routes.php  - Route creation 
vendor/ - Composer install directory
config.example.php  - Example application config constants

    

Documentation

Documentation can be generated using phpDocumentor.

Tests

composer test

Code standards

This project adheres to the PSR-2 coding style.

Scripts

We've also provided some scripts through composer to make life easier.

composer
        codecept  - shortcut to codecept
        test      - alias for codecept run
        cs        - alias for "phpcs --standard=PSR2 src/",
        cbf       - alias for "phpcbf --standard=PSR2 src/",
        serve     - starts test server
        bootstrap - alias to @post-create-project-cmd

slim-skeleton-1's People

Contributors

edhaase avatar

Watchers

Rob Allen avatar James Cloos avatar  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.