Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SmartHR Nexus β€” AI Workforce Platform

AI-powered Human Resource Management System for enterprises supporting 5,000+ employees.

Tech Stack License


πŸ–₯️ Project Overview

SmartHR Nexus is a state-of-the-art, full-stack HRMS with dedicated, role-based dashboards, real-time attendance tracking, payroll automation, candidate recruitment pipelines, and an advanced AI HR assistant (ARIA) powered by Google Gemini.

The platform is architected with React 18, Node.js, Express, MongoDB (Mongoose), Redis (for session management and caching), Socket.io (for real-time events), and Tailwind CSS for styling.

Repository: github.com/adityakr1108/SmartHR-Nexus-AI-Workforce-Platform


πŸ“Έ Screenshots

πŸ–₯️ Admin Dashboard View

Admin Dashboard

πŸ§‘β€πŸ’» Employee Dashboard View

Employee Dashboard

πŸ“… Manager Leave Approvals View

Manager Leave Approvals

🎯 HR Recruiter Candidate Pipeline View

Candidate Pipeline

πŸ’¬ ARIA β€” Floating AI HR Assistant View

ARIA AI Assistant


πŸ‘₯ Role-Based Functionalities (Member Access Guide)

SmartHR Nexus implements a robust role-based access control (RBAC) system with 5 distinct roles. Each role is served a tailored dashboard and set of features:

1. πŸ‘‘ Super Admin

  • System-wide Settings: Access to global settings, theme preferences, active integrations, and system logs.
  • Access Control: Promotes, demotes, or deactivates user accounts.
  • Infrastructure Management: Monitors database and Redis connection health statistics.
  • Full CRUD Scope: Holds override rights for all employee records, department structures, and financial logs.

2. πŸ›‘οΈ Admin (HR Operations)

  • Employee Directory: Perform CRUD operations on employee profiles (Add, Edit, View, and Soft Delete). Handles avatar uploads, education/experience logging, and skills tags.
  • Payroll Processing: Calculates CTC, basic salaries, HRA, allowances, professional taxes, and PF deductions. Automates payslip generation (PDF format) and processes payouts.
  • Department Management: Creates and manages organizational departments (Engineering, HR, Sales, Product, Marketing, Finance, Design, Operations), configures budgets, and assigns Department Heads.
  • Analytics & Reports: Generates system-wide summaries, exportable attendance reports, and payroll histories.

3. πŸ’Ό Senior Manager

  • Team Dashboard: Displays real-time attendance, daily check-in statuses, and overall performance ratings of direct reports.
  • Leave Approvals: Real-time workflow (Approve/Decline) for team leave requests. Approving dynamically deducts from the employee's respective leave balance.
  • Performance Evaluations: Submits quarterly/annual performance reviews, scores key metrics (technical, communication, teamwork, leadership, productivity), and triggers AI Performance Insights for recommendations.

4. 🎯 HR Recruiter

  • Job Listings: Creates and manages public/internal job listings, outlining requirements, salary ranges, experience, and remote/hybrid work modes.
  • Visual Candidate Pipeline: Interactive drag-and-drop pipeline board tracking applicants across 8 hiring stages (Applied, Screening, Shortlisted, HR Interview, Technical Interview, Offer Sent, Hired, Rejected).
  • AI Resume Screening: Uploads PDF/Docx resumes and processes them through the Gemini AI Engine. Returns a compatibility score (0-100), key strengths, weaknesses, and a structured hiring recommendation.

5. πŸ§‘β€πŸ’» Employee (Self-Service)

  • Personal Dashboard: View daily check-in times, upcoming leaves, pending performance reviews, and notifications.
  • Real-time Attendance: One-click check-in and check-out tracking (Status: Present, Late, Absent, On Leave).
  • Leave Center: Submits leave requests with date selectors and reason descriptions. Displays real-time balances for Annual, Sick, Casual, Maternity, Paternity, and Unpaid leaves.
  • My Payslips: Securely view and download PDF payslips for previous pay cycles.
  • My Performance: Completes self-assessments, views manager feedback, and tracks progress on personal goals.

🧠 Core System Concepts

1. AI Engine (Google Gemini Integration)

  • ARIA HR Chatbot: A floating voice-and-text chatbot accessible from any dashboard. It provides answers to company policy questions, helps calculate leave balances, and interfaces with the database to retrieve user-specific information.
  • AI Resume Scorer: Uses Gemini Flash/Pro to parse resumes, compare text against job descriptions, and output standard JSON evaluations (score, summary, strengths, weaknesses).
  • Performance Insights: Generates actionable growth summaries and coaching points based on manager review scores.
  • Payroll Optimizer: Recommends tax-efficient structures for allowances and deductions to optimize the employee's in-hand salary.

2. Security & Session Lifecycle

  • Dual-Token System: Authenticates with a short-lived JSON Web Token (Access Token) passed via HTTP headers and a long-lived Refresh Token stored in a secure, httpOnly cookie.
  • Redis Token Blacklisting: On sign-out, the user's access token is cached in Redis with a TTL matching the token expiry. Any subsequent request with a blacklisted token is rejected.
  • Account Lockout: Locks accounts for 2 hours after 5 consecutive failed login attempts to prevent brute-force attacks.
  • Soft Delete: The database uses schema pre-middlewares to automatically exclude records containing a deletedAt timestamp from standard query results.

3. Real-time Infrastructure (WebSockets)

  • Socket.IO Rooms: Users are joined to rooms matching their role (role:admin, role:senior_manager, etc.) and individual ID (user:<id>).
  • Live Notifications: Dispatches real-time pop-ups for attendance check-ins, leave submissions, and approval status changes.

πŸ“‚ Project Structure

SmartHR/
β”œβ”€β”€ frontend/                 # React 18 + Vite + Tailwind CSS
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/       # Layouts, Sidebar, Header, AIAssistant
β”‚   β”‚   β”œβ”€β”€ pages/            # Auth, Admin, Manager, Recruiter, Employee pages
β”‚   β”‚   β”œβ”€β”€ store/            # Redux Toolkit slices (auth, ui, notifications)
β”‚   β”‚   └── services/         # Axios API Client + Gemini AI
β”‚   └── vite.config.js
β”œβ”€β”€ backend/                  # Node.js + Express REST API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/           # MongoDB Atlas, Upstash Redis
β”‚   β”‚   β”œβ”€β”€ controllers/      # Route controllers (auth, employee, leave, etc.)
β”‚   β”‚   β”œβ”€β”€ models/           # Mongoose schemas (User, Employee, Attendance, Leave)
β”‚   β”‚   β”œβ”€β”€ routes/           # Express routes
β”‚   β”‚   β”œβ”€β”€ middleware/       # JWT auth, rate limiter, security, error handling
β”‚   β”‚   β”œβ”€β”€ services/         # Gemini AI & Nodemailer SMTP services
β”‚   β”‚   └── utils/            # Winston logger, DB seeder, socket handlers
β”‚   └── uploads/              # Local storage for avatars, resumes, documents
β”œβ”€β”€ docker-compose.yml
└── package.json              # npm workspaces config

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • MongoDB 6+ (or Atlas connection string)
  • Redis 7+ (or Upstash Redis)
  • Google Gemini API key (Get one here)

1. Clone and Install Dependencies

git clone https://github.com/adityakr1108/SmartHR-Nexus-AI-Workforce-Platform.git
cd SmartHR-Nexus-AI-Workforce-Platform

# Install root, frontend, and backend packages
npm run install:all

2. Configure Backend Environment

cd backend
cp .env.example .env

Open backend/.env and configure at minimum:

  • MONGODB_URI β€” MongoDB connection string.
  • REDIS_URL β€” Redis server URI.
  • JWT_SECRET & JWT_REFRESH_SECRET β€” Long random strings.
  • GEMINI_API_KEY β€” Your Gemini API Key.

3. Configure Frontend Environment

cd ../frontend
cp .env.example .env
  • Keep VITE_API_URL=/api/v1 for Vite proxies.
  • Add your VITE_GEMINI_API_KEY for client-side chat widgets.

4. Run the Development Servers

From the repository root, run both servers concurrently:

npm run dev
# β†’ Frontend: http://localhost:3000
# β†’ Backend:  http://localhost:5000

5. Seed the Database

Seed mock departments, profiles, attendance records, payslips, leaves, and applications:

cd backend
node src/utils/seeder.js --reset

πŸ”‘ Demo Login Credentials

Role Email Password
Admin admin@demo.com Admin@1234
Senior Manager manager@demo.com Manager@1234
HR Recruiter hr@demo.com HR@12345
Employee employee@demo.com Employee@1234

πŸ› οΈ API Reference

Base URL: http://localhost:5000/api/v1

Authentication

  • POST /auth/login β€” Sign in.
  • POST /auth/register β€” Register a new account.
  • GET /auth/me β€” Retrieve logged-in user profile.
  • POST /auth/logout β€” Blacklist token and clear cookies.
  • POST /auth/refresh-token β€” Rotate JWT access token.

Employee Directory

  • GET /employees β€” Fetch directory listing.
  • POST /employees β€” Create new profile.
  • GET /employees/:id β€” Get employee details.
  • PUT /employees/:id β€” Update profile.
  • DELETE /employees/:id β€” Soft-delete employee.

Attendance Flow

  • POST /attendance/checkin β€” Check-in.
  • POST /attendance/checkout β€” Check-out.
  • GET /attendance/today β€” Fetch today's check-in status.
  • GET /attendance β€” History (filters: employeeId, date ranges).

Leave Management

  • GET /leaves β€” Fetch leaves history (filtered by employee).
  • POST /leaves β€” Request a leave.
  • PATCH /leaves/:id/approve β€” Approve request (Manager/Admin).
  • PATCH /leaves/:id/reject β€” Decline request (Manager/Admin).

Payroll Management

  • GET /payroll β€” Fetch payroll logs.
  • POST /payroll/process β€” Auto-calculate monthly salaries.
  • PATCH /payroll/:id/approve β€” Approve payslip and lock database record.

Recruitment & AI Screening

  • GET /recruitment/jobs β€” Fetch job postings.
  • POST /recruitment/jobs β€” Post job requirements.
  • POST /recruitment/applications β€” Submit application with resume.
  • PATCH /recruitment/applications/:id/stage β€” Update candidate stage.

🐳 Docker Deployment

To build and run the entire application containerized:

# Set production variables in .env
docker-compose up -d --build

πŸ“„ License

MIT Β© SmartHR Nexus 2026

About

An AI-Powered Human Resource Management System (HRMS) featuring role-based dashboards, automated payroll, real-time attendance, recruitment pipeline boards, and a Google Gemini-driven HR chatbot (ARIA).

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages