Skip to Content
EnScripts

Scripts

Lynx includes a variety of scripts to help with development, testing, and deployment. These can be run using pnpm <script-name>.

In order to keep consistency it is required to use pnpm.

Environment Flag

Many scripts support the --env flag to specify the target environment.

  • --env=development: Loads .env.development (Default)
  • --env=production: Loads .env.production
  • --env=test: Loads .env.test

Example: pnpm db:migrate --env=production

Setup & Infrastructure

ScriptDescription
installInstalls dependencies.
setupRuns the initial project setup, including git config, Playwright installation, secret syncing, migrations, and seeding.
sync-secretsSyncs environment secrets. Use --env=production for production secrets.

Development

ScriptDescription
devStarts the full development environment (frontend + backend services).
dev:frontendStarts only the Next.js frontend with Turbopack.
dev:frontend:webpackStarts only the Next.js frontend with Webpack (fallback).
dev:backendStarts backend services (PostgreSQL, etc.) using Docker Compose.
startStarts the production server (requires build first).

Database

These scripts use Drizzle Kit to manage the database.

ScriptDescription
db:generateGenerates SQL migrations based on schema changes.
db:migrateApplies pending migrations. Use --env=production for production migrations.
db:seedSeeds the database with initial data.
db:dropDrops the database schema (Caution!).
db:statusIntrospects the database to check for schema drift.
db:studioOpens Drizzle Studio, a visual database editor, in your browser.

Testing

ScriptDescription
testRuns unit tests using Vitest.
test:coverageRuns unit tests and generates a coverage report.
test:watchRuns unit tests in watch mode.
test-e2eRuns end-to-end tests using Playwright.
test-e2e:watchRuns Playwright tests in watch mode.
test-e2e:uiOpens the Playwright UI for interactive testing.

Build & Generators

ScriptDescription
buildBuilds the application for production (includes codegen and postbuild steps).
postbuildRuns postbuild scripts.
codegenRuns code generators.
codegen:watchRuns code generators in watch mode.
plopRuns the Plop generator scaffolding tool.

Code Quality

ScriptDescription
lintRuns ESLint to catch code errors.
formatFormats code using Prettier.
styleRuns Stylelint to lint CSS/SCSS files.
analyze-bundleAnalyzes the production bundle size.
analyze-routesAnalyzes Next.js routes using next-lens.
prepareSets up Husky git hooks.
Last updated on