cms/app-client/README.md
author ymh <ymh.work@gmail.com>
Tue, 20 Mar 2018 15:02:24 +0100
changeset 572 190ae1dee68d
parent 537 d2e6ee099125
permissions -rw-r--r--
New version, update js requirements + package files.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     1
# App-client
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     2
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     3
This README outlines the details of collaborating on this Ember application.
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     4
A short introduction of this app could easily go here.
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     5
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     6
## Prerequisites
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     7
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     8
You will need the following things properly installed on your computer.
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     9
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    10
* [Node.js](http://nodejs.org/) (with NPM)
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    11
* [PhantomJS](http://phantomjs.org/)
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    12
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    13
## Installation
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    14
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    15
* `npm install`
537
d2e6ee099125 upgrade ember + laravel + make everything work
ymh <ymh.work@gmail.com>
parents: 319
diff changeset
    16
* `npm run install-common` (called in post-install)
5
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    17
* `bower install`
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    18
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    19
## Running / Development
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    20
104
bd3747a1cd5f update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents: 5
diff changeset
    21
* `npm start` (shortcut for `ember serve --environment=development` which serve the application)
5
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    22
* Visit your app at [http://localhost:4200](http://localhost:4200).
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    23
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    24
### Code Generators
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    25
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    26
Make use of the many generators for code, try `ember help generate` for more details
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    27
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    28
### Running Tests
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    29
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    30
* `ember test`
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    31
* `ember test --server`
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    32
104
bd3747a1cd5f update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents: 5
diff changeset
    33
## Build / Production
5
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    34
104
bd3747a1cd5f update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents: 5
diff changeset
    35
* `npm build` (shortcut for `ember build --environment=production` which serve the application)
bd3747a1cd5f update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents: 5
diff changeset
    36
* Visit /dist to check the built files
5
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    37
104
bd3747a1cd5f update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents: 5
diff changeset
    38
## Api configuration
5
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    39
105
63b9014bb58b some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents: 104
diff changeset
    40
* As Ember advices, all the logic of the api (host, namespace), is located in `adapters/application.js`.
63b9014bb58b some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents: 104
diff changeset
    41
* Two ways are provided:    
63b9014bb58b some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents: 104
diff changeset
    42
  * `Fixture`: deprecated in Ember and have been move out. We know use `ember-data-fixture-adapter` which provides the same behavior.
63b9014bb58b some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents: 104
diff changeset
    43
**However** it doesn't allow the use of `this.store.findRecord(...)` function. In our case it won't trigger the api request for the full document information (therefore doesn't get the sound urls). --> **Only use for testing**
63b9014bb58b some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents: 104
diff changeset
    44
63b9014bb58b some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents: 104
diff changeset
    45
  * `RESTAdapter`: The Common way of plugging in Ember with a Rest server.
106
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    46
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    47
## visualizations
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    48
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    49
### "Langues"
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    50
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    51
It use D3js and the implementation by [Mike Bostock](http://bost.ocks.org/mike/treemap/) customized to fit our needs.
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    52
The json used to build the treemap follows this example (can be find in `public/langues.json`):
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    53
```json
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    54
{
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    55
 "name": "Global",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    56
 "children": [
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    57
  {
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    58
    "id": "id de langue (code Lexvo de la langues)",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    59
    "name": "Français",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    60
    "color": "lightblue",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    61
    "value": 859
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    62
  },
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    63
  {
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    64
    "name": "Wallis et Futuna",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    65
    "value": 43,
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    66
    "children": [
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    67
      {
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    68
        "name": "LanEast Futuna (fud)",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    69
        "value": 23
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    70
      },
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    71
      {
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    72
        "name": "Wallisian (wls)",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    73
        "value": 20
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    74
      }
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    75
    ]
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    76
  }
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    77
 ]
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    78
}
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    79
```
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    80
A `color` attribute can be add to each node.
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    81
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    82
### "Carthographie"
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    83
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    84
It use the [Ammap](https://www.amcharts.com/javascript-maps/) library.
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    85
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    86
It also uses a JSON to describe the areas. It is possible to get the bounding box of the country clicked, however it is a rectangle and isn't as precise as the SVG path.
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    87
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    88
It seems to use the `ISO 3166-1` country naming convention ("US", "FR", "BZ", etc.)