# Definition

The Clickbus Global SPA is a Client Frontend generic for all ventures.

The SPA front end client deployed in only one server, globally. That means the application is intelligent enough to identify the domain and apply the specific configurations and parametrizations using Node.js to serve it.

## SPA Structure

* app/
  * assets/
    * sass/
    * img/
  * public/
    * js/
    * css/
    * img/
  * system/
    * config/
      * routes/
    * views/
      * common/
      * home/
      * search/
      * .../
    * models/
    * controllers/
    * filters/
    * directives/
    * services/
    * hooks/
    * app.js
* vendor/

## Workflow

The App will be served 

![Workflow](docs/workflow.png)



#### Gulp JS



When 

- NodeJS to serve the html client ( should not have any hard logics into the client side )
  - All clients will have the exactly same code in the same server that means the app should handle the domain and apply settings and the "server side" should be responsable for it;
  - The "server side" must be simple and with few ( not to mention none ) rules ( it's just to serve the html, apply parameters and concat templates, images, etc );
- Use Angular
  - Organize structure to be reused by both mobile and new spas clients;
  - Service Oriented ( remember to use as max as possible common services using bower repositories as dependencies, create private repos if needed )
  - SOLID;
  - Single Responsibilities in services, directives, controllers, etc;
- Use Gulp
- Use Atomic ( create a common base for clickbus projects and add it to a private bower repository and use as dependecies )
- Use SaSS 
- **jQuery NOT ALLOWED**

/node_modules/protractor/selenium
Invalid or corrupt jarfile /Users/letanure/Projects/clickbus/global-spa/node_modules/protractor/selenium/selenium-server-standalone-2.42.2.jar
Selenium Standalone has exited with code 1

http://selenium-release.storage.googleapis.com/index.html?path=2.42/