Email Verification System is a Node.js application using Express for handling HTTP requests, Mongoose for MongoDB database operations, and nodemailer for sending emails. The primary purpose of this application is to handle user email verification during registration.
This project provides a simple email verification system for user registration. It allows users to receive a verification email and verify their email address before gaining full access to the system.
- User registration with email verification.
- Checking email verification status.
- Verifying user's email address.
- Node.js
- npm (Node Package Manager)
- MongoDB
- Clone the repository:
git clone https://github.com/theanuragshukla/mail-verification.git
- Install dependencies:
cd mail-verification
npm install
- Create a
.env
file in the project root and add the following environment variables:
PORT=3000
SERVER_URL=http://localhost:3000
EMAIL=your-email@gmail.com
PASSWORD=your-email-password
Replace your-email@gmail.com
and your-email-password
with the email and password you want to use for sending emails.
- Modify other configurations in the code if needed.
Start the server:
npm start
Your server will be running at http://localhost:3000 .
- /
- Description: Check server status.
- Response: JSON indicating server status.
- /send-mail
- Description: Send email for email verification.
- Request Body:
{
"firebaseId": "your-firebase-id",
"email": "user@example.com"
}
- Response: JSON indicating whether the email was sent successfully.
- /check-status
- Description: Check email verification status.
- Query Parameters:
firebaseId
: Firebase IDemail
: User's email- Response: JSON indicating whether the user is verified.
- /verify
- Description: Verify user's email.
- Query Parameters:
uid
: User ID- Response: JSON indicating whether the email was successfully verified.