A secure identity management system built with Next.js and PostgreSQL. This project includes user registration, login, two-factor authentication (2FA), and rate limiting to enhance security and user experience.
- User Registration: Users can sign up with email and password.
- User Login: Secure login system with JWT authentication.
- Two-Factor Authentication (2FA): Enhanced security using 2FA for user logins.
- Rate Limiting: Prevents abuse and protects against brute-force attacks.
- PostgreSQL: Utilizes PostgreSQL for user data storage.
- Next.js - React framework for server-side rendering.
- Node.js - JavaScript runtime for the backend.
- PostgreSQL - Relational database for user data.
- JWT - JSON Web Tokens for authentication.
- Nodemailer - For sending emails (e.g., for 2FA).
- Redis - Optional, for caching and rate limiting.
- Node.js (version 14 or above)
- PostgreSQL (make sure to have a database setup)
- An Upstash Redis account (if using Redis for caching/rate limiting)
-
Clone the repository:
git clone https://github.com/Ahtaxam/identity-tech.git cd identity-tech
-
Install dependencies:
npm install
- Create a .env.local file in the root directory and add your environment variables:
# SMTP Configuration for sending emails
SMTP_HOST=
[email protected]
SMTP_PASS=your-email-password
JWT_SECRET=
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=
- Create a .env file in the root directory Prisma orm will set database url from that
DATABASE_URL=
- Start the development server:
npm run dev
- Navigate to http://localhost:3000 in your browser.