A modern, full-stack web application built with Next.js, React, Redux, and MongoDB for comprehensive employee and task management.
- User Login System - Secure authentication with JWT tokens
- Role-based Access Control - Admin and Employee roles with different permissions
- Session Management - Persistent login state with Redux
- Employee Dashboard - Personalized view for each employee
- Profile Management - Employee information and settings
- Task Assignment - Assign tasks to specific employees
- Task Creation - Create new tasks with title, description, date, and category
- Task Assignment - Assign tasks to employees by name
- Status Tracking - Monitor task progress (New, Active, Completed, Failed)
- Task Categories - Organize tasks by type (Design, Development, etc.)
- Admin Dashboard - Overview of all employees and tasks
- Employee Dashboard - Personal task overview and statistics
- Task Statistics - Count of tasks by status
- Real-time Updates - Live data refresh and notifications
- Modern Design - Clean, responsive interface built with Tailwind CSS
- Loading States - Smooth loading indicators for better UX
- Toast Notifications - Success and error feedback for all actions
- Responsive Layout - Works seamlessly on desktop and mobile devices
- Next.js 15 - React framework with App Router
- React 19 - Modern React with hooks and functional components
- Redux Toolkit - State management with RTK Query
- Tailwind CSS 4 - Utility-first CSS framework
- React Toastify - Toast notification system
- Next.js API Routes - Serverless API endpoints
- MongoDB - NoSQL database for data persistence
- Mongoose - MongoDB object modeling for Node.js
- JWT - JSON Web Tokens for authentication
- bcrypt - Password hashing and security
- ESLint - Code quality and consistency
- PostCSS - CSS processing and optimization
- Git - Version control
- Node.js 18+
- MongoDB database
- npm or yarn package manager
-
Clone the repository
git clone <your-repo-url> cd EMS
-
Install dependencies
npm install # or yarn install -
Environment Setup Create a
.envfile in the root directory:MONGODB_URI=your_mongodb_connection_string DB_NAME=your_database_name JWT_SECRET=your_jwt_secret_key
-
Database Setup
- Ensure MongoDB is running
- Update the connection string in your environment variables
- The application will automatically create necessary collections
-
Run the development server
npm run dev # or yarn dev -
Open your browser Navigate to http://localhost:3000
EMS/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ │ ├── task/ # Task-related endpoints
│ │ └── user/ # User authentication endpoints
│ ├── actions/ # Server actions
│ │ ├── task/ # Task business logic
│ │ └── user/ # User business logic
│ ├── layout.js # Root layout component
│ └── page.js # Main application page
├── Components/ # React components
│ ├── Auth/ # Authentication components
│ ├── DashBoard/ # Dashboard components
│ ├── TaskList/ # Task-related components
│ ├── Others/ # Utility components
│ ├── Loader.js # Loading spinner component
│ └── Button.js # Reusable button component
├── models/ # MongoDB schemas
│ ├── user.model.js # User data model
│ └── task.model.js # Task data model
├── store/ # Redux store configuration
│ ├── features/ # Redux slices
│ └── store.js # Store configuration
├── utils/ # Utility functions
│ └── connectDB.js # Database connection
└── middleware/ # Next.js middleware
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
POST /api/user/login- User loginPOST /api/user/logout- User logoutGET /api/user/me- Get current user infoPOST /api/user/register- Register Employee (Only admin)
POST /api/task/create- Create new taskPUT /api/task/update-status- Update task status
- Reusable loading spinner with customizable size and color
- Used throughout the application for consistent loading states
- Enhanced button with loading states and variants
- Supports primary, secondary, danger, and outline styles
- Built-in loading indicators
- Consistent success/error feedback for all user actions
- Integrated with react-toastify for smooth animations
- Password Hashing - bcrypt for secure password storage
- JWT Authentication - Secure token-based authentication
- Input Validation - Server-side validation for all inputs
- Role-based Access - Restricted access based on user roles
- ✅ Core Features - Complete
- ✅ Authentication - Complete
- ✅ Task Management - Complete
- ✅ User Interface - Complete
- ✅ Loading States - Complete
- ✅ Toast Notifications - Complete
Built with ❤️ using Next.js, React, and MongoDB