Repository navigation
Getting Started and Deployment
This guide details how to configure, develop, build, and deploy the entire Muninn ecosystem across Cloudflare Workers, Next.js Cloudflare Pages, Neon PostgreSQL, and Android mobile hardware.
flowchart LR
subgraph ClientLayer["Client Interfaces"]
WebClient["Next.js Web (Cloudflare Pages)"]
TabletClient["Android Tablet APK (Native)"]
end
subgraph EdgeLayer["Edge Compute Layer"]
Worker["Cloudflare Worker (Hono REST & WS API)"]
end
subgraph ServiceLayer["External AI Services"]
AAI["AssemblyAI (Realtime 24kHz & LLM)"]
end
subgraph DataLayer["Storage Layer"]
Neon["Neon Serverless PostgreSQL (pgvector)"]
LocalPrefs["Android SharedPreferences (Offline)"]
end
WebClient -->|HTTPS / WSS| Worker
TabletClient -->|Local Storage| LocalPrefs
TabletClient -.->|Optional Sync| Worker
Worker -->|WSS Audio & Chunks| AAI
Worker -->|SQL over HTTP / WebSocket| Neon
Before setting up Muninn locally, ensure the following tooling is installed:
- Node.js: Version 20.x or higher
-
Package Manager:
pnpm(version 9+) ornpm -
Wrangler CLI: Cloudflare developer tooling (
npm install -g wrangler) -
Neon Account: A serverless Postgres database with the
pgvectorextension enabled - AssemblyAI Key: API token from assemblyai.com
- JDK & Android SDK (Optional, for Android build): Java JDK 17 and Android Studio
Create a .dev.vars file in the backend/ directory for local development with Wrangler:
# Neon PostgreSQL pooled connection string
DATABASE_URL="postgres://username:password@ep-sample-project.region.neon.tech/neondb?sslmode=require"
# AssemblyAI API key for transcription and LLM inference
ASSEMBLYAI_API_KEY="your_assemblyai_api_key_here"
# Runtime Environment
NODE_ENV="development"In production on Cloudflare Workers, configure secrets via Wrangler:
wrangler secret put DATABASE_URL
wrangler secret put ASSEMBLYAI_API_KEYCreate .env.local inside frontend/:
# Backend Edge API URL (local dev or production)
NEXT_PUBLIC_API_URL="http://127.0.0.1:8787"
# Production Pages configuration points to:
# NEXT_PUBLIC_API_URL="https://muninn-api.kshitiz23kumar.workers.dev"Execute the schema migrations on your Neon database:
# Using psql or Neon SQL Editor
psql "$DATABASE_URL" -f backend/src/db/schema.sqlThe migration automatically creates:
-
vectorextension (CREATE EXTENSION IF NOT EXISTS vector;) -
sessions,claims,claim_relations,resurfacing_alerts,activity_log, andaudio_chunkstables - Cascade foreign keys and compound timestamp indexes
cd backend
pnpm install
pnpm devThe Hono backend will run at http://127.0.0.1:8787.
cd frontend
pnpm install
pnpm devThe Next.js client interface will open at http://localhost:3000.
cd backend
wrangler deployOutputs the global edge endpoint (e.g., https://muninn-api.kshitiz23kumar.workers.dev).
cd frontend
pnpm build
npx wrangler pages deploy out --project-name muninnDeploys static edge-rendered assets to Cloudflare Pages (e.g., https://muninn-nmk.pages.dev).
cd android
./gradlew assembleReleaseThe signed APK will be generated at android/app/build/outputs/apk/release/app-release.apk.
Install onto your tablet or device via:
adb install android/app/build/outputs/apk/release/app-release.apkVerify your edge deployment status:
curl -i https://muninn-api.kshitiz23kumar.workers.dev/healthExpected response:
{"status":"healthy","version":"1.5.0","timestamp":"2026-09-30T12:00:00.000Z"}Muninn: A Living Memory for Technical Work. Engineered by Erebus.
Licensed under MIT. Production app live at muninn-nmk.pages.dev.