A scalable authentication system using Next.js, Nodejs, TypeScript, GraphQL, JWT, MongoDB, and Docker, complete with email verification, password reset, and CI/CD integration.
- Features
- Prerequisites
- Installation
- Usage
- Project Structure
- Tech Stack
- Key Dependencies
- Screenshots
- Demo
- Contributing
- License
- User Registration: Register new users with email verification.
- Login: Secure login process with JWT.
- Forgot Password: Recover access to account if user they forget their password.
- Email Verification: Verify user email addresses during registration to enhance security and prevent fake accounts.
- Profile Management: Enable users to view and update their profile information.
- Password Reset: Allow users to easily reset their passwords.
- JWT Authentication: Use JSON Web Tokens for secure authentication, including support for access and refresh tokens.
- Docker
- Node.js v18+
- Git
-
Clone the repository:
git clone https://github.com/UtkarshAhuja2003/auth.git cd auth
-
Create environment files:
cp client/.env.sample client/.env cp users/.env.sample users/.env
-
Start the services using Docker Compose:
docker-compose up --build -d
After starting, navigate to http://localhost/user/register to access the client. APIs are accessible at http://localhost/users for the users microservice.
For local development, refer to the individual READMEs in each service directory:
- Client README - Next.js frontend setup and usage instructions.
- Users Service README - Backend API setup and documentation for user management.
Each README provides step-by-step instructions for environment configuration, running the service locally, and troubleshooting common issues.
auth/
├── .github/workflows # GitHub Actions CI/CD
├── client # Next.js client with authentication flows
├── proxy # Nginx reverse proxy configurations
├── users # Backend microservice for user management
├── docker-compose.yml
├── gitpod.yml
├── LICENSE
└── README.md
- Frontend: Next.js, TypeScript, TailwindCSS
- Backend: Node.js, GraphQL, JWT, MongoDB
- Infrastructure: Docker, Docker Compose, Nginx
- CI/CD: GitHub Actions
next
,react
express
,graphql
,@apollo/server
,jsonwebtoken
mongoose
,bcrypt
,nodemailer
- Fork the repository
- Create your branch:
git checkout -b feature/YourFeature
- Commit your changes:
git commit -m 'Add YourFeature'
- Push to the branch:
git push origin feature/YourFeature
- Open a pull request
This project is licensed under the MIT License.