Tech Stack
A complete reference of every technology used in Reflecto, organized by layer.
Stack at a Glance
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 15 | Full-stack React framework with App Router |
| React | 19 | UI component library |
| TypeScript | 5.8 | Type-safe development |
| tRPC | 11 | End-to-end type-safe API layer |
| Prisma | 6 | ORM and database toolkit |
| PostgreSQL | — | Primary relational database |
| NextAuth | 5 (beta) | Authentication (credentials + OAuth) |
| TipTap | 3 | Rich text editor framework |
| Tailwind CSS | 4 | Utility-first CSS framework |
| Radix UI | — | Accessible headless UI primitives |
| Zustand | 5 | Lightweight client state management |
| React Query | 5 | Server state and cache management |
| ImageKit | — | Image CDN, uploads, and transformations |
| Resend | 6 | Transactional email delivery |
| Inngest | 3 | Background job orchestration |
| Framer Motion | 12 | Animation library |
| Zod | 3 | Runtime schema validation |
| Vercel | — | Deployment and hosting platform |
Frontend
UI Framework
Next.js 15 + React 19
Reflecto uses the App Router with React Server Components. Route groups separate public and protected pages. Turbopack is enabled for fast local development (next dev --turbo).
Key patterns:
- Route groups —
(protected)and(public)for layout-based auth gating - Server Components — Default for pages, reducing client bundle size
- Client Components — Marked with
"use client"for interactive features (editor, modals)
React Query (via tRPC)
All server data fetching uses React Query through the tRPC integration. This provides:
- Automatic caching and background refetching
- Cursor-based infinite scroll pagination
- Optimistic updates for instant UI feedback
- Mutation lifecycle hooks (onSuccess, onError)
Backend
API Layer
tRPC 11
The API layer uses tRPC v11 with SuperJSON for serialization (handles Dates, Maps, and other JS types). Zod schemas provide runtime validation on all inputs.
The middleware stack applied to every procedure:
- Timing middleware — Logs execution time, adds artificial delay in dev
- Rate limiting — In-memory sliding window (100/60s authenticated, 30/60s unauthenticated)
- Auth guard (protected only) — Verifies session and narrows
ctx.session.usertype
13 routers cover all domain areas: entry, journal, dream, highlight, idea, wisdom, note, tag, person, attachment, insights, preferences, user.
Infrastructure
| Service | Role |
|---|---|
| Vercel | Hosting, serverless functions, edge network, preview deployments |
| PostgreSQL | Primary database (provisioned via Vercel or external provider) |
| ImageKit | Image CDN with on-the-fly transformations and thumbnail generation |
| Resend | Transactional email API for verification and notifications |
| Inngest | Serverless background job runner with cron scheduling and retries |
Development Tools
| Tool | Purpose |
|---|---|
| pnpm 10 | Package manager |
| ESLint 9 | Linting with Next.js config |
| Prettier 3 | Code formatting with Tailwind plugin |
| TypeScript 5.8 | Type checking (pnpm typecheck) |
| type-coverage | Measures TypeScript coverage (target: 99%) |
| Prisma Studio | Visual database browser |
| Turbopack | Fast dev server bundling |
Run pnpm check to execute both linting and type checking in a single
command.