Skip to content

Alqamaq/employee-managment-system

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏒 EmpoManager

Employee Management System β€” Frontend

React TypeScript Redux Toolkit Tailwind CSS React Router Vite


A full-featured employee management platform with role-based dashboards, secure authentication, task management, leave tracking, and real-time team visibility.


Dashboard Preview


πŸ“‹ Table of Contents


Overview

EmpoManager is a React + TypeScript frontend for managing employees, tasks, departments, and leave β€” built with low-level design principles, secure authentication, and a clean component architecture.

Role Access
Admin Full dashboard Β· Manage employees Β· Assign tasks Β· View reports Β· Manage departments
Employee Personal dashboard Β· View own tasks Β· Apply for leave Β· View schedule & colleagues

Tech Stack

Category Technology
Framework React 18 + TypeScript
Routing React Router v6
State Redux Toolkit
Styling Tailwind CSS
Build tool Vite
HTTP Axios (or fetch)
Notifications React Hot Toast
SEO React Helmet

Features

πŸ” Secure Authentication

  • Redux Toolkit stores all auth state β€” user info, role, login status, token
  • Email and password validated with regex before any form submission
  • Auth token stored in localStorage β€” never plain passwords
  • Role-based route guards block cross-role access automatically
  • GuestRoute prevents logged-in users from revisiting login or signup

πŸ—‚ Redux Toolkit State

  • authSlice β€” user, loginStatus, role, token
  • employeeSlice β€” employee list, selected employee, loading, error states
  • Async thunks simulate real API calls for all CRUD operations
  • Selectors provide clean access to state without prop drilling

πŸ‘¨β€πŸ’Ό Admin Dashboard

  • Stat overview β€” employee count, active tasks, completion rate, departments
  • Employee table β€” search, department filter, add / edit / delete with confirm dialog
  • Task management β€” create, assign to employee, filter by status, mark done, delete
  • Reports β€” completion by department, employee performance table, CSV export
  • Department management β€” workload cards, add / edit departments

πŸ‘€ Employee Dashboard

  • Personal stats β€” my tasks, completed count, leave balance, next meeting time
  • Task list scoped to logged-in employee only β€” mark in-progress or done
  • Leave management β€” balance cards (annual/sick/casual), apply form, history table
  • Schedule β€” 7-day week strip, click any day to see its meetings
  • Colleagues β€” team grid with online / away / offline status
  • Announcements β€” company-wide notices filtered by type

🎨 UI/UX Standards

  • Fully responsive β€” mobile, tablet, and desktop layouts
  • Reusable component library: Button, Input, Modal, Table, Badge, EmptyState, Loader
  • Inline form validation errors, success toasts, and loading indicators
  • Accessible β€” proper aria-label, focus outlines, sufficient contrast ratios
  • Debounced inputs β€” validation doesn't fire on every keystroke

⚑ SEO & Performance

  • Unique <title> and <meta description> per page via React Helmet
  • Semantic HTML β€” <header>, <main>, <section>, <nav> used correctly
  • All pages lazy-loaded with React.lazy + Suspense
  • SVG icons used throughout β€” zero extra image HTTP requests
  • Environment variables separate dev, staging, and production API base URLs

Folder Structure

src/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ shared/          # StatCard, TaskItem, StatusBadge, Avatar, ProgressBar
β”‚   β”œβ”€β”€ admin/           # EmployeeTable, CreateTaskForm, ActivityFeed, DepartmentCard
β”‚   β”œβ”€β”€ employee/        # LeaveBalanceCards, ScheduleList, ColleagueCard, AnnouncementCard
β”‚   └── ui/              # Button, Input, Modal, Loader, EmptyState, FilterBar
β”‚
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ public/          # Home, About, Login, Signup
β”‚   β”œβ”€β”€ admin/           # AdminDashbord, AdminEmployees, AdminTasks, AdminReports, AdminDepartment
β”‚   └── employee/        # EmpolyDashBoard, EmployeeTasks, EmployeeLeave, EmployeeSchedule, Colleagues, Annoucments
β”‚
β”œβ”€β”€ store/
β”‚   β”œβ”€β”€ store.js         # Redux store config
β”‚   β”œβ”€β”€ authSlice.js     # Auth state β€” user, role, loginStatus, token
β”‚   └── employeeSlice.js # Employee list, CRUD async thunks, loading/error states
β”‚
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ useAuth.js       # Access auth state and actions
β”‚   β”œβ”€β”€ useLogout.js     # Clear state + localStorage + redirect
β”‚   └── useValidator.js  # Email/password regex validation helpers
β”‚
β”œβ”€β”€ context/
β”‚   └── AuthProvider.jsx # Auth context wrapping the app
β”‚
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ validators.js    # Regex patterns for email and password
β”‚   └── formatters.js    # Date, name, and number formatters
β”‚
β”œβ”€β”€ imports.js           # Central re-export file for all pages and components
β”œβ”€β”€ Layout.jsx           # Root layout with Outlet
β”œβ”€β”€ main.jsx             # App entry β€” providers + router
└── index.css            # Tailwind imports + CSS design tokens

Routing Architecture

/ (Layout)
β”œβ”€β”€ /                     β†’ Home             [public]
β”œβ”€β”€ /about                β†’ About            [public]
β”œβ”€β”€ /login                β†’ Login            [guest only β€” redirects if logged in]
β”œβ”€β”€ /signup               β†’ Signup           [guest only β€” redirects if logged in]
β”‚
└── /DashBoard            β†’ Dashboard shell  [protected β€” must be logged in]
    β”œβ”€β”€ index             β†’ RoleRedirect     [admin β†’ AdminDashbord, employee β†’ employeedashboard]
    β”œβ”€β”€ /overview         β†’ OverView         [any logged-in user]
    β”œβ”€β”€ /settings         β†’ Settings         [any logged-in user]
    β”‚
    β”œβ”€β”€ [AdminRoute]      β†’ admin role only
    β”‚   β”œβ”€β”€ /AdminDashbord
    β”‚   β”œβ”€β”€ /AdminEmployees
    β”‚   β”œβ”€β”€ /AdminTasks
    β”‚   β”œβ”€β”€ /AdminReports
    β”‚   β”œβ”€β”€ /AdminDepartment
    β”‚   └── /AdminProfile
    β”‚
    └── [EmployeeRoute]   β†’ employee role only
        β”œβ”€β”€ /employeedashboard
        β”œβ”€β”€ /EmployeeTasks
        β”œβ”€β”€ /EmployeeLeave
        β”œβ”€β”€ /EmployeeSchedule
        β”œβ”€β”€ /Colleagues
        └── /Annoucments

Route Guards

Guard Behaviour
ProtectedRoute Redirects to /login if not logged in
GuestRoute Redirects to /DashBoard if already logged in
AdminRoute Redirects employee β†’ /DashBoard/employeedashboard
EmployeeRoute Redirects admin β†’ /DashBoard/AdminDashbord
RoleRedirect Reads role and sends user to the correct index page

Build Steps

Follow these steps in order for the cleanest development experience:

# Step What to build
1 Setup & Base Layout Init Vite + TypeScript, configure React Router, create outer shell (navbar + sidebar + main), make responsive from day one
2 Design System Tailwind config with color variables, typography scale, CSS design tokens in index.css
3 Authentication UI Login + Signup pages, regex validation, password toggle, role selection, disable submit on invalid
4 Route Guards ProtectedRoute, GuestRoute, AdminRoute, EmployeeRoute, RoleRedirect, 404 fallback
5 Redux Setup authSlice, employeeSlice, async thunks, selectors, connect Provider in main.jsx
6 Admin Pages AdminDashbord, AdminEmployees, AdminTasks, AdminReports, AdminDepartment
7 Employee Pages EmpolyDashBoard, EmployeeTasks, EmployeeLeave, EmployeeSchedule, Colleagues, Annoucments
8 Data States Loader, EmptyState, error banners, disable-during-fetch patterns
9 TypeScript Strict Interfaces for all data shapes, typed props, typed Redux state, remove all any
10 Responsiveness Mobile bottom nav, single-column stacking, test at 375px / 768px / 1280px
11 SEO & Performance React Helmet per page, React.lazy all pages, SVG icons, .env config

App Flow

User opens app
      β”‚
      β–Ό
  Logged in?
  β”œβ”€β”€ NO  β†’ Public pages (Home, About, Login, Signup)
  └── YES β†’ Check role
              β”œβ”€β”€ admin    β†’ /DashBoard/AdminDashbord
              └── employee β†’ /DashBoard/employeedashboard
                                      β”‚
                              User works in dashboard
                                      β”‚
                              Clicks Logout
                                      β”‚
                              Clear token + state
                                      β”‚
                              Redirect to /  (Home)

                              
 

Built with ❀️ using React · TypeScript · Redux Toolkit · Tailwind CSS

About

Project live link

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 78.0%
  • CSS 14.8%
  • JavaScript 6.9%
  • HTML 0.3%