MCPcopy Index your code
hub / github.com/codersaadi/next-auth5-shadcn

github.com/codersaadi/next-auth5-shadcn @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
121 symbols 362 edges 85 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

NextAuth Starter

A robust authentication solution for Next.js applications, leveraging NextAuth with custom enhancements like RBAC, multi-provider support, and email handling.

Tools and Adapters Used

  • Next.js
  • TypeScript
  • Auth.js (v5)
  • PostgreSQL
  • Prisma

Getting Started

Installation

git clone https://github.com/codersaadi/next-auth5-shadcn.git
cd next-auth5-shadcn
pnpm install

Setup & Configuration

Create a .env file in the root directory and add the following configuration:

DB_URL="postgresql://dbuser:password@localhost:5432/dbname"

AUTH_SECRET="your-secret"

GITHUB_CLIENT_ID="your-client-id"
GITHUB_CLIENT_SECRET="your-client-secret"

GOOGLE_CLIENT_ID="your-client-id"
GOOGLE_CLIENT_SECRET="your-client-secret"

FACEBOOK_CLIENT_ID="your-client-id"
FACEBOOK_CLIENT_SECRET="your-client-secret"

GMAIL_SENDER_EMAIL="your-app-gmail"
GMAIL_SENDER_PASSWORD="gmail-app-password"

HOST="http://localhost:3000"

   NEXT_PUBLIC_RECAPTCHA_SITE_KEY : ""
        RECAPTCHA_SECRET : ""

Features

Credential-Based Authentication -Sign-In, Sign-Up, and Forgot Password functionality. Custom email templates for password recovery and account verification using Nodemailer. OAuth Providers

  • Google and Facebook authentication for seamless social logins. Role-Based Access Control (RBAC)

  • Define user roles and permissions with Prisma for secure access management. Google Captcha V3

  • useFormSubmit Hooks supports the google captcha v3 just pass captcha options , and use reCaptchaSiteVerify in your action. Database Integration
  • Built with Prisma and PostgreSQL for powerful and scalable database interactions. Schema Validation
  • Validate user inputs and responses using Zod. TypeScript Integration
  • Type-safe development with TypeScript, ensuring robust and maintainable code. Customizable UI
  • Tailor the UI components with Shadcn UI, allowing for easy styling adjustments. Contributions
  • Feel free to contribute—contributions are always appreciated!

ScreenShots

Home Page

Home Page

Login Page

Login Page

Sign In Page

Sign In Page

Email Sign In

Email Sign In

Signup Modal

Signup Modal

Intercepting Modal

Intercepting Modal

Enhancements:

  • Clearer Section Headers: Sections are clearly separated for easy navigation.
  • Enhanced Setup Instructions: The environment setup is clearly outlined.
  • Organized Screenshots: The screenshots are presented in a clean and structured manner.
  • Features Detailed: Each feature is highlighted with bold titles for quick reference.
  • Encouragement to Contribute: The contributions section is friendly and welcoming.

Extension points exported contracts — how you extend this code

ProcessEnv (Interface)
(no doc)
global.d.ts
EmailTheme (Interface)
(no doc)
src/modules/auth/sendRequest.ts
InputProps (Interface)
(no doc)
src/components/ui/input.tsx
FetchOptions (Interface)
(no doc)
src/lib/fetch.ts
EmailVerifyProps (Interface)
(no doc)
src/app/auth/email_verify/page.tsx
CaptchaOptions (Interface)
(no doc)
src/hooks/useFormSubmit.tsx
MessageResponse (Interface)
(no doc)
src/modules/auth/types/auth.d.ts
ButtonProps (Interface)
(no doc)
src/components/ui/button.tsx

Core symbols most depended-on inside this repo

cn
called by 46
src/lib/utils.ts
useFormSubmit
called by 5
src/hooks/useFormSubmit.tsx
dispatch
called by 5
src/hooks/use-toast.ts
getIconProps
called by 4
src/modules/auth/icons.tsx
reCaptchaSiteVerify
called by 4
src/modules/auth/lib/recaptcha.ts
getUserByEmail
called by 4
src/modules/auth/data/user.ts
useFormField
called by 4
src/components/ui/form.tsx
signIn
called by 3
src/modules/auth/auth.ts

Shape

Function 85
Interface 16
Method 11
Class 8
Enum 1

Languages

TypeScript100%

Modules by API surface

src/hooks/use-toast.ts9 symbols
src/hooks/useFormSubmit.tsx7 symbols
src/modules/auth/services/mail.sender.ts6 symbols
src/modules/auth/lib/common.ts5 symbols
src/modules/auth/icons.tsx5 symbols
src/modules/auth/data/user.ts5 symbols
src/modules/auth/data/resetpassword-token.ts5 symbols
src/modules/auth/sendRequest.ts4 symbols
src/modules/auth/services/template-service.ts3 symbols
src/modules/auth/data/verification-token.ts3 symbols
src/modules/auth/components/SignInForm.tsx3 symbols
src/modules/auth/auth.ts3 symbols

Datastores touched

dbnameDatabase · 1 repos

For agents

$ claude mcp add next-auth5-shadcn \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page