Skip to content

Local development

Run Amlexia workers and the dashboard against a local D1 database.

Prerequisites

  • Node.js 20+
  • pnpm (or use npx / npm per package)
  • Cloudflare account (for remote D1 only)

Clone and install

bash
git clone https://github.com/Amlexia/Amlexia.git
cd Amlexia   # or your monorepo path
pnpm install

Apply local migrations

bash
npx wrangler d1 migrations apply amlexia-db --local \
  --config workers/api/wrangler.toml \
  --persist-to .wrangler/shared-state

Or from repo root (if pnpm available):

bash
pnpm db:migrate

Start workers

bash
pnpm dev:workers
# API + ingest typically on http://localhost:8787

Point your app at local ingest

env
AMLEXIA_SDK_KEY=am_...        # from seeded or dashboard project
AMLEXIA_INGEST_URL=http://localhost:8787
AMLEXIA_ENVIRONMENT=development

Start dashboard (optional)

bash
cd apps/web
npm run dev
# http://localhost:5173

Set in apps/web/.env:

env
VITE_API_URL=http://localhost:8787
VITE_INGEST_URL=http://localhost:8787
VITE_CLERK_PUBLISHABLE_KEY=pk_test_...

Start docs site (optional)

bash
cd apps/docs
npm run dev
# http://localhost:5173 (or next free port)

Seed data (optional)

bash
pnpm seed

After pnpm db:migrate.

Verify

bash
curl http://localhost:8787/health
npx amlexia health   # with AMLEXIA_INGEST_URL=http://localhost:8787

Docs site local preview

Same repo: apps/docs — edits hot-reload at /guide/full-setup.