Skip to content
Snippets Groups Projects
README.md 6.25 KiB
Newer Older
  • Learn to ignore specific revisions
  • # ![Ecolyo_logo](https://forge.grandlyon.com/uploads/-/system/project/avatar/409/State_Default__Size_512px.png?width=64) Ecolyo
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    ## What's Ecolyo?
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    Ecolyo is a mobile-first app allowing citizens to visualise easily their energy consumption (electricity, gas, water ...). The app allows data visualisation but give also some tips on how to reduce energy consumption.
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    ## Ecolyo au-delà de la Métropole de Lyon
    
    <https://doc-self-data.apps.grandlyon.com/docs/ecolyo/share/>
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    ## How does it works ?
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    Ecolyo uses "konnectors" for fetching data. More information on our [konnector documentation](https://doc-self-data.apps.grandlyon.com/docs/konnectors/introduction/). Repositories for our konnectors :
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    - [enedis konnector](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/enedis-sge-konnector)
    - [grdf konnector](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/grdf-konnector)
    - [egl konnector](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/egl-konnector)
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    ## Development
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    For a more complete look at our project and our installation guide, check our **[Self Data Docs](https://doc-self-data.apps.grandlyon.com/)**
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    
    _:pushpin: Note:_ we recommend to use [Yarn] instead of NPM for package management.
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    Developing the Cozy Ecolyo app requires you to be familiar with [cozy's documentation](https://docs.cozy.io/en/). Cozy's apps use a standard set of _scripts_ to run common tasks, like watch, lint, test, build…
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    ### Run it inside a default Cozy using Docker
    
    First of all get cozy dev image :
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    ```sh
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    docker pull cozy/cozy-app-dev
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    ```
    
    Then you can run your application inside a Cozy thanks to the [cozy-stack docker image][cozy-stack-docker]:
    
    ```sh
    # in a terminal, run your app in watch mode with a docker running Cozy
    $ yarn start
    ```
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    After the build and the stack launched, your app is now available at <http://ecolyo.cozy.tools:8080>.
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    ### Run it inside custom Docker
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    For the project we have created our own docker container. For more information on how to use it, please refer to wiki section.
    
    ### Tests
    
    Tests are run by [jest] under the hood. You can easily run the tests suite with:
    
    ```sh
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    yarn test
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    ```
    
    :pushpin: Don't forget to update / create new tests when you contribute to code to keep the app the consistent.
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    ### Open a Pull-Request
    
    If you want to work on Ecolyo and submit code modifications, feel free to open pull-requests! See the [contributing guide][contribute] for more information about how to properly open pull-requests.
    
    ### Commits
    
    You must follow these rules to write your commit messages : [Conventional Commits Specification][conventional-commits]
    
    ### Data storage
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    The Cozy datastore stores documents, which can be seen as JSON objects. A `doctype` is simply a declaration of the fields in a given JSON object, to store similar objects in an homogeneous fashion.
    
    Cozy ships a [built-in list of `doctypes`][doctypes] for representation of most of the common documents (Bills, Contacts, Files, ...).
    
    Whenever your app needs to use a given `doctype`, you should:
    
    - Check if this is a standard `doctype` defined in Cozy itself. If this is the case, you should add a model declaration in your app containing at least the fields listed in the [main fields list for this `doctype`][doctypes]. Note that you can extend the Cozy-provided `doctype` with your own customs fields. This is typically what is done in [Konnectors] for the [Bill `doctype`][bill-doctype].
    - If no standards `doctypes` fit your needs, you should define your own `doctype` in your app. In this case, you do not have to put any field you want in your model, but you should crosscheck other cozy apps to try to homogeneize the names of your fields, so that your `doctype` data could be reused by other apps. This is typically the case for the [Konnector `doctype`][konnector-doctype] in [Konnectors].
    
    ## Community
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    ### What's Cozy? ![Cozy logo](https://cdn.rawgit.com/cozy/cozy-site/master/src/images/cozy-logo-name-horizontal-blue.svg)
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    [Cozy] is a platform that brings all your web services in the same private space. With it, your webapps and your devices can share data easily, providing you with a new experience. You can install Cozy on your own hardware where no one's tracking you.
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    You can reach the Cozy Community by:
    
    - Chatting with us on IRC [#cozycloud on Freenode][freenode]
    - Posting on our [Forum][forum]
    - Posting issues on the [Github repos][github]
    - Say Hi! on [Twitter][twitter]
    
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    ### Localization
    
    Localization and translations are handled by [Transifex][tx], which is used by all Cozy's apps.
    
    As a _translator_, you can login to [Transifex][tx-signin] (using your Github account) and claim an access to the [app repository][tx-app]. Locales are pulled when app is build before publishing.
    
    As a _developer_, you must [configure the transifex client][tx-client], and claim an access as _maintainer_ to the [app repository][tx-app]. Then please **only update** the source locale file (usually `en.json` in client and/or server parts), and push it to Transifex repository using the `tx push -s` command.
    
    ### Maintainer
    
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    Ecolyo is maintained by the [factory team](https://forge.grandlyon.com/groups/web-et-numerique/factory/-/group_members) feel free to get in touch !
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    ## License
    
    
    Yoan VALLET's avatar
    Yoan VALLET committed
    Ecolyo is developed by "La métropole de Lyon" and distributed under the [AGPL v3 license][agpl-3.0].
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    [conventional-commits]: https://conventionalcommits.org
    
    [cozy]: https://cozy.io 'Cozy Cloud'
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    [yarn]: https://yarnpkg.com/
    [cozy-stack-docker]: https://github.com/cozy/cozy-stack/blob/master/docs/client-app-dev.md#with-docker
    [doctypes]: https://cozy.github.io/cozy-doctypes/
    [bill-doctype]: https://github.com/cozy/cozy-konnector-libs/blob/master/models/bill.js
    [konnector-doctype]: https://github.com/cozy/cozy-konnector-libs/blob/master/models/base_model.js
    [konnectors]: https://github.com/cozy/cozy-konnector-libs
    [agpl-3.0]: https://www.gnu.org/licenses/agpl-3.0.html
    [contribute]: CONTRIBUTING.md
    [tx]: https://www.transifex.com/cozy/
    [tx-signin]: https://www.transifex.com/signin/
    [tx-app]: https://www.transifex.com/cozy/<SLUG_TX>/dashboard/
    [tx-client]: http://docs.transifex.com/client/
    [freenode]: http://webchat.freenode.net/?randomnick=1&channels=%23cozycloud&uio=d4
    [forum]: https://forum.cozy.io/
    [github]: https://github.com/cozy/
    [twitter]: https://twitter.com/cozycloud
    [jest]: https://facebook.github.io/jest/