A modern React application for managing employees and grade levels within an organization. Built with React, TypeScript, TailwindCSS, and Zustand for state management.
- Node.js (v18 or higher)
- npm (v9 or higher) or yarn
- Git
git clone <repository-url>
cd voiceserv-taskUsing npm:
npm installOr using yarn:
yarn installUsing npm:
npm run devOr using yarn:
yarn devThe application will start on http://localhost:5173 by default.
Using npm:
npm run buildOr using yarn:
yarn buildUsing npm:
npm run previewOr using yarn:
yarn previewdev- Start development serverbuild- Create production buildpreview- Preview production buildlint- Run ESLint for code quality checks
No environment variables are required to run the application locally. All data is managed in the client-side state.
src/
├── components/ # React components
│ ├── ui/ # Reusable UI components
│ ├── EmployeeForm # Employee creation/editing form
│ ├── EmployeeList # Employee listing and management
│ └── GradeLevelManagement # Grade level management
├── hooks/ # Custom React hooks
├── lib/ # Constants and initial data
├── schemas/ # Zod validation schemas
├── services/ # API and external services
├── store/ # Zustand state management
├── styles/ # CSS and styling files
└── types/ # TypeScript type definitions
- Uses Zustand for global state management
- Main store located in
store/index.ts - Manages employee data and grade levels
- Provides actions for CRUD operations
-
Employee Management
- Employee data stored in Zustand store
- CRUD operations handled through store actions
- Form validation using Zod schemas
- Location data (countries/states) fetched from external API
-
Grade Level Management
- Grade levels stored alongside employee data
- Simple CRUD operations for grade levels
- Grade levels can be assigned to employees
App
├── EmployeeList
│ └── EmployeeForm (Modal)
└── GradeLevelManagement
-
Employee Management
- Add/Edit/Delete employees
- Form validation
- Dynamic location selection (Country/State)
- Role and department assignment
- Pagination
- Sorting and filtering
-
Grade Level Management
- Create/Delete grade levels
- Assign to employees
- Simple interface
-
UI Components
- Reusable button components
- Custom dropdowns
- Form inputs
- Loading states
- Empty states
- Confirmation modals
- Uses Zod for schema validation
- Validates employee data:
- Required fields
- Email format
- Phone number format
- Character limits
- Location data fetched from external API
- Countries and states dynamically loaded
- Error handling for API failures
- React 18
- TypeScript 5
- TailwindCSS 4
- Zustand (State Management)
- Zod (Validation)
- Vite 7
- Headless UI
- Hero Icons
-
Component Organization
- Reusable UI components
- Logical component hierarchy
- Clear separation of concerns
-
State Management
- Centralized store
- Immutable state updates
- Type-safe actions
-
Form Handling
- Controlled components
- Validation feedback
- Error handling
-
UI/UX
- Responsive design
- Loading states
- Error states
- Empty states
- Confirmation dialogs
-
TypeScript
- Strong typing
- Interface definitions
- Type safety
-
Code Organization
- Clear file structure
- Modular components
- Separation of concerns
- Reusable hooks and utilities
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License.