To run this app locally you need to have Node and
NPM installed in your operating system. We strongly recommend that you
also have Yarn. All the commands that you will see here use yarn
,
but they have an npm
equivalent.
Download or clone the repository to your local machine, preferably using Git.
Inside the project directory, run yarn
to install the project dependencies.
You will also need to create a file called .env.development
with the following contents.
VITE_GRAASP_APP_KEY=<app-key>
VITE_ENABLE_MOCK_API=true
VITE_API_HOST=http://localhost:3000
VITE_PORT=3004
VITE_VERSION=local
VITE_ENABLE_MOCK_API=false
when you build for use in the real-world (prod or dev).
Navigate to the cloned or forked project directory using the command line, type yarn start
or yarn dev
.
The app will automatically run on http://localhost:3004
. Any changes you make should be automatically rendered in the browser.
To develop without running our backend and frontend you have to put VITE_ENABLE_MOCK_API=true
in the .env
file used when running your project (we assume .env.development
here). This mocks the API which simulates a backend and provides your app with a context.
Find detailed instructions on how to use the mock API in the graasp-apps-query-client README.