- Run
yarn
to install the dependencies. - Run the API at
localhost:3000
- Set the following environnement variables in
.env.local
REACT_APP_API_HOST=http://localhost:3000
PORT=3111
REACT_APP_UPLOAD_METHOD=default
REACT_APP_S3_FILES_HOST=
REACT_APP_SHOW_NOTIFICATIONS=true
REACT_APP_AUTHENTICATION_HOST=http://localhost:3001
- Run
yarn start
. The client should be accessible atlocalhost: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:
- Set up and run the
graasp-auth
repository. You may need to adapt your configuration to match the hosts. - Use Postman or anything similar to authenticate. Send to the API either
GET <API_HOST>/register
withname
andemail
orGET <API_HOST>/login
with your registeredemail
. 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.
REACT_APP_UPLOAD_METHOD
(default:default
): This variable can take the following values:default
ors3
.default
will save your file locally whiles3
will send the files to an S3 bucket configured with theREACT_APP_S3_FILES_HOST
variable.
Set the following environnement variables in .env.test
REACT_APP_API_HOST=http://localhost:3000
PORT=3111
REACT_APP_UPLOAD_METHOD=default
REACT_APP_S3_FILES_HOST=
REACT_APP_SHOW_NOTIFICATIONS=false
REACT_APP_NODE_ENV=test
Run yarn cypress
. This should run every tests headlessly.
You can run yarn cypress:open
to access the framework and visually display the tests' processes.