Skip to content

Code de l'application de coopération sur le cadastre solairede Rennes Métropole basée sur un jumeau numérique

License

Notifications You must be signed in to change notification settings

sigrennesmetropole/cooperation_jn_solar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cooperation Jumeau Numérique Solar

Code de l'application de coopération sur le cadastre solairede Rennes Métropole basée sur un jumeau numérique.

Quick start

Package common_ui from github registry

Installation

This app install the @sigrennesmetropole/cooperation_jn_common_ui package. Although this package is public, you still need a Private Access Token (PAT) from github to download it.

In order to do that you need to follow this instructions. And create a token with package:read permission.

With userconfig

Then, in your personnal ~/.npmrc you need to add this line:

//npm.pkg.github.com/:_authToken=<YOUR PAT>

And then install dependencies with:

npm i --userconfig
With projectconfig

Or, you could also change ./npmrc project file, and replace NPM_TOKEN by your PAT.

Careful! If you change the project npmrc file, you must be careful and not commit the change. The docker image in the CI is build by replacing the ${NPM_TOKEN} by the GITHUB_TOKEN of the repository. The CI will fail. Moreover if you commit your own PAT, it will be invalidated by Github.

If you want to work by changing the project .npmrc, the easiest way is probably to ignore it in your git index before changing it:

git update-index --skip-worktree .npmrc

Configure .env file

For local development (with local Back End), please use .env.local.dev to create .env

Upgrade

The @sigrennesmetropole/cooperation_jn_common_ui package is frequently patch. Try to keep it up-to-date.

Run the app in dev mode

npm i
npm start

Run histoire

npm run story

Demo

Docker

Build locally the image

docker build -t cooperation_jn_solar:latest --build-arg NPM_TOKEN=<YOUR_GITHUB_NPM_TOKEN>.

Run the image

docker run -p 8080:80 cooperation_jn_solar:latest

Deployment of the app

1) Image creation

Through Github pipeline, an image is created on every push on 'main' branch, and on each pull request. The repository for this image can be found here: https://github.com/sigrennesmetropole/cooperation_jn_solar/pkgs/container/cooperation_jn_solar/versions

On pull request

  • An image is created, it is tag with 'pr-#' where # is the id of the pull request

On push to the main branch (after a pull request is merge)

  • An image is created, it is tag with the short hash of the last commit on main branch.

Commands

Type-Check, Compile and Minify for Production

npm run build

Run Unit Tests with Vitest

npm run test:unit

Run End-to-End Tests with Cypress

npm run build
npm run test:e2e # or `npm run test:e2e:ci` for headless testing

Lint with ESLint

npm run lint:js

Format the code with autofix (eslint + prettier)

npm run format

Run histoire with Hot-Reload for Development

npm run story

About

Code de l'application de coopération sur le cadastre solairede Rennes Métropole basée sur un jumeau numérique

Resources

License

Stars

Watchers

Forks

Packages