Skip to main content

Development Setup

Prerequisites

  • Node.js >= 24 and pnpm >= 10 — or just install mise and run mise install to get everything, including the Python toolchain for the name generator

Quick Start

git clone https://github.com/Nightbr/little-origin.git
cd little-origin
pnpm install

# Create .env at the repository root
echo "JWT_SECRET=development-secret-for-local-testing" > .env

pnpm dev

The SQLite database is created automatically at .data/database.db, and the app walks you through onboarding on first visit.

Everyday Commands

pnpm dev              # web + api in watch mode
pnpm test # run all tests (Vitest)
pnpm lint # lint (Biome)
pnpm format # format + organize imports
pnpm typecheck # TypeScript checks
pnpm deps:check # workspace version mismatches
pnpm deps:unused # unused dependencies (Knip)

Run a single app with pnpm --filter @little-origin/api dev (or web).

Before committing, run the same check as CI:

pnpm lint && pnpm typecheck && pnpm deps:check && pnpm deps:unused

Database

Schemas live in packages/core; migrations apply automatically when the API starts. After changing a schema:

cd apps/api
pnpm db:generate # create migration
pnpm db:migrate # apply it

Inspect the data anytime with sqlite3 .data/database.db.

Common Tasks

  • New query/mutation — add it to apps/api/src/graphql/typeDefs.ts, implement the resolver and service, test in the Playground
  • New table — edit the schema in packages/core, then pnpm db:generate + pnpm db:migrate
  • Frontend routes — add a file under apps/web/src/routes/; TanStack Router regenerates the route tree
  • Name data — see Name Data & Generator

Troubleshooting

ProblemFix
Port already in uselsof -ti:3000 | xargs kill -9
better-sqlite3 / argon2 build errorspnpm rebuild (macOS: xcode-select --install)
Dependency conflictsrm -rf node_modules **/node_modules && pnpm install
Database errorsrm .data/database.db and restart — it's recreated

Next Steps