2026-03-12 13:03:44 +00:00
# Frontend
2026-04-15 15:16:57 +01:00
All frontend commands are run from the repository root using [Task ](https://taskfile.dev/ ):
- `task frontend:dev` — start Vite dev server (localhost:5173)
- `task frontend:build` — production build
- `task frontend:test` — run tests
- `task frontend:test:watch` — run tests in watch mode
2026-08-07 17:02:11 +01:00
- `task frontend:lint` — run linting
2026-04-15 15:16:57 +01:00
- `task frontend:typecheck` — run TypeScript type checking
- `task frontend:check` — run typecheck + lint + test
- `task frontend:install` — install npm dependencies
For desktop app development, see the [Tauri ](#tauri ) section below.
2026-05-22 13:40:34 +01:00
## Layout
`frontend/` is a workspace containing one or more apps. Today it holds the
PDF editor under `frontend/editor/` ; new apps (the developer portal, etc.)
will sit alongside it as siblings. Shared tooling — `package.json` , `node_modules` ,
2026-08-24 10:34:12 +00:00
`.storybook/` , oxlint, oxfmt — lives at `frontend/` so every app installs
2026-05-22 13:40:34 +01:00
once and lints with the same config.
2026-03-12 13:03:44 +00:00
## Environment Variables
2025-05-09 20:01:09 +01:00
2026-05-22 13:40:34 +01:00
The editor's environment variables live in committed `.env` files at
`frontend/editor/` :
2026-03-12 13:03:44 +00:00
2026-04-25 13:09:59 +01:00
- `.env` — used by all builds (core, proprietary, and as the base for desktop/SaaS)
- `.env.desktop` — additional vars loaded in desktop (Tauri) mode
- `.env.saas` — additional vars loaded in SaaS mode
2026-03-12 13:03:44 +00:00
2026-04-25 13:09:59 +01:00
These files contain non-secret defaults and are checked into Git, so most dev work needs no further setup.
2026-05-22 13:40:34 +01:00
To override values locally (API keys, machine-specific settings), create an uncommitted sibling `editor/.env.local` / `editor/.env.desktop.local` / `editor/.env.saas.local` . Vite automatically layers these on top of the committed files.
2025-05-09 20:01:09 +01:00
2025-07-18 14:19:36 +01:00
## Docker Setup
For Docker deployments and configuration, see the [Docker README ](../docker/README.md ).
2025-11-05 11:44:59 +00:00
## Tauri
2026-04-15 15:16:57 +01:00
All desktop tasks are available via [Task ](https://taskfile.dev ). From the root of the repo:
2025-11-05 11:44:59 +00:00
### Dev
```bash
2026-04-15 15:16:57 +01:00
task desktop:dev
2025-11-05 11:44:59 +00:00
```
2026-04-15 15:16:57 +01:00
This ensures the JLink runtime and backend JAR exist (skipping if already built), then starts Tauri in dev mode.
2026-03-12 13:03:44 +00:00
2025-11-05 11:44:59 +00:00
### Build
```bash
2026-04-15 15:16:57 +01:00
task desktop:build
2025-11-05 11:44:59 +00:00
```
2026-04-15 15:16:57 +01:00
This does a full clean rebuild of the backend JAR and JLink runtime, then builds the Tauri app for production.
Platform-specific dev builds are also available:
```bash
task desktop:build:dev # No bundling
task desktop:build:dev:mac # macOS .app bundle
task desktop:build:dev:windows # Windows NSIS installer
task desktop:build:dev:linux # Linux AppImage
```
### JLink Tasks
You can also run JLink steps individually:
```bash
task desktop:jlink # Build JAR + create JLink runtime
task desktop:jlink:jar # Build backend JAR only
task desktop:jlink:runtime # Create JLink custom JRE only
task desktop:jlink:clean # Remove JLink artifacts
```
### Clean
```bash
task desktop:clean
```
Removes all desktop build artifacts including JLink runtime, bundled JARs, Cargo build, and dist/build directories.