This project is a PERN (PostgreSQL, Express.js, React.js, Node.js) based Employee Management System designed to help organizations efficiently manage their employee records, departments, performance reviews, leave requests, and attendance.
- Frontend: React.js
- Backend: Node.js, Express.js
- Database: PostgreSQL
- ORM/Driver:
pgPostgreSQL driver - Session Management:
express-sessionwithconnect-pg-simple - Authentication: Bcrypt password hashing
- API Communication: Axios / Fetch API
- 🔐 Login System (with hashed passwords using bcrypt)
- 👤 Employee CRUD (Add, View, Update, Delete)
- 🏢 Department Management (Create, Assign Manager)
- 📊 Performance Reviews
- 🕒 Attendance Tracking
- 🌴 Leave Requests
- 🔄 Assign Employees to Departments
- 🧪 Form Validation & Error Handling
employee_id(PK)first_name,last_name,email,phone_numberdate_of_birth,hire_date,job_title,salarydepartment_id(FK → departments)
department_id(PK)department_name,locationmanager_id(FK → employees)
review_id(PK)employee_id(FK)review_date,rating(1–5),comments
attendance_id(PK)employee_id(FK)clock_in_time,clock_out_time,work_hours,status,reason
leave_id(PK)employee_id(FK)leave_type,start_date,end_date,status,comments
cd backend
npm install
# Set up .env with your PostgreSQL details:
# PG_USER, PG_PASSWORD, PG_DATABASE, PG_HOST, PG_PORT, FOO_COOKIE_SECRET
npm run dev # or node server.js
🌐 Frontend Setup
cd frontend
npm install
npm start
📝 .env Sample (backend)
PG_USER=your_postgres_user
PG_PASSWORD=your_password
PG_DATABASE=ems_db
PG_HOST=localhost
PG_PORT=5432
FOO_COOKIE_SECRET=random_session_key
🧠 Key Learnings & Considerations ✅ Secure authentication with bcrypt
✅ Robust API routing and PostgreSQL queries
✅ Normalized relational schema design
✅ Effective use of React state management
✅ Clean UI/UX with modular forms and reusable components
✅ Real-world HR system simulation (performance, leaves, attendance)
🚀 Future Enhancements ✅ Add role-based access (Admin vs Employee)
📊 Dashboard charts for attendance/reviews
📱 Mobile responsiveness





