Skip to content

tef20/trpc-auth-next

Repository files navigation

Basic Auth Setup

This project is a bit of a playground for me experimenting with auth and some other tools.

Basic features

  • Cookie based session auth with access & refresh tokens
  • End-to-end, compile-time and run-time type safety
  • Input validated forms
  • Accessibilty conscious design
  • Server side rendering pages + query cache prehydration
  • Email verification (w/ OTP)
  • Password change
  • User roles
  • Auto generate openapi documentation

Visit a working preview here.

๐Ÿ’ป Installation & Setup

# Install dependencies
pnpm install

# Run the development server
pnpm dev

N.B. To configure the PostgreSQL database, you must create an account with Neon DB or use a different a different drizzle adapter.

๐Ÿ› ๏ธ Tools used:

  • Next.js (Pages Router)
  • tRPC (type-safety across the network boundary + React Query integration)
  • Radix Primitives + Tailwind CSS (accessible UI components)
  • Drizzle ORM (type-safe SQL queries)
  • PostgreSQL (hosted on Neon)
  • React Hook Forms with Zod input validation

๐Ÿ“ Useful Resources