A lightweight, full-stack Human Resource Management System for managing employees and tracking attendance.
- Frontend URL: https://hrms-lite-nu.vercel.app/
- Backend API: https://hrms-lite-w4c2.onrender.com
- β Add new employees with unique ID, name, email, and department
- β View all employees in a clean, organized table
- β Delete employees (with cascading deletion of attendance records)
- β Input validation and error handling
- β Duplicate employee ID and email detection
- β Mark daily attendance (Present/Absent) for employees
- β View all attendance records with employee details
- β Filter attendance by date
- β Filter attendance by employee
- β View attendance summary (total present/absent days per employee)
- β Prevent duplicate attendance entries for same employee on same date
- β Overview statistics (total employees, attendance records)
- β Today's attendance summary (present/absent count)
- β Department distribution visualization
- β Quick action buttons
- React 18.2.0 - UI library
- React Router 6.21.0 - Client-side routing
- Axios 1.6.2 - HTTP client
- React Icons 4.12.0 - Icon library
- CSS3 - Styling
- Node.js - Runtime environment
- Express.js 4.18.2 - Web framework
- MongoDB - Database
- Mongoose 8.0.3 - ODM for MongoDB
- Validator 13.11.0 - Input validation
- CORS - Cross-origin resource sharing
- Frontend: Vercel / Netlify
- Backend: Render / Railway / Heroku
- Database: MongoDB Atlas
- Node.js (v14 or higher)
- MongoDB (local installation or MongoDB Atlas account)
- npm or yarn
- Navigate to the backend directory:
cd backend- Install dependencies:
npm install- Create a
.envfile in the backend directory:
PORT=5500
MONGODB_URI=your_mongodb_connection_string
NODE_ENV=production- Start the server:
# Development mode
npm run dev
# Production mode
npm startThe backend will run on http://localhost:5500
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Create a
.envfile in the frontend directory:
REACT_APP_API_URL=http://localhost:5500/apiFor production, update this to your deployed backend URL.
- Start the development server:
npm startThe frontend will run on http://localhost:3000
- Create a new Web Service on Render or Railway
- Connect your GitHub repository
- Configure build settings:
- Build Command:
cd backend && npm install - Start Command:
cd backend && npm start
- Build Command:
- Add environment variables:
MONGODB_URI: Your MongoDB Atlas connection stringNODE_ENV:productionPORT: (Usually auto-assigned by the platform)
- Deploy and note your backend URL
- Create a new project on Vercel or Netlify
- Connect your GitHub repository
- Configure build settings:
- Base directory:
frontend - Build command:
npm run build - Publish directory:
build
- Base directory:
- Add environment variables:
REACT_APP_API_URL: Your deployed backend URL (e.g.,https://your-backend.onrender.com/api)
- Deploy and note your frontend URL
- Create a free account on MongoDB Atlas
- Create a new cluster
- Create a database user with password
- Whitelist your IP (or use 0.0.0.0/0 for development)
- Get your connection string and add it to your environment variables
http://localhost:5500/api
Get all employees
GET /api/employeesGet single employee
GET /api/employees/:idCreate employee
POST /api/employees
Content-Type: application/json
{
"employeeId": "EMP001",
"fullName": "John Doe",
"email": "john.doe@company.com",
"department": "Engineering"
}Delete employee
DELETE /api/employees/:idGet all attendance records
GET /api/attendance
GET /api/attendance?employeeId=EMP001
GET /api/attendance?date=2025-01-28Get attendance summary for employee
GET /api/attendance/summary/:employeeIdMark attendance
POST /api/attendance
Content-Type: application/json
{
"employeeId": "EMP001",
"date": "2025-01-28",
"status": "Present"
}Get dashboard statistics
GET /api/dashboard/statsHealth check
GET /api/health- Clean, modern, and professional design
- Responsive layout (mobile, tablet, desktop)
- Loading states for async operations
- Empty states with helpful messages
- Error handling with user-friendly messages
- Form validation with inline error display
- Modal dialogs for data entry
- Filter functionality for better data management
- Badge components for status indicators
- Smooth transitions and hover effects
- Employee ID: Required, unique
- Full Name: Required, minimum 2 characters
- Email: Required, valid format, unique
- Department: Required
- Employee ID: Required, must exist
- Date: Required
- Status: Required (Present/Absent)
- No duplicate attendance for same employee on same date
All API errors return structured JSON:
{
"success": false,
"message": "Error description",
"error": "Technical details (in development)"
}hrms-lite/
βββ backend/
β βββ models/
β β βββ Employee.js
β β βββ Attendance.js
β βββ routes/
β β βββ employees.js
β β βββ attendance.js
β β βββ dashboard.js
β βββ server.js
β βββ package.json
β βββ .env.example
β βββ .gitignore
βββ frontend/
β βββ public/
β β βββ index.html
β βββ src/
β β βββ components/
β β β βββ Navbar.js
β β β βββ Navbar.css
β β βββ pages/
β β β βββ Dashboard.js
β β β βββ Dashboard.css
β β β βββ Employees.js
β β β βββ Employees.css
β β β βββ Attendance.js
β β β βββ Attendance.css
β β βββ services/
β β β βββ api.js
β β βββ App.js
β β βββ App.css
β β βββ index.js
β β βββ index.css
β βββ package.json
β βββ .env.example
β βββ .gitignore
βββ README.md
- Single admin user (no authentication required as per requirements)
- All dates are stored in UTC
- Employee IDs are case-insensitive (converted to uppercase)
- Email addresses are case-insensitive (converted to lowercase)
- No user authentication/authorization
- No edit functionality for employees (can delete and re-add)
- No edit functionality for attendance records
- No advanced reporting or analytics
- No file upload/download features
- No role-based access control
- No audit logging
- User authentication and authorization
- Edit employee and attendance records
- Advanced filtering and search
- Export data to CSV/Excel
- Email notifications
- Leave management
- Payroll integration
- Performance reviews
- Document management
- Multi-tenancy support
- None at the moment
Employee Schema
{
employeeId: String (unique, uppercase),
fullName: String,
email: String (unique, lowercase),
department: String,
timestamps: true
}Attendance Schema
{
employeeId: String (ref: Employee),
date: Date,
status: String (enum: ['Present', 'Absent']),
timestamps: true
}This is an assignment project and is not open for contributions.
MIT License - This project is created for educational and assignment purposes.
Aayush Dixit.
Note: Please update the Live Demo URLs, MongoDB connection string, and deployment-specific configurations before submitting.