Litestore · Developer docs
Getting started

Commands

Every Litestore command is a package.json script that you run with bun run, and each script covers a task such as building, testing or seeding.

Every command listed here is a script in package.json, and you run it with bun run <name> from the repository root. The packageManager field pins Bun 1.2.2, and the CI workflow installs the same version, so your machine and CI run the same tooling.

Development server

ScriptWhat it runsNotes
devnext dev -p 3000 --turbopack --disable-source-mapsThe storefront opens on port 3000 and the admin at /admin.
emailemail devIt starts the React Email preview server. The templates live in modules/email/templates/, and email dev looks in emails/ unless you pass --dir modules/email/templates.
iconsscripts/build-icons.tsIt writes the icon sprite (public/icons/sprite.svg) and platform/types/icons.d.ts.

Git ignores the icon sprite and platform/types/icons.d.ts, so on a fresh clone you need to run bun run icons once before typecheck will pass.

Build

ScriptWhat it runsNotes
buildnext buildIt runs with a 6 GB Node heap. The prebuild hook runs icons first.
startnext start -p 3000It serves the production build on port 3000.

Database

ScriptWhat it runsNotes
db:generateprisma generateThe postinstall hook runs it after every bun install.
db:migrateprisma migrate dev --create-onlyIt writes a new migration file from your schema changes but doesn't apply it.
db:deployprisma migrate deployIt applies the migrations that haven't run yet. Use it in production and after db:migrate.
db:resetprisma migrate resetIt drops the database, applies every migration again and then runs the seed.
db:seedbun prisma/seed.tsIt fills the database with demo data.
db:studioprisma studio --port 5556It opens Prisma Studio, a browser view of the database tables.

To change the schema, edit prisma/schema.prisma and create a migration, then apply it:

bun run db:migrate
bun run db:deploy

Read the migration file before you apply it, because --create-only leaves time to edit the SQL first.

Linting and formatting

ScriptWhat it runsNotes
lintbiome check --write .It lints and formats the code and writes the fixes it can make to your files.
formatbiome format --write .It only formats the code.

Litestore uses Biome for both linting and formatting, and the rules are in biome.json.

Type checking

ScriptWhat it runsNotes
typechecktsc --noEmitIt checks the types across the project with a 5 GB Node heap.

On a machine with little memory, stop the dev server before you run it.

Tests

ScriptWhat it runsNotes
testvitest runIt runs the unit tests once. They mock the database, so they don't need Postgres.
test:integrationvitest run --config vitest.integration.config.tsIt runs the tests in test/integration/ against a real Postgres database called litestore_test. Set TEST_DATABASE_URL to use a different one.
test:e2etest/e2e/reset-db.ts, then playwright testIt resets the test database and runs the Playwright browser tests in test/e2e/.
eval:aitest/evals/run.tsIt runs the AI assistant against the test cases in test/evals/cases.ts. It needs an AI provider key.

Continuous integration

bun run verify

verify runs typecheck, lint and test one after another and stops at the first failure. The GitHub Actions workflow in .github/workflows/verify.yml runs it on every push to main and on every pull request, after it installs dependencies and runs icons.

Run verify before you push, so you find the same failures CI would find.

On this page