Skip to content

Latest commit

 

History

History
120 lines (83 loc) · 2.53 KB

DEVELOPMENT.md

File metadata and controls

120 lines (83 loc) · 2.53 KB

Development

Requirements

  • Docker and Docker Compose v2, or
  • Node.js 24 (see .nvmrc) and a running Meilisearch instance

Development (Docker)

  1. Clone the repo:
git clone https://github.com/OneBacklog/OneArctic
cd OneArctic
  1. Generate secrets and create data folders:
APP_ENV=development bash setup.sh
  1. Start the services:
docker compose -f compose.dev.yaml up -d --build

The app will run at http://localhost:3000 with hot reload on app/ and server/.

  1. After the app is running, generate your OTP secret:
docker compose -f compose.dev.yaml run --rm setup-auth
  1. Reset the OTP secret (generates a new key) if somehow you lose it:
docker compose -f compose.dev.yaml run --rm -e RESET=1 setup-auth

Common Commands

docker compose -f compose.dev.yaml restart app
docker compose -f compose.dev.yaml logs -f app
docker compose -f compose.dev.yaml down

Development (Node.js)

  1. Install dependencies:
npm install
  1. Start Meilisearch:
docker run -d --name onearctic-meili -p 7700:7700 \
  -e MEILI_MASTER_KEY=dev-master-key -e MEILI_NO_ANALYTICS=true \
  getmeili/meilisearch:v1.38.2
  1. Create .env from .env.example with local paths:
JWT_SECRET=<output of: openssl rand -hex 32>
MEILI_MASTER_KEY=dev-master-key
COOKIE_SECURE=false
DATABASE_PATH=./data/db/onearctic.db
FILES_PATH=./data/files
MEILISEARCH_HOST=http://localhost:7700
  1. Start the dev server, then create your OTP secret in another terminal:
npm run dev
node --env-file=.env scripts/setup-auth.mjs

Checks

Run these before opening a pull request (CI runs them too):

npm run lint        # ESLint (use lint:fix to auto-fix)
npm run typecheck   # vue-tsc
npm test            # unit tests and API tests against a production build
npm run build       # production build

Tests

  • test/unit/ covers pure logic (schemas, file type detection, login throttling). Run just these with npm run test:unit.
  • test/e2e/ builds the app, starts it on a temporary database and exercises the API.
  • Search tests are skipped unless a Meilisearch instance is available:
MEILISEARCH_TEST_HOST=http://localhost:7700 MEILISEARCH_TEST_KEY=dev-master-key npm test

Database Migrations

Migrations in server/database/migrations/ run automatically on startup.

Generate a migration after editing server/database/schema.ts:

npm run db:generate -- --name=<migration-name>

Open the DB inspector:

npm run db:studio