GithubHelp home page GithubHelp logo

pulse00 / symfony-chaplin-demo Goto Github PK

View Code? Open in Web Editor NEW
36.0 4.0 12.0 657 KB

Single-Page demo application written with Symfony and chaplin.js

License: MIT License

PHP 5.23% CoffeeScript 1.25% CSS 12.08% JavaScript 81.43%

symfony-chaplin-demo's Introduction

Symfony/chaplin.js single page app

This is a demo for a single page application implemented with Symfony as the REST backend and chaplin.js as the frontend.

This setup adds the following bundles to the standard-edition of Symfony:

The purpose of this app is to demonstrate the following concepts:

  • Providing a REST backend for a backbone.js / chaplin frontend
  • Securing the REST backend using oauth2 2-legged authentication
  • Reusing Symfony routes for the chaplin router to make full use of Symfonys environment concepts [prod/dev/etc]
  • Reusing serverside rendered markup from 3rd party bundles (e.g. FOSUserBundle login-form)
  • Provide SEO metadata for the initial page markup for public facing websites

Installation

  • curl -s https://getcomposer.org/installer | php && ./composer.phar install
  • php app/console doctrine:database:create
  • php app/console doctrine:schema:create
  • php app/console doctrine:fixtures:load
  • Create a virtualhost http://bookstore.local pointing the DocRoot to the web folder
  • Access http://bookstore.local.
  • Login with user chaplin password symfony

Vagrant

This demo comes with a vagrant/docker configuration which has everything pre-installed inside the vagrant directory.

If you have vagrant installed, simply run vagrant up and ssh into the box using vagrant ssh.

The application will be exposed on http://localhost:8888/app_dev.php.

From there you can obtain php / node shells through docker containers:

Docker

Containers

pulse00/nginx-php will run an nginx server with a php-fpm backend providing the environment for the symfony app.

pulse00/chaplinjs will run the brunch -w command after starting up vagrant.

PHP shell

sudo docker run -i -t -rm -link mysql:mysql -v /vagrant:/var/www -w /var/www -entrypoint='bash' pulse00/nginx-php -c 'bash'

Brunch shell

sudo docker run -i -t -rm -v /vagrant/client:/var/www -w /var/www -entrypoint='bash' pulse00/chaplinjs -c 'bash'

symfony-chaplin-demo's People

Contributors

cbourgois avatar dagrinchi avatar pulse00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

symfony-chaplin-demo's Issues

Can't Login

Hi,

I try to install this app and when I login, i got this message on login_check:

Class 'Acme\SPA\ApiBundle\Entity\OAuth2/Client' does not exists
500 Internal Server Error - MappingException

Exception in login

Hi!
I get an exception after login correctly

CRITICAL - Uncaught PHP Exception Symfony\Component\Debug\Exception\UndefinedMethodException: "Attempted to call method "updateToken" on class "Acme\SPA\ApiBundle\Entity\OAuth\AccessToken"." at /var/www/symfony-chaplin-demo/src/Acme/SPA/ChaplinBundle/Security/AuthenticationSuccessHandler.php line 58
Context: {"exception":"Object(Symfony\Component\Debug\Exception\UndefinedMethodException)"}

sorry for my english

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.