Tech Stack
Status: Accepted Owner: @bilal Last Updated: 2026-02-24
Overview
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| Frontend | React 19, Tailwind CSS 4, shadcn/ui, Apollo Client 4 |
| Backend | Prisma 6, Pothos (GraphQL schema), GraphQL Yoga 5 |
| Database | Supabase PostgreSQL 16 + pgvector |
| Auth | Supabase Auth (SSR, JWT) |
| Storage | Supabase Storage |
| Hosting | Cloudflare Workers (via @opennextjs/cloudflare) |
| Connection Pool | Cloudflare Hyperdrive |
| Auth Gate (ZTNA) | Cloudflare Access (email OTP) |
| DNS | Cloudflare |
| AI (primary) | Claude (Anthropic) |
| AI (fallback) | OpenAI, Kimi, GLM |
| AI (embeddings) | OpenAI text-embedding-3-small (1536 dim) |
| Twilio + Meta WhatsApp Cloud API | |
| Voice | VAPI / Retell |
| SMS | Twilio |
| SendGrid | |
| Testing | Vitest |
| CI/CD | GitHub Actions |
| IaC | Terraform Cloud + Cloudflare provider |
| Package manager | pnpm |
LLM Providers
| Provider | Model | Role |
|---|---|---|
| Claude (Anthropic) | claude-sonnet-4 | Primary generation + tool use |
| OpenAI | gpt-4o | Fallback generation |
| OpenAI | text-embedding-3-small | Embeddings (1536 dim) |
| Kimi (Moonshot) | moonshot-v1-8k | Experimental |
| GLM (Zhipu) | glm-4-flash | Experimental |
Automatic fallback chain: Claude → OpenAI → Kimi → GLM → raw chunks.
Hosting & Infrastructure
| Component | Service | Domain |
|---|---|---|
| Marketing Site | Cloudflare Pages (Astro + React) | ehq.tech |
| Dashboard | Cloudflare Workers | app.ehq.tech |
| Knowledge Base | Cloudflare Pages | brain.ehq.tech |
| Database | Supabase Cloud | — |
| Analytics | PostHog Cloud EU (cookieless) | — |
| IaC state | Terraform Cloud | — |
The dashboard runs on Cloudflare Workers via @opennextjs/cloudflare, which compiles the Next.js app to run on the workerd runtime. Database connections go through Cloudflare Hyperdrive for connection pooling using @prisma/adapter-pg.
The marketing site (envo-marketing/) is a separate Astro 5 static site with React islands (client:visible for lazy hydration) and Tailwind CSS 4. It deploys to Cloudflare Pages as pre-built static HTML. Analytics are handled by PostHog Cloud EU in cookieless mode — no cookies, no device storage, PECR-exempt.
Access is gated by Cloudflare Access (Zero Trust) using email OTP until the app goes public.
Development Principles
- Data model first — Schema before implementation
- Modular monolith — Single Next.js app, structured by domain
- GraphQL over REST — Flexible queries, end-to-end type safety
- Minimal DevOps —
dev→prod, no staging initially
Non-Functional Requirements
| Category | Requirement |
|---|---|
| Performance | Dashboard load < 1.5s, API < 500ms |
| Reliability | Zero dropped issues, retry queue for notifications |
| Security | JWT auth, full RLS, prompt injection protection |
| Scalability | 3,000+ properties |
| Availability | 99.5% uptime target |
Future Considerations
- Multi-region (Supabase supports regional deployment)
- Mobile app (React Native + Apollo Client)
- GraphQL Federation (if monolith needs extraction)
- Vector store migration (abstraction ready for Qdrant/Pinecone)
- Remove ZTNA when going public (Terraform destroys Access app + policy)
See also: System Design, RAG Pipeline