Technology Stack
All choices confirmed. This is not a wishlist — it's what we're building with.
Core Stack
| Layer | Choice | Why |
|---|---|---|
| Runtime | Node.js + TypeScript | Consistent language front-to-back. Strong ecosystem. Existing expertise from savvy-engine. |
| Framework | Next.js (App Router) | Handles authenticated dashboard, public questionnaire, SEO landing pages, and API — all in one app. |
| AI | Anthropic Claude (direct SDK) | No abstraction layers. Synthesis quality requires precise prompt engineering with direct API control. |
| Database | PostgreSQL + Drizzle ORM | Type-safe, lightweight ORM. Data model is relational (collections → invitations → responses). |
| Auth | Clerk | Google OAuth, Microsoft OAuth, magic links, session management, org support — out of the box. Saves 2–3 weeks of build time. |
| Payments | Stripe | Checkout for one-offs, Billing for subscriptions, Customer Portal for self-service. |
| Resend + React Email | Transactional email with JSX templates. Same ecosystem as the rest of the codebase. | |
| File Storage | Google Cloud Storage | PDF reports, company logos, static assets. CDN-served. |
| React-PDF or Gotenberg | Report generation in JSX (React-PDF) or HTML-to-PDF (Gotenberg). | |
| Styling | Tailwind CSS + shadcn/ui | Professional UI without custom design. Consistent design system. |
Infrastructure
| Concern | Choice | Notes |
|---|---|---|
| Hosting | Vercel (recommended) | Zero ops, preview deployments, edge functions. Natural fit for Next.js. Alternative: existing K8s cluster. |
| Database hosting | Neon | Serverless-friendly connection pooling. Works well with Vercel's edge runtime. |
| Background jobs | Inngest | Durable functions for the synthesis pipeline. Also handles scheduled reminders and cleanup. |
| Monitoring | Sentry + Vercel Analytics | Error tracking + performance. PostHog for product analytics. |
| Domain | envara.ai | All services under this domain. |
Application Structure
envara.ai/ ← Marketing (SSR, SEO)
envara.ai/dashboard/ ← Creator dashboard (authenticated)
envara.ai/collections/new ← Setup wizard
envara.ai/r/[token] ← Respondent questionnaire (public, no auth)
envara.ai/reports/[id] ← Report viewer (optional auth gate)API Routes
/api/collections/ ← CRUD, wizard state
/api/collections/[id]/invitations/ ← Send, track, remind
/api/collections/[id]/responses/ ← Submit, retrieve
/api/collections/[id]/synthesis/ ← Trigger, retrieve, regenerate
/api/ai/questions/ ← Question generation
/api/ai/guardrails/ ← Purpose/question review
/api/billing/ ← Stripe webhooks, usage
/api/users/ ← Profile, prefs (Clerk sync)Relationship to Savvy-Engine
Envara is an independent codebase. It does not extend or depend on savvy-engine.
| Reuse | Don't Reuse |
|---|---|
| Prompt sectioning pattern | Data model (single-respondent) |
| Report config structure | API routes |
| Questionnaire rendering patterns | Submission pipeline |
| PDF template approach | Enrichment logic |