{"id":29883897,"url":"https://github.com/qms85/workforcetracker","last_synced_at":"2025-09-13T01:13:12.843Z","repository":{"id":303276477,"uuid":"1014940778","full_name":"QMS85/WorkforceTracker","owner":"QMS85","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-18T15:37:02.000Z","size":476,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-31T16:23:58.942Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://qms85.github.io/WorkforceTracker/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QMS85.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-06T17:51:39.000Z","updated_at":"2025-07-08T09:26:27.000Z","dependencies_parsed_at":"2025-07-06T19:20:55.306Z","dependency_job_id":"79f6adc5-1067-4372-b101-a88418896f47","html_url":"https://github.com/QMS85/WorkforceTracker","commit_stats":null,"previous_names":["qms85/workforcetracker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/QMS85/WorkforceTracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QMS85%2FWorkforceTracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QMS85%2FWorkforceTracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QMS85%2FWorkforceTracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QMS85%2FWorkforceTracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QMS85","download_url":"https://codeload.github.com/QMS85/WorkforceTracker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QMS85%2FWorkforceTracker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274903982,"owners_count":25371239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-31T14:19:46.026Z","updated_at":"2025-09-13T01:13:12.834Z","avatar_url":"https://github.com/QMS85.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Workforce Tracker HR Dashboard - Employee Time Tracking \u0026 Scheduling System\n\n## 📋 Overview\n\nA modern, full-stack HR dashboard application designed for comprehensive employee time tracking and scheduling management. Built with React and TypeScript on the frontend, Express.js backend, and PostgreSQL database integration via Drizzle ORM.\n\n## ✨ Features\n\n### Core Functionality\n- **Employee Management**: Complete CRUD operations for employee data\n- **Time Tracking**: Clock in/out functionality with break duration tracking\n- **Schedule Management**: Visual schedule creation with recurring pattern support\n- **Attendance Tracking**: Daily attendance monitoring with status management\n- **Analytics Dashboard**: Real-time productivity charts and attendance metrics\n- **Google Sheets Integration**: Export schedules and employee data to Google Sheets\n- **Responsive Design**: Mobile-friendly interface with adaptive layouts\n\n### Technical Features\n- **Type Safety**: Full TypeScript implementation with Zod validation\n- **Real-time Updates**: Live data synchronization via TanStack Query\n- **Error Handling**: Comprehensive error boundaries and validation\n- **Modern UI**: Radix UI components with Tailwind CSS styling\n- **Database ORM**: Drizzle ORM for type-safe database operations\n\n## 🛠️ Technology Stack\n\n### Frontend\n- **React 18** with TypeScript\n- **Wouter** for client-side routing\n- **TanStack Query** for server state management\n- **Tailwind CSS** with custom HR-themed styling\n- **Radix UI** components with shadcn/ui library\n- **Chart.js** for data visualization\n- **Vite** for development and build tooling\n\n### Backend\n- **Node.js** with Express.js framework\n- **TypeScript** with ES modules\n- **PostgreSQL** with Drizzle ORM\n- **Neon Database** (serverless PostgreSQL)\n- **Zod** for schema validation\n- **Google Sheets API** integration\n\n## 🚀 Quick Start\n\n### Prerequisites\n- Node.js (v18 or higher)\n- PostgreSQL database (or Neon Database account)\n- Google Cloud Console account (for Sheets integration)\n\n### Installation\n\n1. **Clone the repository**\n```bash\ngit clone \u003crepository-url\u003e\ncd hr-dashboard\n```\n\n2. **Install dependencies**\n```bash\nnpm install\n```\n\n3. **Set up environment variables**\nCreate a `.env` file in the root directory:\n```env\nDATABASE_URL=your_postgresql_connection_string\nGOOGLE_SHEETS_CREDENTIALS=your_google_service_account_json\n```\n\n4. **Initialize the database**\n```bash\nnpm run db:push\n```\n\n5. **Start the development server**\n```bash\nnpm run dev\n```\n\nThe application will be available at `http://localhost:5000`\n\n## 📊 Google Sheets Integration Setup\n\n### Step 1: Create Google Cloud Project\n\n1. Go to [Google Cloud Console](https://console.cloud.google.com/)\n2. Create a new project or select an existing one\n3. Enable the Google Sheets API:\n   - Navigate to \"APIs \u0026 Services\" → \"Library\"\n   - Search for \"Google Sheets API\"\n   - Click \"Enable\"\n\n### Step 2: Create Service Account\n\n1. Go to \"APIs \u0026 Services\" → \"Credentials\"\n2. Click \"Create Credentials\" → \"Service Account\"\n3. Enter a name for your service account\n4. Click \"Create and Continue\"\n5. Skip optional steps and click \"Done\"\n\n### Step 3: Generate Service Account Key\n\n1. Click on your newly created service account\n2. Go to the \"Keys\" tab\n3. Click \"Add Key\" → \"Create New Key\"\n4. Select \"JSON\" format\n5. Download the key file\n\n### Step 4: Update Google Sheets Service\n\nReplace the mock implementation in `server/google-sheets.ts` with the real implementation:\n\n```typescript\nimport { google } from 'googleapis';\n\nexport async function createGoogleSheet(data: any[], startDate: Date | null, endDate: Date | null, customTitle?: string): Promise\u003cstring\u003e {\n  try {\n    const credentials = JSON.parse(process.env.GOOGLE_SHEETS_CREDENTIALS || '{}');\n    \n    const auth = new google.auth.GoogleAuth({\n      credentials,\n      scopes: ['https://www.googleapis.com/auth/spreadsheets'],\n    });\n    \n    const sheets = google.sheets({ version: 'v4', auth });\n    \n    const title = customTitle || \n      (startDate \u0026\u0026 endDate ? `Work Schedule - ${startDate.toLocaleDateString()} to ${endDate.toLocaleDateString()}` : \n      'HR Data Export');\n\n    const resource = {\n      properties: { title },\n    };\n\n    const spreadsheet = await sheets.spreadsheets.create({ resource });\n    const spreadsheetId = spreadsheet.data.spreadsheetId!;\n\n    // Prepare headers based on data type\n    const headers = data.length \u003e 0 ? Object.keys(data[0]) : [];\n    const values = [\n      headers,\n      ...data.map(row =\u003e headers.map(header =\u003e row[header] || ''))\n    ];\n\n    await sheets.spreadsheets.values.update({\n      spreadsheetId,\n      range: 'A1',\n      valueInputOption: 'RAW',\n      resource: { values },\n    });\n\n    // Format header row\n    await sheets.spreadsheets.batchUpdate({\n      spreadsheetId,\n      resource: {\n        requests: [{\n          repeatCell: {\n            range: {\n              sheetId: 0,\n              startRowIndex: 0,\n              endRowIndex: 1,\n            },\n            cell: {\n              userEnteredFormat: {\n                backgroundColor: { red: 0.9, green: 0.9, blue: 0.9 },\n                textFormat: { bold: true },\n              },\n            },\n            fields: 'userEnteredFormat(backgroundColor,textFormat)',\n          },\n        }],\n      },\n    });\n\n    return `https://docs.google.com/spreadsheets/d/${spreadsheetId}/edit`;\n  } catch (error) {\n    console.error('Error creating Google Sheet:', error);\n    throw new Error('Failed to create Google Sheet');\n  }\n}\n```\n\n### Step 6: Test Integration\n\n1. Create test schedules in your application\n2. Use the \"Export to Sheets\" button in Schedule Management\n3. Verify that a new Google Sheets document is created\n4. Test employee data export from Employee Management\n\n## 📈 Application Improvements\n\n### Critical Issues to Address\n\n#### 1. Navigation Structure Fix\n**Issue**: Console warning about nested anchor tags in sidebar navigation  \n**Priority**: High  \n**Solution**: Remove nested `\u003ca\u003e` tags and use proper Wouter Link components\n\n#### 2. Error Boundaries Enhancement\n**Issue**: Missing error boundaries for React component errors  \n**Priority**: High  \n**Solution**: Implement comprehensive error boundaries with fallback UI  \n\n#### 3. Form Validation Improvements\n**Issue**: Time entry form validation errors (400 responses)  \n**Priority**: Critical  \n**Solution**: Add client-side validation and improve error messaging  \n\n### Recommended Enhancements  \n\n#### Frontend Improvements\n- **Real-time Updates**: WebSocket integration for live time tracking\n- **Advanced Filtering**: Enhanced search and filter capabilities\n- **Data Visualization**: More interactive charts and analytics\n- **Mobile Optimization**: Improved responsive design for mobile devices\n- **Accessibility**: ARIA labels and keyboard navigation support\n\n#### Backend Improvements\n- **API Security**: Rate limiting and request sanitization\n- **Database Optimization**: Indexes for frequently queried fields\n- **Caching**: Redis integration for improved performance\n- **Input Validation**: Comprehensive middleware validation\n- **Logging**: Structured logging with different log levels\n\n#### Feature Additions\n- **User Authentication**: Role-based access control system\n- **Advanced Reporting**: PDF export and scheduled reports\n- **Notifications**: Email and in-app notification system\n- **Data Import**: CSV bulk import functionality\n- **Backup System**: Automated data backup and restore\n\n#### Code Quality Improvements\n- **Testing Suite**: Unit, integration, and E2E tests\n- **TypeScript Strict Mode**: Enhanced type safety\n- **Code Documentation**: JSDoc comments and API documentation\n- **Performance Monitoring**: Application performance tracking\n- **Security Audits**: Regular security vulnerability assessments\n\n### Implementation Priority\n\n#### Phase 1 (Immediate - Critical)\n1. Fix navigation nested link issue\n2. Resolve schedule creation form validation\n3. Add basic error boundaries\n4. Implement proper Google Sheets integration\n\n#### Phase 2 (High Priority - Next Sprint)\n1. Enhance form validation across all forms\n2. Add loading states and better UX feedback\n3. Implement security improvements\n4. Add comprehensive error handling\n\n#### Phase 3 (Medium Priority - Future)\n1. Real-time features with WebSocket\n2. Advanced reporting capabilities\n3. Performance optimizations\n4. Mobile app considerations\n\n#### Phase 4 (Nice to Have)\n1. Advanced user management system\n2. Comprehensive testing suite\n3. Advanced analytics and insights\n4. Third-party integrations (Slack, Teams, etc.)\n\n## 🔧 Development Commands\n\n```bash\n# Start development server\nnpm run dev\n\n# Build for production\nnpm run build\n\n# Start production server\nnpm start\n\n# Type checking\nnpm run check\n\n# Database schema push\nnpm run db:push\n```\n\n## 🌐 Deployment\n\n### Manual Deployment\n1. Build the application: `npm run build`\n2. Set environment variables on your hosting platform\n3. Deploy the `dist` folder and server files\n4. Ensure PostgreSQL database is accessible\n\n## 📄 API Documentation\n\n### Employee Endpoints\n- `GET /api/employees` - Get all employees\n- `GET /api/employees/:id` - Get employee by ID\n- `POST /api/employees` - Create new employee\n- `PUT /api/employees/:id` - Update employee\n- `DELETE /api/employees/:id` - Delete employee\n\n### Time Entry Endpoints\n- `GET /api/time-entries` - Get all time entries\n- `GET /api/time-entries/active/:employeeId` - Get active time entry\n- `POST /api/time-entries` - Create time entry (clock in)\n- `PUT /api/time-entries/:id/clock-out` - Clock out\n\n### Schedule Endpoints\n- `GET /api/schedules` - Get all schedules\n- `POST /api/schedules` - Create new schedule\n- `PUT /api/schedules/:id` - Update schedule\n- `DELETE /api/schedules/:id` - Delete schedule\n\n### Export Endpoints\n- `POST /api/schedules/export-google-sheets` - Export schedules to Google Sheets\n- `POST /api/employees/export-google-sheets` - Export employee data to Google Sheets\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## 📞 Support\n\nFor support and questions:\n- Create an issue in the repository\n- Review the improvement suggestions above\n\n---\n\n**Built with ❤️ using React, TypeScript, and modern web technologies**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqms85%2Fworkforcetracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqms85%2Fworkforcetracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqms85%2Fworkforcetracker/lists"}