Skip to content

Configuration

daarunia edited this page Jul 11, 2026 · 1 revision

Configuration

This page collects every knob you can turn: environment variables, persisted user settings, and the main configuration files.

Environment variables (.env)

The renderer reads a handful of Vite variables. Start from the template:

cp .env.template .env
Variable Default Purpose
VITE_BASE_URL http://localhost:3000 Base URL of the embedded Fastify API. Used by the Axios instance in utils/api.helper.ts.
VITE_LOG_LEVEL debug Renderer log verbosity for vue-logger-plugin: error, warn, debug, trace.

Vite envDir note: because the renderer root is src/renderer (not the project root), vite.config.mjs sets envDir explicitly so the root-level .env is loaded. The .env file is git-ignored.

User settings (electron-store)

Runtime user preferences are persisted by electron-store to a JSON file in the user-data directory, and are schema-validated (src/main/stores/settings.ts):

Key Type Default Notes
theme 'light' | 'dark' dark Light/dark mode
primaryColor string violet Name of one of the 17 palettes

These are read/written from the renderer through the preload IPC bridge (window.settings.get/set). See Frontend for the full flow.

vite.config.mjs — renderer build

Key settings:

Option Value Why
root src/renderer The renderer app root
server.port 8080 Dev server port
build.outDir build/renderer Where the production bundle lands
envDir project root So .env is found despite the custom root

Plugins: @tailwindcss/vite, @vitejs/plugin-vue, unplugin-vue-components (with the PrimeVue resolver, for auto-import), and rollup-plugin-visualizer (writes a bundle report to dist/bundle-analysis.html).

electron-builder.json — packaging

Option Value
appId com.electron.app
directories.output dist
win.target nsis, zip
linux.target snap
nsis non-one-click, per-user, installation dir changeable

Files bundled into the app: build/mainmain, src/main/staticstatic, build/rendererrenderer.

Extra resources (shipped alongside, used by the runtime migration/seed system): the generated Prisma client (build/main/prisma), plus prisma/migrations and prisma/seeds.

See Build and Packaging for the full build pipeline.

prisma.config.ts — Prisma CLI

Points the Prisma CLI at the schema and the dev datasource:

export default defineConfig({
  schema: 'src/main/prisma/schema.prisma',
  datasource: { url: `file:${path.join(process.cwd(), 'dev.db')}` },
})

Details and the runtime DB paths are covered in Database.

playwright.config.ts — tests

Option Value
testDir ./tests/e2e
globalSetup ./tests/global-setup.ts (compiles the main process)
timeout 100000 ms
retries 1
workers 1 (single worker — the tests share one Electron instance and DB)
headless true

More in Testing.

Other config files

File Purpose
.prettierrc.json Formatting rules (applied via lint-staged)
postcss.config.mjs PostCSS / Tailwind pipeline
sonar-project.properties SonarQube: project key nextask, sources src, host localhost:9000
tsconfig.json (per area) Separate TypeScript configs for main, preload, prisma, and renderer
.husky/ Git hooks (see Contributing)

Startup constants (src/main/constants.ts)

Derived at runtime, not user-configurable, but useful to know:

Constant Meaning
IS_DEV NODE_ENV === 'development'
IS_TEST --test present in process.argv (used by Playwright to hide the window & skip DevTools)
DB_PATH dev.db (dev) or app.db in user-data (prod)
MIGRATIONS_PATH / SEEDS_PATH Resolve to src/main/prisma/... in dev, or the packaged resources/prisma/... in prod

Clone this wiki locally