Developed by: Eranda Samarasinghe
This repository focuses on full-stack development using the MERN stack. It highlights API security, scalable architecture, and database management, while also implementing advanced 2FA authentication using email OTP. Additionally, it is integrated with CI/CD and deployed on AWS EC2 helping to learn cloud infrastructure and automation
The main objectives of this application are to:
- Implemented JWT authentication to secure API endpoints and manage sessions
- Built a scalable architecture with modular code using Node.js and Express.js
- Used MongoDB for efficient and flexible data storage
- Integrated frontend authentication in React for a smooth user experience
Core technologies used:
- MERN Stack, JWT Authentication
- Set up environment variables:
# MongoDB Connection URI
MONGO_URI = mongo_uri
# Application Port
PORT = 5000
# JWT Secret Key for Authentication
JWT_SECRET = secret_key
# Environment Mode (development or production)
NODE_ENV = development
# Mailtrap Configuration for Email Handling
MAILTRAP_TOKEN = mailtrap_token
MAILTRAP_ENDPOINT = https://send.api.mailtrap.io/
# Frontend Application URL
CLIENT_URL = http://localhost:5173
- Clone repository:
git clone https://github.com/dev-eranda/mern-auth-techniques.git 
- Install dependencies:
npm install 
- Build the Frontend Application:
npm run build 
- Start the Server Application:
npm start 
- Open http://localhost:5000 with your browser to see the result.