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.
This repository is a monorepo, based on npm workspaces composed of two workspaces:
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
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.
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
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
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
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 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
Lint sass files with stylelint
npm run lint:sass
# With fix
npm run lint:sass:fix
Jetbrains
https://www.jetbrains.com/help/webstorm/using-stylelint-code-quality-tool.html
Vsode
https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint
# 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
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>
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
We use scalingo manifest json to deploy the app on scalingo with specific environment variables. see scalingo manifest for more details.