# CRUD
This is a full-stack User Management System built with React.js on the frontend and Node.js with Express.js on the backend. It includes user authentication (using JWT) and CRUD operations for managing users. The project supports role-based access control, where admins can manage all users, and regular users can edit their own profile.
git clone https://github.com/your-username/user-management-system.git
cd user-management-system
backend
directory:cd backend
npm install
.env
file in the backend
directory and configure it:MONGO_URI=your-mongodb-uri
JWT_SECRET=your-secret-key
PORT=5000
npm run dev
frontend
directory:cd ../frontend
npm install
.env
file in the frontend
directory and configure it:REACT_APP_API_URL=http://localhost:5000/api
npm start
POST /api/users/register
: Register a new user.POST /api/users/login
: Login and get a JWT token.GET /api/users/
: Get a list of all users (admin only).PUT /api/users/:id
: Update user information.DELETE /api/users/:id
: Delete a user (admin only).backend/
├── config/
│ └── db.js # Database connection setup
├── controllers/
│ └── userController.js # API logic
├── middlewares/
│ └── authMiddleware.js # Authentication middleware
├── models/
│ └── userModel.js # User schema
├── routes/
│ └── userRoutes.js # User routes
└── server.js # Main server file
frontend/
├── public/ # Static files
├── src/
│ ├── components/
│ │ └── AuthForm.jsx # Shared authentication form
│ ├── modules/
│ │ ├── EditUserForm.jsx # User editing form
│ │ ├── UserList.jsx # Admin user list
│ ├── pages/
│ │ ├── RegisterPage.jsx # Registration page
│ │ ├── LoginPage.jsx # Login page
│ │ ├── AdminPage.jsx # Admin dashboard
│ │ └── UserPage.jsx # User profile page
│ ├── App.jsx # Main application file
│ ├── api.js # Axios API setup
└── package.json # Frontend dependencies
http://localhost:3000
in your browser to access the application.This project is licensed under the MIT License.
hasan