Local development
Run Amlexia workers and the dashboard against a local D1 database.
Prerequisites
- Node.js 20+
pnpm(or usenpx/npmper 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 installApply local migrations
bash
npx wrangler d1 migrations apply amlexia-db --local \
--config workers/api/wrangler.toml \
--persist-to .wrangler/shared-stateOr from repo root (if pnpm available):
bash
pnpm db:migrateStart workers
bash
pnpm dev:workers
# API + ingest typically on http://localhost:8787Point your app at local ingest
env
AMLEXIA_SDK_KEY=am_... # from seeded or dashboard project
AMLEXIA_INGEST_URL=http://localhost:8787
AMLEXIA_ENVIRONMENT=developmentStart dashboard (optional)
bash
cd apps/web
npm run dev
# http://localhost:5173Set 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 seedAfter pnpm db:migrate.
Verify
bash
curl http://localhost:8787/health
npx amlexia health # with AMLEXIA_INGEST_URL=http://localhost:8787Docs site local preview
Same repo: apps/docs — edits hot-reload at /guide/full-setup.
