A full-stack User Management System built using the MERN stack. The application provides secure authentication, user profile management, and an admin dashboard for managing users.
- User registration
- User login
- JWT-based authentication
- Protected routes
- User profile
- Edit profile
- Profile image upload
- Secure password handling
- Session persistence
- Admin login
- Admin authorization
- View all users
- Search users
- Create users
- Edit users
- Delete users
- Protected admin routes
- React.js
- Redux Toolkit
- React Router
- Axios
- JavaScript
- CSS
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT
- bcrypt
- Multer
- Cloudinary
- CORS
- dotenv
The application uses JWT (JSON Web Token) for authentication.
After login:
- The server validates the user credentials.
- A JWT token is generated.
- The token is stored on the frontend.
- Protected routes verify the token.
- Admin routes additionally check the user's role.
Users can upload a profile image.
The upload flow uses:
React → Express → Multer → Cloudinary → Image URL → MongoDB
Multer handles the uploaded file, while Cloudinary stores the image and provides its URL.
user-management/
│
├── backend/
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── config/
│ └── server.js
│
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── redux/
│ │ ├── routes/
│ │ └── services/
│ └── package.json
│
└── README.md
git clone https://github.com/AfeedaKN/user-management.gitcd user-managementcd backend
npm installcd ../frontend
npm installCreate a .env file inside the backend folder.
Example:
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
PORT=5000Do not upload your .env file to GitHub.
cd backend
npm run devOpen another terminal:
cd frontend
npm run devThe frontend and backend will run separately.
User
│
▼
React Frontend
│
│ Axios
▼
Express API
│
├── Authentication
├── Authorization
├── User Management
│
▼
MongoDB
For profile images:
React
↓
Express
↓
Multer
↓
Cloudinary
↓
Image URL
↓
MongoDB
This project helped me practice:
- MERN Stack
- REST APIs
- CRUD Operations
- JWT Authentication
- Role-Based Authorization
- Password Hashing
- Protected Routes
- Redux Toolkit
- Global State Management
- React Router
- Axios
- Middleware
- Express Controllers
- Mongoose
- MongoDB
- File Upload
- Cloudinary
- Environment Variables
- API Error Handling
- Frontend and Backend Integration
This project was created as a learning project to understand how a full-stack authentication and user management application works from frontend to backend.
Afeeda KN
GitHub: AfeedaKN