Resource Hub is a comprehensive web application designed for efficient management of organizational resources, including meals, assets, and maintenance tasks. Built with modern React and TypeScript, it provides distinct interfaces and functionalities for Administrators, SuperAdmins, and regular Users with advanced role-based access control.
Note: Add screenshots or demo links here once available
- Features
- Tech Stack
- Project Structure
- Application Routes
- Prerequisites
- Installation
- Usage
- Scripts
- API Integration
- Contributing
- License
- Dashboard: Comprehensive overview of organizational statistics and activities with advanced analytics
- Meal Management:
- Configure meal types (breakfast, lunch, dinner) and custom meal categories
- Set meal times and availability schedules
- Monitor meal requests and generate analytics reports
- Manage requested meals with approval workflows
- Asset Management:
- Add, edit, and delete organizational assets across multiple categories
- Monitor asset requests and allocations in real-time
- Track asset status, availability, and due dates
- Comprehensive asset monitoring with category-based filtering
- Maintenance Management:
- Review and assign maintenance requests across multiple categories
- Set priorities and track task statuses with detailed workflows
- Manage maintenance services including tech support, general maintenance, cleaning, furniture, safety, and lighting
- User Management: Create, edit, and manage user accounts with role-based permissions
- Advanced Reporting: Generate detailed PDF reports for meals, assets, and maintenance activities
- System Settings: Configure application-wide settings and organization details
- Role Switching: SuperAdmins can switch between admin and user views
- Personal Dashboard: View personalized statistics, upcoming activities, and quick actions
- Meal Requests:
- Interactive FullCalendar interface for meal booking and management
- View meal schedules, availability, and personal meal history
- Asset Requests:
- Submit asset requests with category-based filtering
- Track asset request status and due dates
- View personal asset allocation history
- Maintenance Requests: Report maintenance issues and track progress with detailed status updates
- Notifications: Real-time notifications system with unread count indicators
- Profile Settings: Manage personal information, account settings, and theme preferences
- View Organization: Access organization details and user directory
- Advanced Role-Based Access Control: Secure, permission-based interface with support for User, Admin, and SuperAdmin roles
- Responsive Design: Fully optimized for desktop, tablet, and mobile devices
- Advanced Theme Support: Light and dark mode options with dynamic theme switching
- Real-time Notifications: Instant updates, alerts, and notification management system
- PDF Export: Generate and download comprehensive reports
- Protected Routes: Secure routing with authentication and authorization guards
- Multi-Layout Architecture: Separate layouts for Admin and User interfaces
- Context-Based State Management: Efficient global state management with React Context
- Framework: React 18.3.1 with TypeScript 5.5.3
- Build Tool: Vite 5.4.2 (Lightning-fast development and build)
- UI Framework: Material-UI (MUI) 5.14.16
- Styling: Tailwind CSS 3.4.1 + PostCSS 8.4.35
- Routing: React Router DOM 7.5.2
- API Client: Axios 1.9.0
- Data Fetching: TanStack React Query 5.74.7
- Context Management: React Context API for global state
- Authentication: JWT-based authentication with protected routes
- Calendar: FullCalendar 6.1.17 (with React integration)
- Charts & Analytics: Chart.js 4.4.0 + react-chartjs-2 5.2.0, Recharts 2.15.3
- Icons: Material-UI Icons, Lucide React 0.344.0
- Notifications: React Hot Toast 2.5.2, React Toastify 11.0.5
- PDF Generation: html2pdf.js 0.10.3
- Linting: ESLint 9.9.1 with TypeScript support and Prettier integration
- Formatting: Prettier 3.5.3 with consistent code style
- CSS Processing: PostCSS 8.4.35, Autoprefixer 10.4.18
- Type Checking: TypeScript with strict configuration
Resource_Hub-Frontend/
βββ public/ # Static assets and media files
β βββ *.png # Application images and logos
β βββ Asset/ # Asset category icons (Electronics, Furniture, etc.)
β βββ Maintenance/ # Maintenance-related images and categories
β βββ Report/ # Report category icons and assets
β
βββ src/
β βββ App.jsx # Main application component with routing configuration
β βββ main.jsx # Application entry point with providers
β βββ index.css # Global styles (Tailwind base configuration)
β β
β βββ components/ # Reusable UI components organized by feature
β β βββ ProtectedRoute.tsx # Route protection with role-based access control
β β βββ Asset/ # Asset management components
β β β βββ AssetMonitoring/ # Asset monitoring and tracking features
β β β βββ AssetRequestingUser/ # User asset request components and dialogs
β β β βββ OrganizationAssets/ # Organization asset management tools
β β βββ Calendar/ # Calendar and meal scheduling components
β β β βββ CalendarComponents.css # Calendar-specific styling
β β β βββ MealTimeCard.jsx # Meal time selection components
β β β βββ MealTypeCard.jsx # Meal type management
β β β βββ Calender-CSS/ # Calendar styling directory
β β βββ Dashboard/ # Dashboard components for different roles
β β β βββ Admin/ # Admin dashboard features and charts
β β β βββ Common/ # Shared dashboard components
β β β βββ User/ # User dashboard features
β β βββ Maintenance/ # Maintenance management system
β β β βββ Admin/ # Admin maintenance tools and tables
β β β βββ User/ # User maintenance request components
β β β βββ shared/ # Shared maintenance components
β β βββ Meal/ # Meal management system
β β β βββ Meal-CSS/ # Meal-specific styling
β β β βββ MealTime/ # Meal timing components
β β β βββ MealType/ # Meal type management
β β β βββ RequestedMeals/ # Meal request management
β β βββ Notification/ # Notification system components
β β βββ Report/ # Reporting and analytics components
β β βββ Settings/ # Application settings management
β β β βββ Account/ # Account settings
β β β βββ Appearance/ # Theme and appearance settings
β β β βββ Organization/ # Organization configuration
β β β βββ Profile/ # Profile management
β β β βββ Shared/ # Shared settings components
β β βββ Users/ # User management components
β β
β βββ contexts/ # React context providers for global state
β β βββ SidebarContext.tsx # Sidebar state and mobile responsiveness
β β βββ UserContext.tsx # User authentication and role management
β β
β βββ hooks/ # Custom React hooks for reusable logic
β β βββ useNotifications.js # Notification management and real-time updates
β β βββ useThemeStyles.js # Theme and styling utilities
β β
β βββ layouts/ # Page layout structures for different user roles
β β βββ Admin/ # Admin layout with header and sidebar
β β β βββ AdminLayout.jsx # Main admin layout wrapper
β β β βββ AdminHeader.jsx # Admin-specific header with notifications
β β β βββ AdminSidebar.jsx # Admin navigation sidebar
β β βββ User/ # User layout components
β β β βββ UserLayout.jsx # Main user layout wrapper
β β β βββ UserHeader.jsx # User-specific header
β β β βββ UserSidebar.jsx # User navigation sidebar
β β βββ shared/ # Shared layout components
β β βββ BaseLayout.jsx # Base layout structure
β β βββ AppHeader.jsx # Shared header component
β β βββ SidebarWrapper.jsx # Sidebar wrapper component
β β
β βββ pages/ # Top-level page components organized by role
β β βββ Auth/ # Authentication pages
β β β βββ Login.jsx # User login with role-based routing
β β β βββ Register.jsx # User registration
β β β βββ ForgotPassword.jsx # Password recovery
β β βββ Admin/ # Admin-specific pages
β β β βββ DashboardAdmin.jsx # Admin dashboard with analytics
β β β βββ Requested_Assets/ # Asset management pages
β β β βββ Organization_Assets/ # Organization asset pages
β β β βββ Maintenance/ # Maintenance management pages
β β β βββ Meal_Management/ # Meal configuration pages
β β β βββ Reports/ # Report generation pages
β β β βββ UserManagement/ # User administration pages
β β βββ User/ # User-specific pages
β β β βββ DashboardUser.jsx # User dashboard
β β β βββ RequestAsset/ # Asset request pages
β β β βββ MealRequest/ # Meal booking pages
β β β βββ Maintenance/ # Maintenance request pages
β β β βββ ViewUsers/ # User directory pages
β β βββ Shared/ # Pages accessible by multiple roles
β β β βββ Settings.jsx # Settings management
β β β βββ Notification.jsx # Notification center
β β β βββ OrganizationDetails.jsx # Organization information
β β βββ css/ # Page-specific stylesheets
β β
β βββ query/ # React Query hooks for data fetching
β β βββ adminDashboardQueries.js # Admin dashboard data queries
β β βββ userDashboardQueries.js # User dashboard data queries
β β
β βββ services/ # External service integrations and API management
β β βββ api/ # API service configurations
β β βββ config.js # API endpoints and base URLs
β β βββ notificationService.js # Notification API service
β β
β βββ theme/ # Material-UI theme configuration
β β βββ theme.ts # Theme definitions and color schemes
β β βββ ThemeProvider.tsx # Theme provider with context
β β
β βββ utils/ # Utility functions and helpers
β β βββ authHeader.js # Authentication header utilities
β β βββ dateUtils.js # Date manipulation and formatting
β β βββ notificationApi.js # Notification API utilities
β β βββ sendAssetNotification.js # Asset notification helpers
β β
β βββ styles/ # Additional styling resources
β βββ css/ # Global CSS files
β
βββ Configuration Files/
βββ eslint.config.js # ESLint configuration with TypeScript rules
βββ tailwind.config.js # Tailwind CSS configuration and theme
βββ postcss.config.js # PostCSS configuration for CSS processing
βββ vite.config.ts # Vite build configuration and optimization
βββ vercel.json # Vercel deployment configuration
βββ package.json # Project dependencies and npm scripts
/
- Redirects to login page/login
- User authentication/register
- User registration/forgot-password
- Password recovery
/admin-dashboardadmin
- Admin dashboard with analytics/admin-assethome
- Asset categories overview/admin-assetmonitoring
- Asset monitoring and tracking/admin-dueassets
- Assets due for return/admin-asset
- Organization asset management/admin-maintenance
- Maintenance request management/admin-maintenancehome
- Maintenance categories/admin-reporthome
- Reports dashboard/admin-assetreport
- Asset reports/admin-mealreport
- Meal reports/admin-maintenancereport
- Maintenance reports/admin-mealTimes
- Meal time configuration/admin-mealTypes
- Meal type management/admin-requestedMeals
- Meal request management/admin-users
- User management
/user-dashboarduser
- User dashboard/user-users
- User directory/user-assetrequest
- Asset request submission/user-dueassets
- User's due assets/user-mealcalendar
- Meal booking calendar/user-maintenance
- Maintenance request submission
/notifications
- Notification center/settings
- Application settings/organization
- Organization details
Before you begin, ensure you have the following installed on your system:
- Node.js (version 16.0 or higher)
- npm (version 7.0 or higher) or yarn (version 1.22 or higher)
- Git (for cloning the repository)
git clone https://github.com/FiveStackDev/Resource_Hub-Frontend.git
cd Resource_Hub-Frontend
Using npm:
npm install
Or using yarn:
yarn install
Create a .env
file in the root directory and configure your environment variables:
# Cloudinary Configuration (for file uploads)
VITE_CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
VITE_CLOUDINARY_UPLOAD_PRESET=your_upload_preset
VITE_CLOUDINARY_API_URL=https://api.cloudinary.com/v1_1/your_cloud_name/image/upload
# Optional: Additional configuration variables
VITE_APP_NAME=Resource Hub
Note: The application uses Cloudinary for file uploads (profile pictures, asset images, etc.). Get your Cloudinary credentials from your Cloudinary Dashboard. The API endpoints are configured directly in
src/services/api/config.js
and don't require environment variables for local development.
Start the development server:
npm run dev
Or with yarn:
yarn dev
The application will open in your browser at http://localhost:5173
(or the port specified by Vite).
Build the application for production:
npm run build
This creates an optimized production build in the dist
folder.
Preview the production build locally:
npm run preview
Script | Description |
---|---|
npm run dev |
Start development server with hot reload |
npm run build |
Build the application for production |
npm run preview |
Preview the production build locally |
npm run lint |
Run ESLint to check code quality |
npm run format |
Format code using Prettier |
This frontend application is designed to work with a microservices architecture and requires multiple backend services to function properly. The application communicates with various backend services through RESTful APIs:
- Authentication Service (Port 9094): User login, registration, and JWT token management
- Asset Management Service (Port 9090): Asset CRUD operations, asset requests, and monitoring
- Maintenance Service (Port 9090): Maintenance request handling and task management
- User Management Service (Port 9090): User profile management and organization settings
- Calendar Service (Port 9090): Meal scheduling and calendar operations
- Notification Service (Port 9093): Real-time notifications and alerts
- Dashboard Services (Port 9092): Analytics data for admin and user dashboards
The API endpoints are configured in src/services/api/config.js
. The application supports both local development and production deployment configurations:
- Local Development: Individual microservice URLs on different ports
- Production: Unified backend URL with service-specific endpoints
Ensure all required backend services are running and properly configured before starting the frontend application.
The application follows a modern, scalable architecture with clear separation of concerns:
- Modular Component Structure: Reusable UI components organized by feature and domain
- Role-Based Layouts: Separate layout systems for Admin and User interfaces
- Protected Routing: Comprehensive route protection with multi-level role authorization
- Shared Components: Common UI elements and utilities across different user roles
- Context-Based Global State: React Context for user authentication, sidebar state, and theme management
- Query-Based Data Fetching: TanStack React Query for efficient server state management
- Local Component State: React hooks for component-specific state management
- Higher-Order Components: Protected routes and layout wrappers
- Custom Hooks: Reusable logic for notifications, themes, and data fetching
- Provider Pattern: Context providers for global state management
- Compound Components: Complex UI components with multiple sub-components
- Service-Oriented Architecture: Integration with multiple backend microservices
- API Abstraction: Centralized API configuration and service management
- Error Handling: Comprehensive error handling and user feedback systems
We welcome contributions to the Resource Hub project! Please follow these guidelines:
- Fork the repository
- Create a new branch for your feature (
git checkout -b feature/amazing-feature
) - Commit your changes with conventional commit messages (
git commit -m 'feat: add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request with detailed description
- TypeScript: Use TypeScript for type safety where applicable
- ESLint & Prettier: Follow the existing code style and formatting rules
- Component Structure: Organize components by feature and maintain consistent file structure
- Naming Conventions: Use descriptive names for components, hooks, and utilities
- Comments: Add JSDoc comments for complex logic and component props
- Testing: Ensure all functionality works before submitting (testing framework to be implemented)
Follow conventional commit format:
feat:
New featuresfix:
Bug fixesdocs:
Documentation updatesstyle:
Code style changesrefactor:
Code refactoringtest:
Test additions or updates
When reporting issues, please include:
- Clear Description: Detailed explanation of the problem
- Reproduction Steps: Step-by-step instructions to reproduce the issue
- Expected vs Actual Behavior: What should happen vs what actually happens
- Environment Information: Browser, version, operating system
- Screenshots/Logs: Visual evidence or console logs if applicable
- User Role: Specify if the issue occurs for Admin, User, or SuperAdmin roles
This project is licensed under the MIT License - see the LICENSE file for details.
FiveStackDev - Development Team
- GitHub: @FiveStackDev
- Minul Chathumal - @Minulck
- Theekshana Udara - @th33k
- Piumini Tishani - @PiuminiTishani
- Nethminiwelgama - @nethminiwelgama
- Sineth Nimhan - @SinethNimhan
For support and questions:
- π§ Email: [email protected]
- π Documentation: Project Wiki
- π Issues: GitHub Issues
The application is configured for Vercel deployment with vercel.json
. To deploy:
- Connect your repository to Vercel
- Configure environment variables in Vercel dashboard
- Deploy automatically on push to main branch
- Build the application:
npm run build
- Deploy the
dist
folder to your hosting service - Configure environment variables for production API URLs
- Modern Browsers: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
- Mobile Support: iOS Safari 14+, Chrome Mobile 90+
- Progressive Enhancement: Graceful degradation for older browsers
- Code Splitting: Route-based code splitting with React.lazy
- Bundle Optimization: Vite optimization for production builds
- Asset Optimization: Image optimization and lazy loading
- Caching Strategy: Browser caching for static assets
β Star this repo if you find it helpful! β