Skip to content

Scripts Reference

ElyOS is a Bun workspaces based monorepo. The root package.json contains main commands that invoke workspace package scripts.

elyos-core/
├── package.json # Root scripts (using bun --filter)
├── apps/
│ └── web/
│ └── package.json # @elyos/core scripts
└── packages/
└── database/
└── package.json # @elyos/database scripts

Important: Root scripts can be run from anywhere in the monorepo. Scripts specific to apps/web must be run from the apps/web directory.


Location: Root Runs: apps/webdev script

Starts SvelteKit dev server with local .env file (without Varlock).

Terminál
bun app:dev

What it does:

  • Loads ../../.env file (root .env)
  • Starts Vite dev server (http://localhost:5173)
  • Hot module replacement (HMR) enabled

When to use: Local development, fast iteration.


Location: Root Runs: apps/webdev:varlock script

Starts SvelteKit dev server with Varlock (Infisical secrets).

Terminál
bun app:dev:varlock

What it does:

  • Varlock loads secrets from Infisical
  • Validates environment variables
  • Starts Vite dev server

When to use: Testing configuration similar to production.


Location: Root Runs: apps/webbuild script

Creates production build.

Terminál
bun app:build

What it does:

  • SvelteKit production build (vite build)
  • Adapter-node output: apps/web/build/
  • Static assets: apps/web/build/client/

Location: apps/web Runs: preview script

Starts production build locally.

Terminál
cd apps/web
bun preview

What it does:

  • Starts Express + Socket.IO server (server.js)
  • Serves built application
  • Port: process.env.PORT or 3000

Prerequisite: Run bun app:build first.


Location: Root Runs: apps/webcheck script

TypeScript and Svelte type checking.

Terminál
bun app:check

What it does:

  • svelte-kit sync — generates SvelteKit types
  • svelte-check — checks Svelte components
  • tsc — TypeScript type checking

When to use: Before commit, in CI/CD.


Location: Root Runs: packages/databasedb:init script

First startup — complete database initialization.

Terminál
bun db:init

What it does:

  1. db:generate — generate migrations
  2. db:migrate — run migrations
  3. db:seed — load seed data

When to use: First installation or after complete reset.


Location: Root Runs: packages/databasedb:generate script

Generate Drizzle migrations from schema changes.

Terminál
bun db:generate

What it does:

  • Compares src/schemas/ files with database
  • Generates SQL migration files in drizzle/ folder

When to use: After schema modification (new table, column, index, etc.).


Location: Root Runs: packages/databasedb:migrate script

Run pending migrations.

Terminál
bun db:migrate

What it does:

  • Runs all new migrations from drizzle/ folder
  • Updates __drizzle_migrations table

Location: Root Runs: packages/databasedb:seed script

Load seed data.

Terminál
bun db:seed

What it does:

  • Runs seed scripts from src/seeds/ folder
  • Creates admin user (based on ADMIN_USER_EMAIL)
  • Loads default applications, roles, etc.

Location: Root Runs: packages/databasedb:studio script

Open Drizzle Studio.

Terminál
bun db:studio

What it does:

  • Starts Drizzle Studio web interface
  • Opens in browser: https://local.drizzle.studio
  • Visual database browser and editor

Location: Root Runs: packages/databasedb:reset script

Complete database reset.

Terminál
bun db:reset

What it does:

  1. Drops all tables
  2. Re-runs migrations
  3. Loads seed data

Warning: All data is lost!


Location: Root

Start PostgreSQL container only.

Terminál
bun docker:db

What it does:

  • Starts postgres service
  • Port: 5432
  • Data: docker/postgres-data/ (persistent)

When to use: Local development, database only.


Location: Root

Start full stack (ElyOS + PostgreSQL).

Terminál
bun docker:up

What it does:

  • Builds Docker image
  • Starts app and postgres services
  • Detached mode (-d)

Available at: http://localhost:3000


Location: Root

Stop all containers.

Terminál
bun docker:down

What it does:

  • Stops and removes containers
  • Volumes remain (data not lost)

Location: Root

Follow container logs.

Terminál
bun docker:logs

What it does:

  • Real-time container logs
  • Ctrl+C to exit

Location: apps/web

Run all tests once.

Terminál
cd apps/web
bun test

What it does:

  • Vitest unit tests
  • --run mode (not watch)

Location: apps/web

Run tests in watch mode.

Terminál
cd apps/web
bun test:watch

What it does:

  • Re-runs tests on file changes
  • Interactive mode

Location: apps/web

Run property-based tests only.

Terminál
cd apps/web
bun test:pbt

What it does:

  • Runs tests containing “Property”
  • fast-check based tests

Location: apps/web

Prettier and ESLint check.

Terminál
cd apps/web
bun lint

What it does:

  • prettier --check . — formatting check
  • eslint . — code quality check

Location: apps/web

Automatic code formatting.

Terminál
cd apps/web
bun format

What it does:

  • prettier --write . — formats all files

Terminál
# 1. Dependencies
bun install
# 2. Env file
cp .env.example .env
# Edit .env file
# 3. Database
bun docker:db
bun db:init
# 4. Dev server
bun app:dev
Terminál
# 1. Modify packages/database/src/schemas/ files
# 2. Generate migration
bun db:generate
# 3. Run migration
bun db:migrate
# 4. (Optional) Re-run seed
bun db:seed
Terminál
# 1. Build
bun app:build
# 2. Preview
cd apps/web
bun preview
Terminál
# 1. Env file (bootstrap credentials only)
cp .env.example .env
# INFISICAL_CLIENT_ID and INFISICAL_CLIENT_SECRET
# 2. Start
bun docker:up
# 3. Logs
bun docker:logs