Skip to content

betagouv/mission-transition-ecologique

Repository files navigation

Transition écologique des entreprises


WARNING : work in progress


An app + a web component + a dataset to help french entreprises finding public aid programs for their ecological transition.

A project from the transition-ecologique-entreprises SE team.



Screenshots

Project Setup

Stack

Description

This repository is a monorepo, based on npm workspaces composed of two workspaces:

Getting started

NVM

The runtime is Node 18.x for this application.
You can use nvm to install this specific version.

# from the root folder of the project
nvm install
nvm use

Environment variables

Some environment variables are needed for the services to work. Copy and modify the .env.example file from the folders (back/data/web) you want to build/start to .env in the same directory.

Quick Start

If you want to run the project locally and quickly, you can use the following commands:

# from the root folder of the project
npm install
npm run start-all

Build

Use the following commands to build the project:

# All workspaces
npm run build
# Or for a specific workspace
npm run build-front # web
npm run build-back  # backend

# Or alternatively
npm run build -w packages/web
npm run build -w packages/backend

Start services

Use the following commands to start the project:

# All workspaces
npm run start-all
# Or for a specific workspace
# Front-end
npm run start-front
# Back-end
npm run start-back

# Or alternatively
PORT=4242 npm run start --workspace packages/web
npm run start --workspace packages/backend

Development Mode

To run the project in development mode, use the following commands:

# All workspaces
npm run dev
# Or for a specific workspace
# Front-end
npm run dev-front
# Back-end
npm run dev-back

# Or alternatively
npm run dev --workspace packages/web
npm run dev --workspace packages/backend

Linting and type check

  • Linting is done with eslint and type check with tsc or vue-tsc (typescript compiler).
npm run lint
# With fix
npm run lint:fix
# Type check on web workspace
npm run vue:type:check
npm run lint:sass

# With fix
npm run lint:sass:fix
IDE configuration:

Preview front before deploying in production

# This script builds the front 
# and previews the produced index.html file from the dist folder
# on http://localhost:4242
npm run dev:build:start

Commands for a specific workspace

More scripts are defined for each workspace: checkout their respective documentation and package.json file.

Scripts can be triggered with:

npm run <script-name> -w packages/<workspace-name>

Data validation

Source program data are stored as YAML files, we use JSON Schema to validate every file.

The validations are triggered by Github CI on each pull request on preprod and main branches.

To run the validation tests manually, run:

npm run test-data -w packages/backend

Scalingo, deployment and review apps

We use scalingo manifest json to deploy the app on scalingo with specific environment variables. see scalingo manifest for more details.


Credits