An open API service indexing awesome lists of open source software.

https://github.com/krishit-shah/authly

Secure MERN Stack Authentication App with Email OTP, JWT, Password Reset
https://github.com/krishit-shah/authly

auth-system authentication fullstack jwt mern node-js otp-auth reactjs

Last synced: 9 days ago
JSON representation

Secure MERN Stack Authentication App with Email OTP, JWT, Password Reset

Awesome Lists containing this project

README

        

# ๐Ÿ” Authly โ€“ Secure Auth System (MERN)

> A full-stack authentication system with Email OTP verification, password reset, JWT protection, and clean UI using Bootstrap.

## ๐Ÿš€ Features

- ๐Ÿ” User Signup + Login with JWT
- ๐Ÿ“ง OTP Verification via Email during Signup
- ๐Ÿ›ก๏ธ Protected Dashboard (Private Route)
- ๐Ÿ” Forgot Password with Email Reset Link
- ๐ŸŽจ Bootstrap 5 UI + Toast Notifications
- ๐Ÿ”’ Secure Password Hashing using bcrypt
- โœ‰๏ธ Nodemailer-based Email Service
- ๐Ÿง  Temporary in-memory store for OTP
- ๐Ÿ—‚๏ธ Fully structured: `frontend/` + `backend/`

---
## ๐Ÿงช How to Run the Project Locally

### 1. ๐Ÿ“ฆ Clone the Repository

```bash
git clone https://github.com/Krishit-Shah/authly.git
cd authly
```
### 2.โš™๏ธ Backend Setup
```bash
cd backend
npm install
```
๐Ÿ“ Create a `.env` file inside `backend/` with the following environment variables:
```bash
PORT=5000
MONGO_URI=mongodb://localhost:27017/authly
JWT_SECRET=supersecretkey
[email protected]
EMAIL_PASS=your_app_password
CLIENT_URL=http://localhost:3000
```

๐Ÿ” Note: Use a Gmail App Password if you have 2FA enabled.

### Start the backend server:
```bash
npm start
```
๐ŸŒ Server runs at: http://localhost:5000

### 3.๐Ÿ’ป Frontend Setup
```bash
cd ../frontend
npm install
npm start
```
๐ŸŒ Frontend runs at: http://localhost:3000

## 4.๐Ÿ“ฆ Installed Dependencies

### ๐Ÿ”ง Backend

- express
- mongoose
- dotenv
- bcryptjs
- jsonwebtoken
- nodemailer
- cors

```bash
npm install express mongoose dotenv bcryptjs jsonwebtoken nodemailer cors
```

### ๐Ÿ’ป Frontend
- react
- react-dom
- react-router-dom
- axios
- react-toastify
- bootstrap
```bash
npm install react react-dom react-router-dom axios react-toastify bootstrap
```
---

## ๐Ÿ› ๏ธ Tech Stack

| ๐Ÿ”ง Frontend | โš™๏ธ Backend | ๐Ÿ” Security | ๐Ÿงฐ Tools |
|--------------|------------|-------------|-------------|
| React | Node.js | JWT | Toastify |
| Bootstrap 5 | Express | Bcrypt.js | Nodemailer |
| React Router | MongoDB | OTP Emails | Dotenv |

## ๐Ÿ‘จโ€๐Ÿ’ป Author
Krishit Shah
- A complete MERN stack authentication solution built with a focus on security, scalability, and clean architecture.

## ๐Ÿ“„ License
- This project is free to use for learning and educational purposes.

## ๐Ÿ“ Contributing
- Contributions are welcome. Please submit a pull request with your changes.

## ๐Ÿšจ Issues
- Please report any issues or bugs in the `issues` section.
## ๐Ÿ“ˆ Future Development

- ๐Ÿ” Google OAuth Login using `react-oauth/google`
- ๐ŸŒ— Light/Dark Mode toggle with persistent theme storage
- ๐Ÿงฉ Admin-only dashboard with role-based access control
- ๐Ÿ“ฑ Fully mobile-optimized layout using Bootstrap grid
- ๐Ÿ’ฌ Custom error handling with user-friendly messages
- ๐Ÿ” Resend OTP with cooldown + expiration UI
- ๐Ÿงพ In-app activity logs (user actions & login history)
- ๐ŸŒ Deployment to Render (backend) + Vercel (frontend) with custom domain
- ๐Ÿง  Migration from in-memory store to Redis for OTP in production