This repository hosts the template code for a Graasp App written with Typescript and React. The bundler used is Vite.
The recommended way to use this template is with the Graasp CLI which provides a setup wizard and some convenience tools when creating your project.
Alternatively it is possible to create a new Github repo from this project using the Github Template function. In this case the local setup is left as an exercice to the reader.
This template can be used with the graasp CLI to setup your project in a single line:
npx @graasp/cli@latest new -s graasp/graasp-app-starter-ts-viteThe CLI will ask you a few questions to help you setup your project. It suggests sane defaults:
- Deploying using GitHubActions (recommended)
- Provide an appId
- Auto-install project dependencies
- Initialize a local git repository
Should you choose to bootstrap your graasp app manually, you will need to execute the following steps.
Get a copy of this repo.
Click on the Use this template button. For more instructions head over to the GitHub Docs on Using a template
With git:
git cloneWith the GitHub CLI:
gh repo clone graasp/graasp-app-starter-ts-viteTo deploy your app using github actions.
You will have to look for the Graasp App Template string in yours project files and rename it to your project name
If you choose to deploy your app with the provided GitHubActions workflows you will need to create the following secrets:
APP_ID: a UUID v4 that identifies your app for deploymentAPP_KEY: a UUID v4 that authorizes your app with the Graasp APISENTRY_DSN: your Sentry url to report issues and send telemetry
Create a .env.development file with the following content:
VITE_PORT=3005
VITE_API_HOST=http://localhost:3000
VITE_ENABLE_MOCK_API=true
VITE_GRAASP_APP_KEY=45678-677889
VITE_VERSION=latestCreate a .env.test file with the following content:
VITE_PORT=3333
VITE_API_HOST=http://localhost:3636
VITE_ENABLE_MOCK_API=true
VITE_GRAASP_APP_KEY=45678-677889
VITE_VERSION=latest
# dont open browser
BROWSER=none