Run yarn
to install the dependencies.
Run the API at localhost:3000
Set the following environnement variables in .env.development
VITE_PORT=3111
VITE_GRAASP_API_HOST=http://localhost:3000
VITE_SHOW_NOTIFICATIONS=true
VITE_GRAASP_AUTH_HOST=http://localhost:3001
VITE_GRAASP_PLAYER_HOST=http://localhost:3112
VITE_GRAASP_ANALYZER_HOST=http://localhost:3113
VITE_GRAASP_LIBRARY_HOST=http://localhost:3115
VITE_GRAASP_ACCOUNT_HOST=http://localhost:3114/account
# in prod, it is https://go.graasp.org
VITE_GRAASP_REDIRECTION_HOST=http://localhost:3000/items/short-links
VITE_H5P_INTEGRATION_URL=
VITE_VERSION=latest-dev
Run yarn start
. The client should be accessible at localhost:3111
The first requirement for fully accessing the client is to be authenticated. If not, the client will redirect to the authentication page. You have two possibilities to authenticate:
graasp-auth
repository. You may need to adapt your configuration to match the hosts.POST <API_HOST>/register
with name
and email
orPOST <API_HOST>/login
with your registered email
.
Once authenticated, you should receive a link to receive your cookie. Refer to the API for more details.You are successfully authenticated if you can access to the client without being redirected.
The tests are run using Cypress. Cypress only compiles the code for the tests, your app needs to run at the specified baseUrl
in the cypress config.
Set the following environnement variables in .env.test
VITE_PORT=3333
VITE_GRAASP_API_HOST=http://localhost:3000
VITE_GRAASP_AUTH_HOST=http://localhost:3001
VITE_GRAASP_PLAYER_HOST=http://localhost:3112
VITE_GRAASP_LIBRARY_HOST=http://localhost:3005
VITE_GRAASP_ANALYZER_HOST=http://localhost:3113
# in prod, it is https://go.graasp.org who will redirect to the backend
VITE_GRAASP_REDIRECTION_HOST=http://localhost:3000/items/short-links
VITE_H5P_INTEGRATION_URL=
VITE_VERSION=cypress-tests
VITE_SHOW_NOTIFICATIONS=true
Run yarn start:test
and yarn cypress:open
in 2 terminal windows.
:warning: It is possible that the websocket test become flacks (or just stop passing) if you use the dev server. In that case, you can resort to first building the app in test mode yarn build:test
and then starting a preview of the app with yarn preview:test
.
You will need to have the .env.test
file from the other section.
You can simply run: yarn test
. This will:
.env.test
file to pull env variables).env.test
file)While developing you can run yarn check
to perform prettier formatting checks, type checks and eslint rule checking.
You can translate Graasp Builder through GitLocalize. Let us know if your language is not available.
Kim Lan Phan Hoang 💻 |
Alexandre Chau 💻 |
Basile Spaenlehauer 💻 |