- nodejs 20 (Installation guide)
- npm v10
- Install dependencies
npm install
- Generate backend types via TypeShare. Make sure that the typeshare-cli is installed in the backend.
npm run generate-api-types
- Create '.env.local' file and copy content from '.env.sample'. Modify env variables to fit the environment.
cp .env.sample .env.local
- Start development server
npm run dev
This will start the development server on http://localhost:5173/ and will open the application in your default web browser. The server will automatically reload the page when you make changes to the code.
To view the documentation
- Generate the documentation via TypeDoc.
npm run doc
- Start storybook
npm run storybook
This will start the storybook dev server on http://localhost:6006/ and will open it up on your default web browser.
- Make sure you are in the frontend directory
- Run the test script
npm run test
npm run test -- path/to/component.test.tsx
Our test framework provides an interactive watch mode that can be executed with
npm run test -- --watchAll
This command starts an interactive CLI that can be used to rerun specific tests after implementing changes.
To build the application for production, run:
npm run build
By default, the build output will be placed at dist
.
To view the build locally, run:
npm run preview
In order to ensure type safety between the TypeScript frontend and Rust backend, we use typeshare to synchronize our Rust type definitions with TypeScript.
These types are auto-generated and we can find our rust-typescript bindings under /src/bindings
and use them directly in our TypeScript codebase.
In order to avoid CORS issues disable your browsers CORS checks. In chromium they can be disabled by starting it with:
chromium --disable-web-security --user-data-dir="[some directory here]"
This is necessary because Nextcloud has a strict CORS policy and there is no way to allow certain origins. This limitation means that the PermaplanT app and the used Nextcloud instance have to run on the some domain.
Firefox does not seem to have an easy way to do the same, see https://bugzilla.mozilla.org/show_bug.cgi?id=1039678