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.
- React.js (Vite)
- Material UI (MUI)
- React Router DOM
- Axios
- React Toastify
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT (JSON Web Token)
- bcrypt
- Postman (API testing)
- Swagger / OpenAPI (API documentation)
- Vercel (Frontend deployment)
- Render / Railway (Backend deployment)
git clone <repository-url>
cd Mini-User-Management-Systemcd Frontend
npm install
npm run devFrontend will run on:
http://localhost:5173
cd Backend
npm install
npm run devBackend will run on:
http://localhost:5000
VITE_API_URL=http://localhost:5000/apiPORT=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:5173NOTE :- All the values for the Env varibles are just Examples not real values replace with your own values
.env files to GitHub
Deployed frontend URL:
https://mini-user-management-system-delta.vercel.app/
- Push frontend code to GitHub
- Go to Vercel Dashboard
- Import GitHub repository
- Set environment variable:
VITE_API_URL=<backend-url>/api
- Deploy π
Deployed backend URL:
https://mini-user-management-system-production.up.railway.app
-
Push backend code to GitHub
-
Create a new Railway service (root directory:
Backend/) -
Add environment variables in Railway dashboard
-
Set start command:
npm start
-
Deploy π
| 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 |
POST /api/auth/login
{
"email": "user@example.com",
"password": "StrongPassword123"
}{
"success": true,
"message": "Login successful",
"data": {
"token": "jwt-token-here"
}
}| 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 |
| 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 |
Postman supports importing OpenAPI specs. Import Backend/openapi.yaml into Postman to generate a collection.
Shared collection link:
curl http://localhost:5000/api/users/me \
-H "Authorization: Bearer <jwt-token>"curl "http://localhost:5000/api/users?page=1&limit=10" \
-H "Authorization: Bearer <admin-jwt-token>"- JWT-based authentication
- Role-based access control (Admin/User)
- Password hashing using bcrypt
- Protected routes on frontend & backend
- Token invalidation on logout
Salman Full Stack Web Developer (Student)