How jerome-marshall/ux-tools works
Project type and purpose
• This is a full-stack Next.js 13 application that uses the App Router for its UI, tRPC for its API layer, Drizzle (via drizzle.config.ts) for ORM/DB schema, and a layered folder structure (use-cases, data-access, server/api, server/db).
• Purpose: It provides authenticated user flows (“auth”), a protected dashboard, projects → studies → results workflows, and preview/site public flows. It persists data in a relational database (managed via Drizzle migrations).
File structure
• Frontend:
· src/app — Next.js pages and layouts, split into three parallel segments: (app) (authenticated), (preview) (testing preview of studies), and (site) (public landing).
· src/components — reusable UI components, organized by feature (projects, studies, results, ui primitives).
· src/hooks, src/lib, src/utils, src/data-access — client-side logic for fetching, state management, utilities.
· src/trpc/client.tsx, src/trpc/query-client.ts — tRPC client and React Query integration for front end.
• Backend:
· src/app/api/trpc/[trpc]/route.ts & src/app/api/auth/[...all]/route.ts — Next.js API routes for tRPC and authentication.
· src/server/api/routers/*.ts — tRPC routers for projects, studies, tests.
· src/server/api/trpc.ts — tRPC server configuration.
· src/use-cases — business-logic layer (authorization, projects, studies, tests, tree-tests).
· src/data-access/*.ts & src/server/db/schema — data access and schema definitions for Drizzle ORM.
· src/server/db/migrations — SQL migrations to evolve the database.
· src/lib/auth.ts / auth-client.ts — shared auth logic (JWT, sessions).
• Config/build: next.config.ts, drizzle.config.ts, tsconfig.json, linters, bundlers.
Key architecture insights from README
• Bootstrapped with Create Next App.
• Next.js App Router, optimized fonts, deployed on Vercel.