Monorepo template for building AI-powered tools fast. Ships with auth, database, AI connectors, and a polished UI — ready to deploy on Vercel.
- Framework: Next.js 16 (React 19, Turbopack)
- Services: Effect.ts (typed errors, layers, dependency injection)
- AI: Vercel AI SDK + provider packages (
@ai-sdk/google,@ai-sdk/mistral,@ai-sdk/openai) - Auth: Better-Auth (email/password, OAuth)
- Database: Prisma + Neon (serverless Postgres)
- Styling: Tailwind CSS v4, shadcn/ui
- Monitoring: Sentry
- Testing: Vitest
- Linting: Biome
- Monorepo: pnpm workspaces + Turborepo
apps/
web/ → Next.js app (pages, auth, API routes, UI)
packages/
ai/ → AI connectors as Effect services
utils/ → Shared utilities
All connectors are Effect services with typed errors, live layers, and a composed AiToolkitLive layer.
| Connector | Description |
|---|---|
| Firecrawl | Web scraping — scrape, crawl, and extract structured data from URLs |
| Mistral OCR | Document OCR via Pixtral Large — extract text from PDFs and images |
| Gemini PDF | PDF extraction via Gemini 2.5 Flash — text, structure, and page info |
| Google Sheets | Read, write, and append rows to spreadsheets |
| Google Calendar | List, create, update, and delete calendar events |
| Gmail | Send emails, list messages, get message details |
Google services share a single GoogleAuth layer for OAuth2.
# Clone
git clone https://github.com/nivalis-studio/app-template.git
cd app-template
# Install dependencies
pnpm install
# Configure environment
cp .env.example .env
# Fill in your keys (see below)
# Run dev server
pnpm dev| Command | Description |
|---|---|
pnpm dev |
Start dev server (Next.js with Turbopack) |
pnpm build |
Build all packages and apps |
pnpm test |
Run tests (Vitest) |
pnpm lint |
Lint with Biome |
pnpm lint:fix |
Auto-fix lint issues |
pnpm ts |
Type-check all packages |
Copy .env.example and fill in values:
# Database (required)
DATABASE_URL=
# Auth (required)
BETTER_AUTH_SECRET=
# AI Providers (optional — enable connectors as needed)
OPENAI_API_KEY=
MISTRAL_API_KEY=
GOOGLE_GENERATIVE_AI_API_KEY=
FIRECRAWL_API_KEY=
# Google OAuth (optional — for Sheets, Calendar, Gmail)
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REFRESH_TOKEN=
# Monitoring (optional)
SENTRY_DSN=
SENTRY_AUTH_TOKEN=Effect services — Each AI connector follows the same pattern:
import { FirecrawlService, FirecrawlLive } from "@nivalis/ai"
import { Effect } from "effect"
const program = Effect.gen(function* () {
const firecrawl = yield* FirecrawlService
const page = yield* firecrawl.scrape("https://example.com")
console.log(page.markdown)
})
Effect.provide(program, FirecrawlLive)- Tagged errors — Every service defines its own
Data.TaggedErrorfor typed error channels - Config from environment — API keys are read via
Config.string()at layer construction - Layer composition — Use individual layers or
AiToolkitLivefor all 6 services at once
Private — Nivalis Studio