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
| Script | Description |
|---|---|
install | Installs dependencies. |
setup | Runs the initial project setup, including git config, Playwright installation, secret syncing, migrations, and seeding. |
sync-secrets | Syncs environment secrets. Use --env=production for production secrets. |
Development
| Script | Description |
|---|---|
dev | Starts the full development environment (frontend + backend services). |
dev:frontend | Starts only the Next.js frontend with Turbopack. |
dev:frontend:webpack | Starts only the Next.js frontend with Webpack (fallback). |
dev:backend | Starts backend services (PostgreSQL, etc.) using Docker Compose. |
start | Starts the production server (requires build first). |
Database
These scripts use Drizzle Kit to manage the database.
| Script | Description |
|---|---|
db:generate | Generates SQL migrations based on schema changes. |
db:migrate | Applies pending migrations. Use --env=production for production migrations. |
db:seed | Seeds the database with initial data. |
db:drop | Drops the database schema (Caution!). |
db:status | Introspects the database to check for schema drift. |
db:studio | Opens Drizzle Studio, a visual database editor, in your browser. |
Testing
| Script | Description |
|---|---|
test | Runs unit tests using Vitest. |
test:coverage | Runs unit tests and generates a coverage report. |
test:watch | Runs unit tests in watch mode. |
test-e2e | Runs end-to-end tests using Playwright. |
test-e2e:watch | Runs Playwright tests in watch mode. |
test-e2e:ui | Opens the Playwright UI for interactive testing. |
Build & Generators
| Script | Description |
|---|---|
build | Builds the application for production (includes codegen and postbuild steps). |
postbuild | Runs postbuild scripts. |
codegen | Runs code generators. |
codegen:watch | Runs code generators in watch mode. |
plop | Runs the Plop generator scaffolding tool. |
Code Quality
| Script | Description |
|---|---|
lint | Runs ESLint to catch code errors. |
format | Formats code using Prettier. |
style | Runs Stylelint to lint CSS/SCSS files. |
analyze-bundle | Analyzes the production bundle size. |
analyze-routes | Analyzes Next.js routes using next-lens. |
prepare | Sets up Husky git hooks. |
Last updated on