A simple yet powerful User Registration System built using Node.js, Express.js, and MongoDB.
This project allows users to register, log in, and manage their data with secure password hashing and clean RESTful API design.
✅ Register new users with validation
✅ Store user data securely in MongoDB using Mongoose
✅ Unique email validation to prevent duplicates
✅ Passwords encrypted using bcrypt
✅ Modular project structure (Models, Routes, Views)
✅ API testing supported via Postman
| Layer | Technology |
|---|---|
| Backend | Node.js, Express.js |
| Database | MongoDB (Mongoose ORM) |
| View Engine | EJS |
| Testing | Postman |
user_registration/
│
├── models/
│ └── user.js # Mongoose User Schema
│
├── routes/
│ └── userRoutes.js # Express Routes (Register, Login)
│
├── views/
│ ├── register.ejs # Registration Form
│ ├── login.ejs # Login Form
│ └── success.ejs # Success Page
│
├── public/
│ └── css/
│ └── style.css # Basic CSS Styling
│
├── app.js # Main Express Application
├── index.js # Entry point / server setup
└── package.json # Dependencies and scripts
git clone https://github.com/<your-username>/user_registration.git
cd user_registrationnpm install- Make sure MongoDB is running locally or use MongoDB Atlas.
- Add your connection string in
index.jsor in a.envfile (if using dotenv).
node index.jsServer will start on http://localhost:3000 🚀
| Method | Endpoint | Description |
|---|---|---|
| POST | /register |
Register a new user |
| POST | /login |
Log in a user |
| GET | /success |
Display success page |
{
"name": "John Doe",
"email": "john@example.com",
"password": "mypassword123"
}- Passwords are hashed using bcrypt before saving to the database.
- Emails are unique and validated.
- No plain text credentials are stored.
- Add JWT authentication
- Include “Forgot Password” feature
- Add profile management and user dashboard
- Implement full CRUD functionality (Read, Update, Delete)
Paramith Kavisha
📧 paramithkavisha@gmail.com
💻 https://github.com/Paramith2004
This project is licensed under the MIT License — feel free to use and modify!