Skip to Content
Welcome to Reflecto Docs - Your guide to mindful journaling
Developer GuideTech Stack

Tech Stack

A complete reference of every technology used in Reflecto, organized by layer.

Stack at a Glance

TechnologyVersionPurpose
Next.js15Full-stack React framework with App Router
React19UI component library
TypeScript5.8Type-safe development
tRPC11End-to-end type-safe API layer
Prisma6ORM and database toolkit
PostgreSQLPrimary relational database
NextAuth5 (beta)Authentication (credentials + OAuth)
TipTap3Rich text editor framework
Tailwind CSS4Utility-first CSS framework
Radix UIAccessible headless UI primitives
Zustand5Lightweight client state management
React Query5Server state and cache management
ImageKitImage CDN, uploads, and transformations
Resend6Transactional email delivery
Inngest3Background job orchestration
Framer Motion12Animation library
Zod3Runtime schema validation
VercelDeployment and hosting platform

Frontend

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

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:

  1. Timing middleware — Logs execution time, adds artificial delay in dev
  2. Rate limiting — In-memory sliding window (100/60s authenticated, 30/60s unauthenticated)
  3. Auth guard (protected only) — Verifies session and narrows ctx.session.user type

13 routers cover all domain areas: entry, journal, dream, highlight, idea, wisdom, note, tag, person, attachment, insights, preferences, user.

Infrastructure

ServiceRole
VercelHosting, serverless functions, edge network, preview deployments
PostgreSQLPrimary database (provisioned via Vercel or external provider)
ImageKitImage CDN with on-the-fly transformations and thumbnail generation
ResendTransactional email API for verification and notifications
InngestServerless background job runner with cron scheduling and retries

Development Tools

ToolPurpose
pnpm 10Package manager
ESLint 9Linting with Next.js config
Prettier 3Code formatting with Tailwind plugin
TypeScript 5.8Type checking (pnpm typecheck)
type-coverageMeasures TypeScript coverage (target: 99%)
Prisma StudioVisual database browser
TurbopackFast dev server bundling

Run pnpm check to execute both linting and type checking in a single command.

Last updated on