2017 © Pedro Peláez
 

project sammui

The Symfony AngularJS MongoDB Mobile UI Project - sammui

image

renatomefidf/sammui

The Symfony AngularJS MongoDB Mobile UI Project - sammui

  • Wednesday, June 3, 2015
  • by renatomefi
  • Repository
  • 1 Watchers
  • 8 Stars
  • 73 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

sammui

Join the chat at https://gitter.im/renatomefidf/sammui, (*1)

Build Status Code Climate Test Coverage Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

The Symfony Angular MongoDB Mobile UI Project, (*3)

Original project by @flyers: https://github.com/FlyersWeb/angular-symfony, (*4)

Mirror: http://gitlab.renatomefi.com.br/renatomefi/sammui/commits/master, (*5)

Introduction

This project is a template application with secured communication via a RestFul API between the client part with AngularJS and the server part with Symfony2., (*6)

In use libs and technologies

  • Symfony 2.6, (*7)

  • Doctrine MongoDB Bundle (doctrine/mongodb-odm-bundle) 3.0, (*8)

  • FOS Rest Bundle (friendsofsymfony/rest-bundle) 1.4, (*9)

  • FOS User Bundle (friendsofsymfony/user-bundle) 1.3.5, (*10)

  • Layout Mobile Angular UI - http://mobileangularui.com/, (*11)

JetBrains WebStorm

We are very happy to use WebStorm IDE., (*12)

Thanks JetBrains for giving us a license for Open Source Projects, (*13)

Build Status, (*14)

Automatic Installation

Master:, (*15)

composer create-project renatomefidf/sammui sammui dev-master

Any tag:, (*16)

composer create-project renatomefidf/sammui sammui v0.0.1

Check the composer package at: https://packagist.org/packages/renatomefidf/sammui, (*17)

Manual Installation

Clone the project :, (*18)

git clone git@github.com:renatomefidf/sammui sammui

Update packages :, (*19)

cd angular-symfony
composer.phar install

Configuration

Create cache and logs folders :, (*20)

mkdir app/cache
mkdir app/logs
chmod -R 777 app/cache
chmod -R 777 app/logs

Edit database credentials :, (*21)

vim app/config/parameters.yml

To switch between ORM and ODM (Database and MongoDB) uncomment/comment the following lines on config.yml :, (*22)

# FOS User Bundle for ORM
fos_user:
    db_driver: orm
    firewall_name: main
    user_class: Flyers\BackendBundle\Entity\User

# FOS User Bundle for MongoDB
fos_user:
    db_driver: mongodb
    firewall_name: main
    user_class: Flyers\BackendBundle\Document\User

Update schemas (FOSUserBundle) : * Not needed for MongoDB, (*23)

php app/console doctrine:schema:create

Create and activate user :, (*24)

php app/console fos:user:create
php app/console fos:user:activate

Link project to your webserver and access it :, (*25)

ln -snf ./ /var/www/html/angular-symfony
firefox http://localhost/angular-symfony/ &

Want to run it via nginx? There is a sample virtual host on docs/nginx, (*26)

Database

If you want to use my current dev database you can get it at /docs/mongo/DATE_dump I'm using mongodump tool, so it's easy to recover!, (*27)

Authentication system

The Authentication system is based on the custom Authentication Provider of the Symfony2 Cookbook : http://symfony.com/doc/2.1/cookbook/security/custom_authentication_provider.html, (*28)

The following chapter demonstrates how to create a custom authentication provider for WSSE authentication. The security protocol for WSSE provides several security benefits: * Username / Password encryption * Safe guarding against replay attacks * No web server configuration required, (*29)

WSSE is very useful for the securing of web services, may they be SOAP or REST., (*30)

I used the exact same authentication system with a little change in moment of generating the digest, we use the hexadecimal value of the hashed seed in lieu of the binary value., (*31)

Client Side specifics

On the client side, I've inspired my code from Nils Blum-Oeste article explaining how to send an authorization token for every request. To do this you have to register a wrapper for every resource actions that execute a specific code before doing the action. For more information you can check http://nils-blum-oeste.net/angularjs-send-auth-token-with-every--request/., (*32)

The differences there is that I send the token, username and user digest in the HTTP Header X-WSSE., (*33)

Conclusion

You can use this template and adapt it to your needs., (*34)

@FlyersWeb, (*35)

Adaptations by @renatomefidf, (*36)

  • MongoDB support, (*37)

  • Symfony and related dependencies/bundles update, (*38)

  • Packagist project, (*39)

The Versions