Skip to content

Salman-shaik116/Mini-User-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

51 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Œ Mini User Management System

πŸ“– Project Overview & Purpose

The Mini User Management System is a full-stack web application designed to manage users with secure authentication, role-based access control (RBAC), and administrative functionalities. It allows users to register, log in, manage their profiles, and enables admins to manage users efficiently.

This project demonstrates real-world backend authentication, JWT security, and modern React frontend practices, making it suitable for learning, interviews, and production-level understanding.


πŸ›  Tech Stack Used

Frontend

  • React.js (Vite)
  • Material UI (MUI)
  • React Router DOM
  • Axios
  • React Toastify

Backend

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • JWT (JSON Web Token)
  • bcrypt

Tools & Platforms

  • Postman (API testing)
  • Swagger / OpenAPI (API documentation)
  • Vercel (Frontend deployment)
  • Render / Railway (Backend deployment)

βš™οΈ Setup Instructions

πŸ“ Clone the Repository

git clone <repository-url>
cd Mini-User-Management-System

▢️ Frontend Setup

cd Frontend
npm install
npm run dev

Frontend will run on:

http://localhost:5173

▢️ Backend Setup

cd Backend
npm install
npm run dev

Backend will run on:

http://localhost:5000

πŸ” Environment Variables

Frontend (Frontend/.env)

VITE_API_URL=http://localhost:5000/api

Backend (Backend/.env)

PORT=5000
MONGO_URI=mongodb://127.0.0.1:27017/mini_user_management
JWT_SECRET=change-me-to-a-long-random-secret
JWT_EXPIRES_IN=7d
CLIENT_ORIGIN=http://localhost:5173

NOTE :- All the values for the Env varibles are just Examples not real values replace with your own values

⚠️ Do not commit .env files to GitHub


πŸš€ Deployment Instructions

Frontend Deployment (Vercel)

Deployed frontend URL:

https://mini-user-management-system-delta.vercel.app/

  1. Push frontend code to GitHub
  2. Go to Vercel Dashboard
  3. Import GitHub repository
  4. Set environment variable:
 VITE_API_URL=<backend-url>/api
  1. Deploy πŸš€

Backend Deployment (Railway)

Deployed backend URL:

https://mini-user-management-system-production.up.railway.app

  1. Push backend code to GitHub

  2. Create a new Railway service (root directory: Backend/)

  3. Add environment variables in Railway dashboard

  4. Set start command:

    npm start
  5. Deploy πŸš€


πŸ”‘ API Documentation

πŸ”Ή Authentication APIs

Method Endpoint Description
POST /api/auth/signup Register new user
POST /api/auth/login Login user
GET /api/auth/me Get current user
POST /api/auth/logout Logout user

Example – Login Request

POST /api/auth/login
{
  "email": "user@example.com",
  "password": "StrongPassword123"
}

Example – Login Response

{
  "success": true,
  "message": "Login successful",
  "data": {
    "token": "jwt-token-here"
  }
}

πŸ”Ή User APIs

Method Endpoint Description
GET /api/users/me Get logged-in user
PUT /api/users/me Update profile
PUT /api/users/me/change-password Change password

πŸ”Ή Admin APIs

Method Endpoint Description
GET /api/users Get all users (Admin only)
PATCH /api/users/:id/activate Activate user
PATCH /api/users/:id/deactivate Deactivate user

Documentation

βœ… Postman Collection

Postman supports importing OpenAPI specs. Import Backend/openapi.yaml into Postman to generate a collection.

Shared collection link:

https://my-team-7869.postman.co/workspace/Personal-Workspace~75875260-af63-406e-8008-4388879f7de2/collection/37748553-f0590815-b85a-4868-b1cd-22b259037767?action=share&creator=37748553


Example – Get my profile

curl http://localhost:5000/api/users/me \
  -H "Authorization: Bearer <jwt-token>"

Example – Admin list users (page 1)

curl "http://localhost:5000/api/users?page=1&limit=10" \
  -H "Authorization: Bearer <admin-jwt-token>"

πŸ”’ Security Features

  • JWT-based authentication
  • Role-based access control (Admin/User)
  • Password hashing using bcrypt
  • Protected routes on frontend & backend
  • Token invalidation on logout

πŸ‘¨β€πŸ’» Author

Salman Full Stack Web Developer (Student)


About

User Management System a web application that manages user accounts with different roles and permissions. role-based authorization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages