Skip to content

devgauravjatt/react-router-7v-custom-auth

Repository files navigation

🛡️ Welcome to React Router v7 Custom Auth With Server

A modern, secure authentication boilerplate using Lucia, Drizzle ORM, React, and more — designed with clean UI principles inspired by shadcn/ui and powered by TypeScript-friendly tools.


✨ Features

  • 🔐 Authentication with Lucia
  • 🗃️ Type-safe database access using Drizzle ORM
  • 📄 Schema-based form validation using React Hook Form + Zod
  • 🌐 Routing with React Router v7
  • 🎨 Tailwind CSS for utility-first styling (ShadCN-inspired)
  • ⚡️ Built with performance and developer experience in mind

🛠️ Tech Stack

Tool Description
Lucia A modern learning resource and library to implement auth from scratch.
Drizzle ORM A type-safe, lightweight, SQL-centric ORM for TypeScript/JavaScript.
React Hook Form Performant and easy-to-use form library.
Zod TypeScript-first schema declaration and validation library.
React Router v7 A routing library for React, flexible and modern.
Tailwind CSS Utility-first CSS framework for fast UI development.

🚀 Getting Started

Prerequisites

  • Node.js (>=18)
  • A modern package manager: pnpm, npm, or yarn

Installation

pnpm install

Environment Variables

Rename .env.example to .env and fill in the required environment variables before running the project:

mv .env.example .env

📦 Available Scripts

You can run these scripts via your package manager:

Script Description
pnpm dev Start development server with React Router
pnpm build Build the React Router server and client bundles
pnpm start Serve the built React Router server
pnpm typecheck Generate React Router types and run TypeScript check
pnpm db-generate Generate Drizzle ORM migration files
pnpm db-push Push migrations and update database schema

Example:

pnpm dev

🧠 Project Structure

src/
├── components/       # Reusable UI components
├── pages/            # Route-based components like Home, Login, Signup
├── db/               # Drizzle ORM schema and database logic
├── lib/              # Utility functions, auth helpers, etc.
└── main.tsx          # Entry point

📚 Learning Resources


🧾 License

This project is open source and available under the MIT License.


Let me know if you want to:

  • Add a live demo link
  • Include deployment instructions (like Vercel/Netlify)
  • Include .env.example or database setup instructions

I can also help you auto-generate a logo or badge-style headers if you want a more polished README.