Clyptor is an advanced authentication application built with Next.js 14, NextAuth.js, and NextUI. It provides a robust authentication system with features like email/password login, OAuth (Google, GitHub, Discord), two-factor authentication (2FA), password reset, and email verification.
- User registration and login with email/password
- OAuth login with Google, GitHub, and Discord
- Email verification for new users and email changes
- Two-factor authentication (2FA) via email code
- Password reset via email link
- User roles (Admin, User)
- Secure session management with JWT
- Responsive UI with NextUI and Tailwind CSS
- Next.js 14 (App Router)
- NextAuth.js for authentication
- Prisma ORM with PostgreSQL
- NextUI v2 for UI components
- Tailwind CSS for styling
- Zod for schema validation
- React Hook Form for form management
- Resend for transactional emails
- bcryptjs for password hashing
git clone https://github.com/your-username/clyptor.git
cd clyptornpm install
# or
yarn install
# or
pnpm installCreate a .env file in the root directory and add the following variables:
DATABASE_URL=postgresql://USER:PASSWORD@HOST:PORT/DATABASE
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
DISCORD_CLIENT_ID=your-discord-client-id
DISCORD_CLIENT_SECRET=your-discord-client-secret
RESEND_API_KEY=your-resend-api-key
NEXTAUTH_SECRET=your-random-secret
Replace the placeholders with your actual credentials.
Run Prisma migrations to set up your database schema:
npx prisma migrate devGenerate the Prisma client:
npx prisma generatenpm run devOpen http://localhost:3000 in your browser to see the app.
app/- Next.js app directory (routes, pages, layouts)components/- Reusable UI componentsactions/- Server actions for authentication and settingslib/- Utility functions and database accessprisma/- Prisma schema and migrationsschema/- Zod validation schemasconfig/- App configuration filestypes/- TypeScript type definitions
This project is licensed under the MIT License.
Feel free to contribute or open issues for improvements!