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.
- 🚀 Features
- 🛠️ Tech Stack
- 📦 Folder Structure
- ⚙️ Installation
- 🐳 Docker Setup
- ☁️ Cloud Deployment
- 📄 API Documentation
- 📊 Architecture Overview
- 📈 CI/CD Pipeline
- 🛡️ Security Features
- 🔧 Configuration
- 📑 License
- ☕ Support
- 🔑 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.
| 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 |
npm install express mongoose dotenv bcryptjs jsonwebtoken nodemailer express-validator express-rate-limit cors body-parser supertest jestnpm install axios react-toastify dotenvgit clone https://github.com/SMTNDev/SecureOTP.git
cd SecureOTPcd backend && npm install
cd ../frontend && npm installCreate a .env file in the backend folder. See Configuration.
# Start Backend
cd backend
npm start
# Start Frontend
cd frontend
npm run dev- Frontend:
http://localhost:3000 - Backend API:
http://localhost:5000/api
docker-compose build
docker-compose up -ddocker-compose downminikube start
kubectl apply -f k8s/minikube service frontend-serviceFor more details, see the Deployment Guide.
- Full API details are available in the API-Docs.md file.
- Test endpoints with Postman or curl commands.
- Learn more about the internal system design in the Architecture.md file.
- 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.
- 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.
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
This project is licensed under the Apache-2.0 License. See the LICENSE file for more details.
If you find this project helpful, consider supporting me by buying a coffee!
Let me know if you need any updates, features, or enhancements!
