{"id":50594694,"url":"https://github.com/wardvisual/wardsuite.hcm","last_synced_at":"2026-06-05T13:01:27.802Z","repository":{"id":357749478,"uuid":"1236482498","full_name":"wardvisual/wardsuite.hcm","owner":"wardvisual","description":"A mini Human Capital Management time tracking system for attendance operations.","archived":false,"fork":false,"pushed_at":"2026-05-14T04:28:42.000Z","size":1483,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-14T06:36:44.436Z","etag":null,"topics":["attendance-tracker","firebase","firestore","hcm","monorepo","nodejs","react"],"latest_commit_sha":null,"homepage":"https://hcm.wardvisual.com","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/wardvisual.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-12T09:35:56.000Z","updated_at":"2026-05-14T05:02:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wardvisual/wardsuite.hcm","commit_stats":null,"previous_names":["wardvisual/wardsuite.hcm"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/wardvisual/wardsuite.hcm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wardvisual%2Fwardsuite.hcm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wardvisual%2Fwardsuite.hcm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wardvisual%2Fwardsuite.hcm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wardvisual%2Fwardsuite.hcm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wardvisual","download_url":"https://codeload.github.com/wardvisual/wardsuite.hcm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wardvisual%2Fwardsuite.hcm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33942436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"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":["attendance-tracker","firebase","firestore","hcm","monorepo","nodejs","react"],"created_at":"2026-06-05T13:01:25.823Z","updated_at":"2026-06-05T13:01:27.773Z","avatar_url":"https://github.com/wardvisual.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WardSuite HCM\r\n\r\n\u003e A mini Human Capital Management time tracking system for attendance operations.\r\n\r\nWardSuite HCM helps teams track time-ins/time-outs with a clean punch flow, while automatically computing regular hours, overtime, night differential, lateness, and undertime.\r\n\r\n[![Live Demo](https://img.shields.io/badge/Live%20Demo-hcm.wardvisual.com-white?style=for-the-badge)](https://hcm.wardvisual.com)\r\n\r\n![WardSuite HCM](./apps/web/src/assets/banner.jpg)\r\n\r\n---\r\n\r\n## Tech Stack\r\n\r\n| Layer | Technology |\r\n|---|---|\r\n| Frontend | React 19, Vite, Tailwind CSS 4, React Router 7 |\r\n| Animations | Motion |\r\n| State | Zustand (with persist) |\r\n| Backend | Node.js, Express 5, TypeScript (class-based/OOP) |\r\n| Database | Firebase Firestore |\r\n| Authentication | Firebase Auth + Firebase Admin token verification |\r\n| Monorepo | npm workspaces (`apps/*`) |\r\n\r\n---\r\n\r\n## Repository Structure\r\n\r\n```text\r\nwardsuite.hcm/\r\n├── apps/\r\n│   ├── api/                # Express 5 API (TypeScript)\r\n│   │   ├── main.ts\r\n│   │   ├── scripts/\r\n│   │   │   └── migrate.ts\r\n│   │   └── src/\r\n│   │       ├── app.ts\r\n│   │       ├── core/\r\n│   │       ├── modules/\r\n│   │       │   ├── auth/\r\n│   │       │   └── users/\r\n│   │       └── types/\r\n│   └── web/                # React SPA (Vite + Tailwind)\r\n│       └── src/\r\n│           ├── components/\r\n│           ├── modules/\r\n│           │   ├── auth/\r\n│           │   ├── attendance/\r\n│           │   ├── dashboard/\r\n│           │   └── Landing/\r\n│           └── services/\r\n├── libs/\r\n├── .env.example\r\n├── package.json\r\n└── tsconfig.base.json\r\n```\r\n\r\n---\r\n\r\n## Core Features\r\n\r\n| Area | Included |\r\n|---|---|\r\n| Punch Tracking | Punch in/out flow with real-time attendance updates |\r\n| Time Computation | Regular hours, OT, ND (22:00–06:00), late/undertime summaries |\r\n| Daily Summary | Pre-computed day-level metrics |\r\n| Role Access | RBAC support for ADMIN and MANAGER surfaces |\r\n| Admin Visibility | Attendance reporting and punch management panels |\r\n\r\n---\r\n\r\n## Getting Started\r\n\r\n### Prerequisites\r\n\r\n- Node.js 22+\r\n- npm\r\n- Firebase project with Firestore + Auth enabled\r\n- Firebase service account credentials\r\n\r\n### 1. Install dependencies\r\n\r\n```bash\r\nnpm install\r\n```\r\n\r\n### 2. Configure environment\r\n\r\nCopy values from `.env.example` into your local `.env`:\r\n\r\n```env\r\nAPI_PORT=3000\r\nNODE_ENV=development\r\n\r\nFIREBASE_PROJECT_ID=\r\nFIREBASE_CLIENT_EMAIL=\r\nFIREBASE_PRIVATE_KEY=\"-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n\"\r\nFIREBASE_DATABASE_ID=\r\n\r\nVITE_FIREBASE_API_KEY=\r\nVITE_FIREBASE_AUTH_DOMAIN=\r\nVITE_FIREBASE_PROJECT_ID=\r\nVITE_FIREBASE_STORAGE_BUCKET=\r\nVITE_FIREBASE_MESSAGING_SENDER_ID=\r\nVITE_FIREBASE_APP_ID=\r\nVITE_FIREBASE_DATABASE_ID=\r\nJWT_SECRET=\r\n```\r\n\r\n### 3. Run in development\r\n\r\n```bash\r\nnpm run dev\r\n```\r\n\r\n- API: `http://localhost:3000`\r\n- Web: `http://localhost:5173`\r\n\r\n---\r\n\r\n## Scripts\r\n\r\n| Script | Description |\r\n|---|---|\r\n| `npm run dev` | Run API + Web concurrently |\r\n| `npm run dev:api` | Run API only |\r\n| `npm run dev:web` | Run Web only |\r\n| `npm run build` | Build API + Web |\r\n| `npm run build:api` | Build API only |\r\n| `npm run build:web` | Build Web only |\r\n| `npm run check` | Typecheck + lint + format check (full CI gate) |\r\n| `npm run typecheck` | Typecheck API + Web |\r\n| `npm run typecheck:api` | Typecheck API only |\r\n| `npm run typecheck:web` | Typecheck Web only |\r\n| `npm run lint` | Lint TypeScript/TSX source files |\r\n| `npm run lint:fix` | Auto-fix lint issues where possible |\r\n| `npm run format` | Format app files with Prettier |\r\n| `npm run format:check` | Check formatting with Prettier |\r\n| `npm run migrate` | Apply Firestore migrations |\r\n| `npm run migrate:status` | Show migration status |\r\n| `npm run seed` | Seed API demo data |\r\n| `npm run emulate` | Run Firebase emulators |\r\n| `npm run firebase:deploy:rules` | Deploy Firestore security rules |\r\n| `npm run firebase:deploy:indexes` | Deploy Firestore indexes |\r\n| `npm run firebase:deploy:hosting` | Deploy Firebase hosting |\r\n| `npm run clean` | Remove build output directories |\r\n\r\n---\r\n\r\n## Deployment\r\n\r\nThe system runs as two independently deployed units:\r\n\r\n| Service | Host | URL |\r\n|---|---|---|\r\n| Frontend (SPA) | Firebase Hosting | `https://hcm.wardvisual.com` |\r\n| API | Docker · DigitalOcean VPS | `https://hcmapi.wardvisual.com` |\r\n\r\n---\r\n\r\n### Frontend — Firebase Hosting\r\n\r\nThe React SPA is built with the production API base URL injected at build time, then deployed to Firebase Hosting.\r\n\r\n**1. Set production env vars**\r\n\r\nCreate `.env.production` (or export inline):\r\n\r\n```env\r\nVITE_API_BASE_URL=https://hcmapi.wardvisual.com/api\r\nVITE_FIREBASE_API_KEY=...\r\nVITE_FIREBASE_AUTH_DOMAIN=...\r\nVITE_FIREBASE_PROJECT_ID=...\r\nVITE_FIREBASE_STORAGE_BUCKET=...\r\nVITE_FIREBASE_MESSAGING_SENDER_ID=...\r\nVITE_FIREBASE_APP_ID=...\r\nVITE_FIREBASE_DATABASE_ID=...\r\n```\r\n\r\n**2. Build and deploy**\r\n\r\n```bash\r\n# Build + deploy to Firebase Hosting in one step\r\nnpm run deploy:web\r\n```\r\n\r\nThis runs `cross-env VITE_API_BASE_URL=https://hcmapi.wardvisual.com/api npm run build:web`, outputs to `dist/web/`, then runs `firebase deploy --only hosting`.\r\n\r\n**3. Deploy Firestore rules and indexes (when changed)**\r\n\r\n```bash\r\nnpm run firebase:deploy:rules\r\nnpm run firebase:deploy:indexes\r\n```\r\n\r\n**Hosting config** (`firebase.json`):\r\n- Public folder: `dist/web`\r\n- SPA fallback: all routes → `/index.html`\r\n\r\n---\r\n\r\n### API — Docker on DigitalOcean VPS\r\n\r\nThe Express API runs inside a Docker container, fronted by a **Caddy** reverse proxy that handles TLS automatically via Let's Encrypt.\r\n\r\n#### Infrastructure\r\n\r\n```\r\nInternet\r\n  │\r\n  ▼\r\nCaddy (hcmapi.wardvisual.com)   ← TLS termination, gzip, security headers\r\n  │\r\n  ▼\r\nwardsuite-hcm-api:3000           ← Docker container (internal)\r\n  │\r\n  ▼\r\nFirebase Admin SDK → Firestore\r\n```\r\n\r\n## API Response Contract\r\n\r\n```json\r\n// success\r\n{ \"success\": true, \"message\": \"...\", \"data\": {}, \"meta\": {} }\r\n\r\n// error\r\n{ \"success\": false, \"message\": \"...\", \"error\": \"...\", \"statusCode\": 400 }\r\n```\r\n\r\n---\r\n\r\n## Firestore Collections\r\n\r\n| Collection | Doc ID format | Purpose |\r\n|---|---|---|\r\n| `users` | Firebase UID (`_schema` sentinel also exists) | User profiles and schedule metadata |\r\n| `attendance` | auto-id (`_schema` sentinel also exists) | Punch in/out records (one doc per IN/OUT event) |\r\n| `dailySummary` | `{userId}_{YYYY-MM-DD}` (`_schema` sentinel also exists) | Computed daily totals |\r\n| `attendanceHistory` | auto-id (`_schema` sentinel also exists) | Immutable audit log for punch edits/adjustments |\r\n| `weeklySummary` | `{userId}_{YYYY-WNN}` (`_schema` sentinel also exists) | Aggregated weekly totals for reporting |\r\n| `_migrations` | migration version | Migration tracking |\r\n\r\n---\r\n\r\n## Author\r\n\r\n**Eduardo** — [@wardvisual](https://github.com/wardvisual)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwardvisual%2Fwardsuite.hcm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwardvisual%2Fwardsuite.hcm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwardvisual%2Fwardsuite.hcm/lists"}