Skip to content

SMTNDev/SecureOTP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔒 SecureOTP

🚀 Version 📜 License 🐍 Python 🟢 Node.js ☕ Java 🔑 JWT ⚡ Express.js
🍃 MongoDB 📧 Nodemailer
📱 Twilio 🐳 Docker 🔧 Build

Isekai anime style illustration depicting warm candlelight illuminating a scene with expressive compositio nd a warm glow   The image features a sleek and modern logo for SecureOTP an orange and white shield with a digital keyhol

SecureOTP is a secure and scalable OTP (One-Time Password) Generation and Verification System built with Node.js, Express.js, MongoDB, and Next.js. It ensures fast, reliable, and secure authentication using email-based OTP verification.


📜 Table of Contents


🚀 Features

  • 🔑 OTP-Based Authentication - Secure OTP generation and verification for user authentication.
  • 📧 Email Integration - OTP delivery via email using SMTP.
  • 📊 Scalable Architecture - Built for scalability using Docker and Kubernetes.
  • 🧑‍💻 Role-Based Access Control (RBAC) - User roles and permissions management.
  • 🔐 Security Enhancements - JWT-based tokens, bcrypt hashing, and HTTPS support.
  • 📡 API-First Design - RESTful APIs for seamless integration with frontend and mobile apps.
  • 📱 Responsive UI - Modern, user-friendly, and responsive UI built with Next.js.

🛠️ Tech Stack

Component Technology
Frontend Next.js, React.js
Backend Node.js, Express.js
Database MongoDB
Authentication JWT, Bcrypt.js
Email Service Nodemailer, SMTP
Deployment Docker, Kubernetes
Reverse Proxy NGINX
CI/CD GitHub Actions

📦 Install Dependencies:

npm install express mongoose dotenv bcryptjs jsonwebtoken nodemailer express-validator express-rate-limit cors body-parser supertest jest
npm install axios react-toastify dotenv

⚙️ Installation

1. Clone Repository

git clone https://github.com/SMTNDev/SecureOTP.git
cd SecureOTP

2. Install Dependencies

cd backend && npm install
cd ../frontend && npm install

3. Configure Environment Variables

Create a .env file in the backend folder. See Configuration.

4. Run Locally

# Start Backend
cd backend
npm start

# Start Frontend
cd frontend
npm run dev

5. Access Application

  • Frontend: http://localhost:3000
  • Backend API: http://localhost:5000/api

🐳 Docker Setup

1. Build and Run Containers

docker-compose build
docker-compose up -d

2. Stop Services

docker-compose down

☁️ Cloud Deployment

1. Kubernetes Setup

minikube start
kubectl apply -f k8s/

2. Access Application

minikube service frontend-service

For more details, see the Deployment Guide.


📄 API Documentation

  • Full API details are available in the API-Docs.md file.
  • Test endpoints with Postman or curl commands.

📊 Architecture Overview


📈 CI/CD Pipeline

  • Automated Builds & Tests - Using GitHub Actions for CI/CD.
  • Docker Image Deployment - Pushes images to Docker Hub for production use.

See .github/workflows/main.yml for details.


🛡️ Security Features

  • JWT Tokens - Secure authentication.
  • Password Hashing - Uses bcrypt for encryption.
  • Rate Limiting - Prevents brute force attacks.
  • HTTPS Ready - Supports SSL via NGINX configuration.
  • Input Validation - Prevents SQL and NoSQL injection.

🔧 Configuration

Create a .env file in the backend folder with these keys:

PORT=5000
MONGO_URI=mongodb://localhost:27017/SecureOTP
JWT_SECRET=your_jwt_secret_key
SMTP_HOST=smtp.mailtrap.io
SMTP_PORT=587
SMTP_USER=username
SMTP_PASS=password

📑 License

This project is licensed under the Apache-2.0 License. See the LICENSE file for more details.


☕ Support

If you find this project helpful, consider supporting me by buying a coffee!

Buy Me a Coffee


🎉 Thank You for Using SecureOTP!

Let me know if you need any updates, features, or enhancements!

About

This procedure of OTP generation is proved to be very secure and is used in many applications such as online banking, etc. It provides multi-channel delivery by SMS, email, and push notifications for quick and reliable authentication. Ideal for safeguarding user accounts, transactions, and sensitive information.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors