Skip to content

mufeed-dev/MINI-UMS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

User Management System (UMS) πŸ”

A robust User Management System built with Node.js, Express, and MongoDB featuring role-based access control and secure authentication flows.

πŸš€ Features

  • Role-Based Access Control (Admin/User)
  • Secure Authentication with session management
  • Email Verification workflow
  • Password Hashing & token generation
  • MVC Architecture for clean code organization
  • Middleware Integration for request handling

πŸ› οΈ Tech Stack

  • Backend: Node.js, Express.js
  • Database: MongoDB with Mongoose
  • Authentication: Session-based with security layers
  • Architecture: MVC Pattern

πŸ“ Project Structure

ums/
β”œβ”€β”€ models/                 # Database models
β”œβ”€β”€ views/                  # Frontend templates
β”œβ”€β”€ controllers/            # Business logic
β”œβ”€β”€ routes/                 # Application routes
β”‚   β”œβ”€β”€ userRoute.js       # User routes
β”‚   └── adminRoute.js      # Admin routes
β”œβ”€β”€ middleware/             # Custom middlewares
β”œβ”€β”€ public/                 # Static assets
└── config/                 # Configuration files

πŸ”§ Installation

  1. Clone the repository
git clone https://github.com/your-username/user-management-system.git
cd user-management-system
  1. Install dependencies
npm install
  1. Start MongoDB
mongod
  1. Run the application
npm start
  1. Access the application
User Panel: http://localhost:3000
Admin Panel: http://localhost:3000/admin

🎯 Key Learning Outcomes

Architecture & Patterns

  • MVC Pattern: Clear separation of Models, Views, and Controllers
  • Middleware Power: Strategic request processing at different layers
  • Folder Structure: Impact on code maintainability and scalability

Security Implementation

  • Multi-layer Authentication: Multiple security checks for robust protection
  • Session Management: Secure user session handling
  • Password Security: Hashing and token generation best practices
  • Email Verification: Complete user verification workflow

Access Control

  • Role-Based Permissions: Different access levels for Admin and Users
  • Route Protection: Secure endpoint access based on user roles

πŸ” Authentication Flow

  1. User Registration with email verification
  2. Secure Login with session creation
  3. Role-based Authorization for different access levels
  4. Protected Routes with middleware checks
  5. Secure Logout with session destruction

πŸ“ API Routes

User Routes (/)

  • GET / - Home page
  • GET /login - User login
  • GET /register - User registration
  • POST /verify-email - Email verification

Admin Routes (/admin)

  • GET /admin - Admin dashboard
  • GET /admin/users - User management
  • POST /admin/users - User operations

🎨 Features Demo

  • βœ… User Registration & Email Verification
  • βœ… Secure Login/Logout System
  • βœ… Admin & User Role Separation
  • βœ… Session-based Authentication
  • βœ… Password Security with Hashing
  • βœ… Protected Routes with Middleware

🀝 Contributing

Feel free to contribute to this project by submitting issues or pull requests.

πŸ“„ License

This project is open source and available under the MIT License.

About

A beginner-friendly πŸ’»role-based authentication system featuring email verification, admin/user dashboards, and MVC architecture

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors