Skip to content

Latest commit

 

History

History
202 lines (144 loc) · 6.89 KB

File metadata and controls

202 lines (144 loc) · 6.89 KB

FRONTEND - Mission transition écologique

Report Bugmission-transition-ecologique.beta.gouv.fr


CSS - SCSS

La documentation des styles est disponible dans le fichier ./style.md.

Environment variables

The env variables you can use for deployment are listed in the .env.example file.

# To hide the "debug" switch
# If this variable is set to 'true'
# it overrides the `debug-switch` parameters to prohibit debug mode
VITE_NO_DEBUG_SWITCH = false

# To indicate built source while copying the widget
VITE_DEPLOY_URL = https://tee-frontend.osc-fr1.scalingo.io

# To set up global contact email
VITE_CONTACT_EMAIL = [email protected]

# To set up PostHog analytics
# create a posthog account and use the corresponding API key
VITE_POSTHOG_API_KEY = your_key
# To set up Matomo analytics
# Note : if VITE_MATOMO_DEACTIVATE is set to 'true' it prohibits the tracking
# even if VITE_MATOMO_URL and VITE_MATOMO_APP_ID are correctly set
VITE_MATOMO_DEACTIVATE = true
VITE_MATOMO_URL = https://stats.beta.gouv.fr
VITE_MATOMO_APP_ID = 42

# To indicate the backend url
VITE_TEE_BACKEND_URL=https://tee-backend.osc-fr1.scalingo.io

Legacy projects

Projet TEE

Aid programs APIs

Links and references


Data models - (R&D)

All documentation about data models and references are on our SE Notion space


Stack

  • Type script
  • Vuejs 3
  • Vite
  • Design System de l'Etat

Technical references / tutorials


Recommended IDE Setup

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

VSCode: Type Support for .vue Imports in TS

TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension
  • Run Extensions: Show Built-in Extensions from VSCode's command palette
  • Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  1. Reload the VSCode window by running Developer: Reload Window from the command palette.

Customize configuration

See Vite Configuration Reference.


Project Setup

npm install
cp .env.example .env

Development mode

Compile and Hot-Reload for Development

npm run dev

Should run on http://localhost:4242

Lint with ESLint

npm run lint

Run Unit Tests with Vitest

npm run test:unit

Run End-to-End Tests with Cypress

npm run test:e2e:dev

This runs the end-to-end tests against the Vite development server. It is much faster than the production build.

Production Mode

Type-Check, Compile and Minify for Production

npm run build

Run End-to-End Tests with Cypress on Production Build

It's still recommended to test the production build with test:e2e before deploying (e.g. in CI environments):

npm run build
npm run test:e2e