An AI-powered conversational platform built with Next.js 15 that integrates real-time chat/video, background agents, and modern auth. The app leverages OpenAI/Google GenAI, Stream (chat/video), Inngest (events/agents), Drizzle ORM with Neon Postgres, and tRPC for type-safe APIs.
- Next.js 15 App Router with React 19 and Tailwind CSS v4.
- Type-safe APIs using
tRPCandzod. - DB with Drizzle ORM (Neon Postgres) and handy dev tools (
drizzle-kit studio). - Background jobs & agents powered by
inngestand@inngest/agent-kit. - LLM integrations:
openaiand@google/genai. - Realtime chat & video via Stream (
stream-chat,@stream-io/video-react-sdk). - Authentication with
better-authand UI utilities. - Observability with
winstonand OpenTelemetry transport.
- Front-end: Next.js 15, React 19, Tailwind CSS v4
- Server: Next.js API Routes (
src/app/api/**), tRPC - Database: Drizzle ORM, Neon Postgres
- Background: Inngest events/functions (
src/inngest/**) - Realtime: Stream Chat/Video SDKs
- Auth: better-auth, @polar-sh/better-auth
- AI: OpenAI SDK, Google GenAI SDK
src/app/— Next.js routes and UIsrc/app/api/— API routes (e.g.,webhook/route.ts,debug/hello/route.ts)src/inngest/— Inngestclient.tsand eventfunctions.tssrc/modules/meetings/— Feature modules (e.g.,server/procedures.ts)
- Node.js 20+
- A Postgres database (Neon recommended)
- Accounts/keys for: OpenAI and/or Google GenAI, Stream, and (optionally) ngrok for webhooks
Create a .env.local at repo root. Only include the vars you use:
# Database (Neon example)
DATABASE_URL=postgres://<user>:<password>@<host>/<db>?sslmode=require
# Auth
AUTH_SECRET=your-strong-random-secret
# OpenAI (optional)
OPENAI_API_KEY=sk-...
# Google GenAI (optional)
GOOGLE_API_KEY=...
# Stream (if using chat/video)
STREAM_API_KEY=...
STREAM_API_SECRET=...
STREAM_APP_ID=...
# Inngest (optional for cloud)
INNGEST_EVENT_KEY=...
# Next.js public config (examples)
NEXT_PUBLIC_APP_URL=http://localhost:3000Tip: Prefix client-exposed variables with
NEXT_PUBLIC_.
- Install deps
npm install
- Configure env in
.env.local. - Prepare database
- Push schema:
npm run db:push - Explore data:
npm run db:studio
- Push schema:
- Run the app:
npm run dev - App runs at
http://localhost:3000
If you need a public webhook URL during local dev, start ngrok (adjust script/host as needed):
npm run db:webhookUpdate your providers (e.g., Stream, Inngest, auth callbacks) with the public URL.
- Client:
src/inngest/client.ts - Functions:
src/inngest/functions.ts
Emit and handle events for background processing and AI agents. For cloud usage, set INNGEST_EVENT_KEY and configure your Inngest environment. For local dev, you can run the app and functions locally—refer to Inngest docs if you host the Inngest dev server.
Configure keys in .env.local. Use the React SDKs to build real-time messaging and video. Ensure server-side token issuance is implemented where required.
dev— Start Next.js dev serverbuild— Build production bundlestart— Start production serverlint— Run ESLintdb:push— Apply Drizzle migrations to DBdb:studio— Launch Drizzle Studiodb:webhook— Launch ngrok tunnel (customizable)
- Ensure env vars are set in your hosting provider.
- Build:
npm run build - Start:
npm run start
This app works well on platforms like Vercel, Fly.io, or Render. If you use Vercel, add your env vars in the dashboard and make sure database and external services are reachable.
- DB connection issues: Verify
DATABASE_URLand Neon IP allowlist/SSL params. - Auth errors: Ensure
AUTH_SECRETis set and callback URLs match your domain. - LLM errors: Check
OPENAI_API_KEY/GOOGLE_API_KEYand model availability. - Stream tokens: Server token generation must match the client initialization.
- Events not firing: Confirm Inngest keys/env and that functions are registered.
Proprietary – internal project. Do not distribute without permission.