A modern, secure authentication system built with Next.js, featuring a beautiful UI and comprehensive user management.
- 🔐 Secure login with username/password
- 📧 Google sign-in integration
- ✨ Modern and responsive UI with dark mode support
- 🛡️ Protected routes and session management
- 🔑 Secure password reset flow
- 📱 OTP verification via email
- 📊 Password strength monitoring
- 🔄 Real-time password validation
- 🔒 Password hashing and encryption
- ⏱️ OTP expiration (10 minutes)
- 🚫 Rate limiting for security
- 🔍 Unique email and username validation
- 🌓 Dark/Light mode toggle
- 🎨 Beautiful gradient backgrounds
- 📱 Fully responsive design
- 🚀 Smooth transitions and animations
- Frontend: Next.js 13+, React, TypeScript
- Styling: Tailwind CSS
- Authentication: NextAuth.js
- Database: MongoDB
- Email Service: Nodemailer
- State Management: React Hooks
- Form Handling: React Forms
- Node.js 16+
- npm or yarn
- MongoDB database
- Gmail account (for email services)
- Clone the repository:
git clone https://github.com/your-username/SpiritX_Code_Rangers_01.git
cd code-rangers- Install dependencies:
npm install- Create a
.env.localfile in the root directory:
NEXTAUTH_SECRET=your-nextauth-secret
NEXTAUTH_URL=http://localhost:3000
MONGO_URI=your-mongodb-uri
JWT_SECRET=your-jwt-secret
EMAIL_USER=your-email@gmail.com
EMAIL_PASSWORD=your-app-specific-password- Start the development server:
npm run devNEXTAUTH_SECRET: Secret key for NextAuth.jsNEXTAUTH_URL: Your application URLMONGO_URI: MongoDB connection stringJWT_SECRET: Secret for JWT token generationEMAIL_USER: Gmail address for sending emailsEMAIL_PASSWORD: Gmail app-specific password
- User signs up with email/username or Google
- Email verification process
- Secure login with session management
- Protected route access
- User requests password reset
- OTP sent to registered email
- OTP verification
- New password setup with strength validation
- Redirect to login
- Passwords are hashed before storage
- OTP expires after 10 minutes
- Rate limiting on authentication endpoints
- Session management and secure cookies
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js team for the amazing framework
- Tailwind CSS for the utility-first CSS framework
- MongoDB team for the reliable database
- NextAuth.js for the authentication solution