Skip to content

Paramith2004/user-registration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌟 User Registration System

Node.js Express.js MongoDB Mongoose License: MIT Made with ❤️


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.


🚀 Features

✅ 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


🛠️ Tech Stack

Layer Technology
Backend Node.js, Express.js
Database MongoDB (Mongoose ORM)
View Engine EJS
Testing Postman

📂 Project Structure

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

⚙️ Installation & Setup

1️⃣ Clone the repository

git clone https://github.com/<your-username>/user_registration.git
cd user_registration

2️⃣ Install dependencies

npm install

3️⃣ Setup MongoDB

  • Make sure MongoDB is running locally or use MongoDB Atlas.
  • Add your connection string in index.js or in a .env file (if using dotenv).

4️⃣ Start the server

node index.js

Server will start on http://localhost:3000 🚀


🧪 API Endpoints (for Postman)

Method Endpoint Description
POST /register Register a new user
POST /login Log in a user
GET /success Display success page

Example Request Body

{
  "name": "John Doe",
  "email": "john@example.com",
  "password": "mypassword123"
}

🔒 Security

  • Passwords are hashed using bcrypt before saving to the database.
  • Emails are unique and validated.
  • No plain text credentials are stored.

💡 Future Improvements

  • Add JWT authentication
  • Include “Forgot Password” feature
  • Add profile management and user dashboard
  • Implement full CRUD functionality (Read, Update, Delete)

🧑‍💻 Author

Paramith Kavisha
📧 paramithkavisha@gmail.com
💻 https://github.com/Paramith2004


🌈 License

This project is licensed under the MIT License — feel free to use and modify!


⭐ Don’t forget to star this repo if you found it helpful!

About

User Registration System in Node.js and MongoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published