Git Product home page Git Product logo

decoupled-app's Introduction

decoupled-app

A Decoupled Application in PHP: Putting the Pieces Together

This code was developed to demonstrate how to utilize existing modern programming patterns (such as, Dependency Injection, Dependency Container, REST services, Unit of Work, and Repository) to build a decoupled application in PHP. For more information, read the full article here: http://software-architecture-php.blogspot.com/2014/11/a-decoupled-application-in-php-putting.html

Prerequisites:

  1. MySQL (version 5.6.17)
  2. PHP (version 5.5.12)
  3. Apache (version 2.4.9)
  4. Composer

The versions above are the version that I used to run the application. It is highly likely that slightly older versions would work as well, I just haven't tested them.

Installation steps:

  1. Download the code from https://github.com/abdulla16/decoupled-app.
  2. Navigate to the root directory of the project (decoupled-app) and run command "composer install". This should download the project dependencies into the decoupled-app/vendor directory.
  3. Create a database called "decoupled_app".
  4. Create a database user (grant all permissions) with name "d_app_user" and password "123456". Note: you can change these settings as long as you change the information in decoupled-app/Container/bootstrap.php.
  5. Using the command prompt (or terminal), navigate to directory /Container and run the command "../vendor/bin/doctrine orm:schema-tool:create". This should create the user table under the decoupled_app database.
  6. Point your Apache server to the directory decoupled-app/Web.

That's it!

Now you can test adding a user:

  1. Launch the localhost/index.html page in your browser.

  2. Select the PUT request type.

  3. Enter service name: addUser.

  4. Enter JSON data: {"firstName": "First", "lastName": "Last", "userName": "username"}

  5. Click "Call Service". Now the new user should be created.

decoupled-app's People

Contributors

abdulla16 avatar

Stargazers

Pedro Koblitz avatar

Watchers

James Cloos avatar

decoupled-app's Issues

question?

i select the put method, and i got 405 error "Http 405 Method Not Allowed", What gives?

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.