You need Node 22 or newer and pnpm 10.
git clone https://github.com/playlikeboy/daksha
cd daksha
pnpm install
pnpm devOpen http://localhost:3000. The landing page needs no accounts. Sign-in, the database, file storage and the AI gateway need the Neon values; see "Running locally" below.
Create each one only when its phase starts. Names of the variables are in .env.example.
| Phase | Service | For | Variables |
|---|---|---|---|
| 1 | Neon: Postgres with pgvector | Database | DATABASE_URL, DATABASE_URL_UNPOOLED |
| 1 | Neon Auth | Sign-in | NEON_AUTH_* |
| 1 | Neon Object Storage | Original files | AWS_* |
| 1 | Anthropic | Answers (tried first) | ANTHROPIC_API_KEY |
| 1 | Neon AI Gateway (needs prepaid credits) | Answers if Anthropic fails; later embeddings and reading photos | NEON_AI_GATEWAY_* |
| 1 | Cloudflare | Hosting (Workers) and Hyperdrive | CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN in your shell |
| 1 | A speech-to-text provider | Voice notes to text | add when chosen |
| 1 | Inngest | Background jobs | add when chosen |
| 3 | LiveKit | Live voice | LIVEKIT_* |
| 3 | A text-to-speech provider | Daksha's voice | add when chosen |
| 4 | Composio | Connected apps | COMPOSIO_API_KEY |
| 4 | Google Cloud project | Calendar access | add when needed |
| 5 | A payments provider | Plans | add when chosen |
When you add a variable, add its name (never its value) to .env.example in the same change.
- Local:
.envin the repo root, written byneon env pull. It is git-ignored. - Deployed: the host's secret store (
wrangler secret put). - Make
NEON_AUTH_COOKIE_SECRETandBYOK_ENCRYPTION_KEYwith a real random generator, for exampleopenssl rand -base64 32. - If a secret is ever committed, treat it as leaked: replace it at once, then remove it from history.
You need Node 22 or newer, pnpm 10 and the Neon CLI (npm i -g neon).
pnpm install
neon login # opens a browser to sign in to Neon
neon env pull # in the repo root; writes the Neon values into .envThen add two values Neon does not make for you:
echo "NEON_AUTH_COOKIE_SECRET=\"$(openssl rand -base64 32)\"" >> .env
echo 'ANTHROPIC_API_KEY="<your Anthropic API key>"' >> .envCreate the tables (only needed once per database, and after each new migration):
pnpm --filter @debo/db db:migrateStart the app:
pnpm dev- http://localhost:3000 is the landing page.
- http://localhost:3000/auth/sign-up and
/auth/sign-inare the sign-in pages. /homeneeds you to be signed in. There you can write journal entries, ask Daksha about them ("Ask Daksha about your entries"), and delete entries or your whole account.- http://localhost:3000/api/health checks the database, file storage and AI gateway. It only works in development; on the live site it does not exist.
Neon Auth does not send sign-in emails itself. It calls our webhook, which sends them from mail.daksha.life through Cloudflare (decision 23).
- Worker secrets:
CLOUDFLARE_ACCOUNT_IDandCLOUDFLARE_API_TOKEN(a token that can use Email Sending). - Neon Auth settings, set once per branch with the Neon CLI:
neon neon-auth config webhook update --enabled --url https://daksha.life/api/neon-auth/webhook --enabled-events send.otp send.magic_link --timeout 5
neon neon-auth config email-password update --email-verification-method otp --require-email-verification --send-verification-email-on-sign-up --send-verification-email-on-sign-in --auto-sign-in-after-verification
neon api /projects/sweet-dream-71477162/branches/<branch-id>/auth/plugins/magic-link -X PATCH -F enabled=true -F expires_in=10 -F disable_sign_up=true- The webhook only works on a public HTTPS address, so locally (
pnpm dev) codes and links still go out through the deployed site's webhook. Turn the webhook off (--no-enabled) to fall back to Neon's shared sender.
Tables are defined in packages/db/src/schema.ts and changed through Drizzle migrations in packages/db/migrations.
- Edit
packages/db/src/schema.ts. - Make the migration:
pnpm --filter @debo/db db:generate. - Read the new SQL file before going on. It must never create, change or drop anything in the
neon_authschema. That schema belongs to Neon Auth. Drizzle tried toCREATE TABLE "neon_auth"."user"in the first migration, and that line was removed by hand. Check every new migration for the same. - Apply it:
pnpm --filter @debo/db db:migrate. It readsDATABASE_URL_UNPOOLEDfrom the repo-root.env.
The deploy workflow also runs migrations.
The test below drives the old web screens, which now redirect to my.daksha.life, so it no longer passes. Keep it only as a reference until it is replaced.
apps/web/e2e/journal.spec.ts walks through the whole loop in a real browser with a throwaway account: sign up, write an entry, ask about it (expects an answer with a source chip), ask something it cannot know (expects "I don't have anything about that yet"), delete the entry, delete the account.
npx playwright install chromium # once, in apps/web
pnpm --filter @debo/web test:e2e # starts `next dev` on port 3000
BASE_URL=https://daksha.life pnpm --filter @debo/web test:e2e # against the live siteIt uses made-up data and deletes its own account at the end.
The web app runs on Cloudflare Workers through the OpenNext adapter (see decision 11 in DECISIONS.md).
Normally you do not deploy by hand. Every push to main runs .github/workflows/deploy.yml, which installs with pnpm, typechecks, then runs bun run deploy in apps/web on Linux. You can also start it from the Actions tab ("Deploy", then "Run workflow"). It needs three GitHub repository secrets: CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID and DATABASE_URL_UNPOOLED.
To deploy by hand (on Windows this needs Developer Mode or WSL, because OpenNext creates symlinks):
pnpm --filter @debo/web run deployThat builds the app with OpenNext and runs wrangler deploy. Wrangler needs CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your shell, or run npx wrangler login first.
- The Worker is called
debo-weband servesdaksha.life, set inapps/web/wrangler.jsonc, plusdebo.lifeandwww.debo.lifefrom before the rename.apps/web/src/proxy.ts(rules insrc/lib/host-redirect.ts) sends/and other pages to the same path on the landing page at https://www.daksha.life, and the old/home/*and/auth/*screens to https://my.daksha.life, all with a 307./privacy, files likerobots.txt, and every/api/*route (sign-in email webhook, voice, export, delete account) are served. Ondebo.lifeandwww.debo.life, pages go to daksha.life, and/api/*is still served. The landing page itself is the separate Workerdebo-site(apps/site, workflowdeploy-site.yml) at www.daksha.life. Every host and what it does is inDOMAINS.md. - The database is reached through a Cloudflare Hyperdrive binding called
HYPERDRIVE(configdebo-db). Query caching is off on that config (npx wrangler hyperdrive update <id> --caching-disabled true). With caching on, a person's new entry did not show up for up to a minute, and their journal query results would be cached at the edge. Keep it off. This is a Cloudflare setting, not a file in the repo. - Secrets are set once per value with
npx wrangler secret put <NAME>inapps/web. Use the names in.env.example. Never put them inwrangler.jsonc. The Worker needs:NEON_AUTH_BASE_URL,NEON_AUTH_COOKIE_SECRET,AWS_ENDPOINT_URL_S3,AWS_REGION,AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,NEON_AI_GATEWAY_BASE_URL,NEON_AI_GATEWAY_TOKENandANTHROPIC_API_KEY. Optional:DAILY_TOKEN_LIMIT(tokens per person per day on our key, default 40,000).
Set once on GitHub:
- Description: "Daksha: a friendly assistant that remembers your life."
- Website: https://www.daksha.life
- Topics:
ai-assistant,personal-memory,journaling,nextjs,typescript,mcp,voice-assistant,pgvector - Turn on private vulnerability reporting and dependency alerts.
With the GitHub CLI:
gh repo edit playlikeboy/daksha \
--description "Daksha: a friendly assistant that remembers your life." \
--homepage "https://www.daksha.life" \
--add-topic ai-assistant,personal-memory,journaling,nextjs,typescript,mcp,voice-assistant,pgvector