Relay is an approval-first AI productivity command center for tasks, notes, reminders, calendars, email drafts, notifications, workouts, and nutrition logs.
- Vision-inspired responsive dashboard with reduced-motion support and theme options
- Real email/password accounts with scrypt password hashing and expiring HTTP-only sessions
- User-isolated PostgreSQL persistence through Prisma 7, with a file-backed local development mode
- Local Ollama assistant that creates Zod-validated proposals instead of silently changing data
- Editable confirmation queue with deterministic risk levels and an audit trail
- Tasks, notes, reminders, calendar events, notification ranking, and email drafts
- Per-user Google OAuth with encrypted tokens, Gmail draft creation, Calendar event creation, token refresh, disconnect, and retry states
- Review-first browser voice input
- Workout history, weekly movement summaries, calorie and optional macro tracking
- Health endpoint, structured server errors, security headers, CI, Docker, and Vercel configuration
Calls and call-related data have been removed from the product.
- Next.js 15, React 19, TypeScript, Tailwind CSS
- PostgreSQL, Prisma 7,
@prisma/adapter-pg - Local Ollama using
qwen3:1.7bby default - Zod, Playwright, and Axe
This mode is best for an 8 GB Mac and does not require PostgreSQL.
git clone https://github.com/ramih1/Relay.git
cd Relay
pnpm install
cp .env.example .env.local
ollama pull qwen3:1.7bRemove or leave DATABASE_URL blank in .env.local, then run Ollama and Relay in separate terminals:
ollama servepnpm devOpen http://localhost:3000, create an account, and use Relay. Local passwords are scrypt-hashed, sessions are random and HTTP-only, and each account receives a separate ignored workspace file under data/.
Production requires PostgreSQL. For local PostgreSQL with Docker:
docker compose up -d postgres
cp .env.example .env.local
pnpm db:migrate
pnpm devSet these values in .env.local:
DATABASE_URL="postgresql://relay:relay@localhost:5432/relay?schema=public"
RELAY_ENCRYPTION_KEY="replace-with-output-from-openssl-rand-base64-32"Supabase, Neon, or another PostgreSQL provider can be used by replacing DATABASE_URL. Run pnpm db:migrate against the selected database before starting the app.
Create a Google OAuth web client with this local redirect URI:
http://localhost:3000/api/google/callbackConfigure:
GOOGLE_CLIENT_ID="..."
GOOGLE_CLIENT_SECRET="..."
GOOGLE_OAUTH_REDIRECT_URI="http://localhost:3000/api/google/callback"
NEXT_PUBLIC_GOOGLE_OAUTH_CONFIGURED="1"Restart Relay, open Settings, and choose Connect Google Workspace. Relay requests only Gmail compose and Calendar event scopes. Tokens are AES-256-GCM encrypted with RELAY_ENCRYPTION_KEY and stored per user. External email/calendar actions still require confirmation.
DATABASE_URL: direct PostgreSQL connection stringRELAY_ENCRYPTION_KEY: high-entropy key for Google credentialsGOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET,GOOGLE_OAUTH_REDIRECT_URI: required only when Google sync is enabledOLLAMA_BASE_URL,OLLAMA_MODEL: local or privately hosted Ollama endpoint and model
Production startup fails closed when DATABASE_URL or RELAY_ENCRYPTION_KEY is missing. ALLOW_FILE_STORAGE=1 is an explicit single-host demo override and should not be used for normal deployment.
pnpm dev
pnpm build
pnpm start
pnpm typecheck
pnpm lint
pnpm test
pnpm test:e2e
pnpm run ci
pnpm demo:check
pnpm prisma:generate
pnpm prisma:format
pnpm db:migrate
pnpm db:studioThe automated suite covers:
- AI proposal and approval safety
- strict server mutation validation and same-origin protection
- encrypted Google token round trips
- desktop and mobile rendering
- real registration and session flow
- isolation between two user accounts
- workout and meal persistence
- Axe serious/critical accessibility violations
- optimized production compilation
/api/health reports application and database readiness without exposing secrets. /api/ai/health reports the configured Ollama connection.
GitHub Actions runs migrations, type checking, linting, unit tests, and the production build against PostgreSQL. Dockerfile produces a non-root standalone Next.js image. vercel.json supports Vercel builds; configure the production environment variables and run Prisma migrations as part of release setup.
app/api/auth/: registration, login, logout, and session endpointsapp/api/google/: authenticated Google OAuth lifecyclecomponents/relay-app.tsx: responsive application sectionscomponents/dashboard/vision-dashboard.tsx: dashboard compositionlib/server/auth.ts: password and session securitylib/server/relay-store.ts: user-scoped mutations and persistencelib/server/relay-mutation-schema.ts: strict API input boundarylib/server/relay-secrets.ts: encrypted per-user integration credentialsprisma/schema.prisma: production data modelprisma/migrations/: deployable PostgreSQL migrationstest/e2e/: browser, accessibility, isolation, and persistence coverage