Giter VIP home page Giter VIP logo

preuve-covoiturage's Introduction

Registre de Preuve de covoiturage

Le registre de preuve de covoiturage est un projet beta.gouv.fr qui a pour but de certifier qu'un covoiturage a bien eu lieu. L'objectif de l'outil est d'agir en tant que tiers de confiance entre les différents acteurs du covoiturage (opérateurs, autorités organisatrices de mobilité, entreprises, régions, etc.) pour simplifier la mise en place d'incitations à destination des covoitureuses et covoitureurs. Cette Startup d'État a pour objectif d'aider à réduire l'auto-solisme et l'emprunte écologique des déplacements courts.

Services

An easy way to boot the application on your local machine is by using Docker. You will need docker and docker-compose.

Service slug ENV URL Folder
Frontend * - APP_APP_URL http://localhost:4200 /dashboard
API api APP_API_URL http://localhost:8080 /api
Printer printer APP_PRINTER_URL http://localhost:3000 /printer
Redis redis APP_REDIS_URL redis://redis:6379 -
Postgres postgres APP_POSTGRES_URL postgresql://postgres:post -
Postgres Client pgadmin - http://localhost:5050 -

* The Frontend doesn't run in Docker. Install NodeJS locally and run it with yarn start from the dashboard folder.
⚠️ docker-compose.yml is used in local environment only

Installation

  1. Clone the repository and cd to it
  2. cp api/.env.example api/.env
  3. Edit the api/.env file
  4. docker-compose build
  5. docker-compose run api yarn
  6. docker-compose run api yarn run build
  7. docker-compose run api yarn migrate
  8. docker-compose run api yarn set-permissions

clone ilos locally

Ilos is the progressive micro-service framework behind the application. You can clone the ilos framework locally to use different branches, tags or contribute. To do so, create the api/ilos folder, check the dev branch out and run yarn build.
Workspaces are handled properly when yarn commands are run from the /api folder.

the current dev branch of the application runs on Ilos dev branch.

cd api
git clone https://github.com/betagouv/ilos.git ilos
cd ilos
yarn
yarn run build
cd .. (api/)
yarn
yarn run build

Run the stack

// TODO seed users and make easy onboarding

Migrations

// use SKIP_MIGRATIONS=true to skip migrations in an automated deployment process

cd api
yarn migrate
// OR
docker-compose run api yarn migrate

Configuration

Secrets configuration

For all secrets, use the .env file which is NOT COMMITED to Git.

For none secret values configuring the system, commit the ENV vars in docker-compose.yml

For static application configuration (timeout, etc.) edit/add the .ts files in each service config/ folder.

CLI commands

inside the api container
  • yarn set-permissions reset all users' permissions based on their group and role
  • yarn workspace @pdc/... run test
outside the dashboard container
  • yarn cypress open opens cypress GUI
  • yarn cypress run runs integration tests with cypress ( requires installation of cypress locally )

Versions

The project follows the semver specification.

Use a GUI to access the Redis queues

An easy to use and configure GUI is bull-arena. You can install it locally and run it to connect to the Redis running in docker (the port is exposed to localhost).

Install bull-arena

cd {somewhere}
git clone https://github.com/bee-queue/arena.git
cd arena
npm install

Configure the queues

vi src/server/config/index.json
{
  "queues": [
    {
      "name": "acquisition",
      "hostId": "pdc-local",
      "url": "redis://:<password>@127.0.0.1:6379"
    },
    {
      "name": "normalization",
      "hostId": "pdc-local",
      "url": "redis://:<password>@127.0.0.1:6379"
    },
    {
      "name": "trip",
      "hostId": "pdc-local",
      "url": "redis://:<password>@127.0.0.1:6379"
    },
    {
      "name": "carpool",
      "hostId": "pdc-local",
      "url": "redis://:<password>@127.0.0.1:6379"
    },
    {
      "name": "fraud",
      "hostId": "pdc-local",
      "url": "redis://:<password>@127.0.0.1:6379"
    },
    {
      "name": "campaign",
      "hostId": "pdc-local",
      "url": "redis://:<password>@127.0.0.1:6379"
    }
  ]
}

start the GUI

cd arena
npm start

Access the GUI at http://localhost:4567

License

DINUM, 2017-2020.

The source code is published under Apache license 2.0.

preuve-covoiturage's People

Contributors

betajon1234 avatar dependabot[bot] avatar gillesboisson avatar jonathanfallon avatar margot-sanchez avatar nmrgt avatar samueleyre avatar vincentlaine avatar

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.