A modern, responsive web application built with React, TypeScript, and Tailwind CSS for comprehensive leave management and HR operations.
- Node.js (v18 or higher)
- npm or yarn or bun
- Git
# Clone the repository
git clone <repository-url>
cd Ezify-Cloud/frontend-ezifycloud
# Install dependencies
npm install
# or
yarn install
# or
bun install
# Start development server
npm run dev
# or
yarn dev
# or
bun devThe application will be available at http://localhost:5173
frontend-ezifycloud/
βββ public/ # Static assets
βββ src/
β βββ components/ # Reusable UI components
β β βββ admin/ # Admin-specific components
β β βββ auth/ # Authentication components
β β βββ employee/ # Employee-specific components
β β βββ forms/ # Form components
β β βββ layout/ # Layout components (Sidebar, Header)
β β βββ manager/ # Manager-specific components
β β βββ ui/ # Base UI components (shadcn/ui)
β βββ contexts/ # React contexts (Auth, etc.)
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility libraries and API client
β βββ pages/ # Page components
β β βββ admin/ # Admin pages
β β βββ employee/ # Employee pages
β β βββ manager/ # Manager pages
β β βββ shared/ # Shared pages
β βββ services/ # API service functions
β βββ types/ # TypeScript type definitions
β βββ App.tsx # Main app component
β βββ main.tsx # Application entry point
βββ package.json
βββ tailwind.config.ts
βββ tsconfig.json
βββ vite.config.ts
- React 18 - UI library
- TypeScript - Type safety
- Vite - Build tool and dev server
- React Router - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - Component library
- Lucide React - Icon library
- Radix UI - Headless UI primitives
- React Context - Global state (Authentication)
- React Query - Server state management
- React Hooks - Local state management
- ESLint - Code linting
- TypeScript - Type checking
- Vite - Fast development server
- Admin - Full system access, user management, reports
- Manager - Team management, leave approvals, team reports
- Employee - Personal leave requests, profile management
- User logs in with email/password
- JWT token stored in localStorage
- Role-based routing to appropriate dashboard
- Protected routes require authentication
src/contexts/AuthContext.tsx- Authentication state managementsrc/types/auth.ts- Authentication type definitionssrc/App.tsx- Role-based routing logic
- User Management - Create, update, delete users
- System Settings - Configure leave policies, departments
- Reports & Analytics - Comprehensive reporting
- Audit Logs - System activity tracking
- Department Management - Organize teams
- Team Overview - Team member statistics
- Leave Approvals - Review and approve leave requests
- Team Calendar - Team leave calendar view
- Team Reports - Team performance metrics
- Leave Balance - Available leave days
- Request Leave - Submit new leave requests
- Leave History - Past leave requests
- Profile Management - Update personal information
- Sidebar (
src/components/layout/Sidebar.tsx) - Navigation sidebar - Header (
src/components/layout/Header.tsx) - Top navigation - Layout (
src/components/layout/Layout.tsx) - Main layout wrapper
- LeaveRequestForm (
src/components/forms/LeaveRequestForm.tsx) - Leave request form - UserForm (
src/components/forms/UserForm.tsx) - User creation/editing form
- All components in
src/components/ui/are built with shadcn/ui - Fully customizable and accessible
- Consistent design system
- Base URL: Configurable via environment variables
- Authentication: JWT token in Authorization header
- Error Handling: Centralized error handling
- Type Safety: Full TypeScript support
src/lib/api.ts- Main API clientsrc/services/userService.ts- User-specific API callssrc/types/api.ts- API type definitions
VITE_API_BASE_URL=http://localhost:3000/api
VITE_APP_NAME=Ezify Cloud- Colors: Consistent color palette with semantic naming
- Typography: Inter font family with proper hierarchy
- Spacing: Tailwind's spacing scale
- Components: shadcn/ui component library
- Mobile-first approach
- Breakpoints: sm, md, lg, xl, 2xl
- Grid System: CSS Grid and Flexbox
- Dark Mode: Ready for future implementation
/* Custom CSS in src/index.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
/* Custom component styles */
@layer components {
.btn-primary {
@apply bg-blue-600 hover:bg-blue-700 text-white;
}
}# Development
npm run dev # Start dev server
npm run build # Build for production
npm run preview # Preview production build
# Code Quality
npm run lint # Run ESLint
npm run type-check # Run TypeScript checks
# Testing
npm run test # Run tests (if configured)- Use TypeScript for all new code
- Follow React best practices
- Use functional components with hooks
- Implement proper error handling
// Component template
import React from 'react';
import { ComponentProps } from './types';
interface Props {
// Define props
}
const Component: React.FC<Props> = ({ ...props }) => {
// Component logic
return (
<div>
{/* JSX */}
</div>
);
};
export default Component;- Local State: Use
useStatefor component state - Global State: Use Context for authentication
- Server State: Use React Query for API data
// vite.config.ts
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
});// tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}// tailwind.config.ts
export default {
content: ['./src/**/*.{js,ts,jsx,tsx}'],
theme: {
extend: {
colors: {
primary: 'hsl(var(--primary))',
// Custom colors
},
},
},
plugins: [require('tailwindcss-animate')],
}- Check if backend is running
- Verify API base URL in environment variables
- Clear localStorage if experiencing login issues
- Ensure all dependencies are installed
- Check TypeScript errors
- Verify environment variables
- Check Tailwind CSS configuration
- Verify component imports
- Check for CSS conflicts
# Enable debug logging
VITE_DEBUG=true npm run dev{
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.8.0",
"typescript": "^5.0.0"
}{
"@radix-ui/react-*": "^1.0.0",
"lucide-react": "^0.263.0",
"tailwindcss": "^3.3.0"
}{
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@vitejs/plugin-react": "^4.0.0",
"vite": "^4.4.0"
}npm run buildVITE_API_BASE_URL=https://api.ezifycloud.com/api
VITE_APP_NAME=Ezify Cloud- Vercel - Recommended for React apps
- Netlify - Static site hosting
- AWS S3 + CloudFront - Scalable hosting
- Docker - Containerized deployment
- Create feature branch from
main - Make changes following code style
- Test thoroughly
- Submit pull request
- TypeScript types are correct
- Components are properly structured
- Error handling is implemented
- Responsive design is maintained
- Accessibility standards are met
- React Developer Tools - Browser extension
- TypeScript Playground - Online TypeScript editor
- Tailwind CSS IntelliSense - VS Code extension
For questions or issues:
- Check this README first
- Search existing issues
- Create new issue with detailed description
- Contact development team
Happy Coding! π