A complete starter kit for implementing robust user authentication in Next.js projects, including Google OAuth and form validation. This kit simplifies the integration of a modern authentication stack with best practices.
- Google OAuth Integration: Out-of-the-box support for authenticating users via Google.
- Form Validation: Robust client-side and server-side form validation using Zod.
- Reusable UI Components: Pre-built and styled components from ShadCN for faster development.
- Data Management: Integration with Prisma and MongoDB for handling user data.
- Type Safety: Full TypeScript support for safer and more reliable code.
- Responsive Design: UI components are mobile-friendly and accessible.
-
Clone the repository:
git clone https://github.com/M-Tijani/Auth_Package cd Auth_Package
-
Install the packeges:
npm install or npm i or pnpm install or npm i
-
Set up your environment variables.:
DATABASE_URL="mongodb+srv://name:password@mongodb.net"/databaseName?retryWrites=true&w=majority GOOGLE_CLIENT_ID=From_Google_Console GOOGLE_CLIENT_SECRET=From_Google_Console JWT_SECRET=Make_A_Unique_String NEXTAUTH_SECRET=Make_A_Unique_String MAILER_SEND_API_KEY=From_Mailjet GMAIL_APP_PASSWORD=Create_Your_App_Password GMAIL_USER=Your_Gmail_Account BRAND_NAME=Your_Brand_Name // "You can remove it if you want" PRODUCTION=https://your_domain.com LOCAL=http://localhost:3000 ENVIRONMENT=LOCAL
-
Prisma Schema:
npx prisma generate
-
Install the packeges:
npm run dev or pnpm run dev
6.Open http://localhost:3000 to see your application in action.