CB Employee Hub is the native iOS employee operations app for Chicky Bites. Its production system of record is the linked InsForge PostgreSQL project. The older Express/SQLite application remains in this repository only as the migration source and historical reference; it is not the production client.
- Multi-branch employee and role management.
- InsForge Auth registration, email verification, sign-in, and employee invite linking.
- Dynamic branch coordinates, 50-metre geofence, approved public IP ranges, and
IP_OR_GPSattendance rules. - Employee-specific live face enrollment and matching, server-authoritative IP/GPS attendance validation, and audited manager overrides.
- Sick, urgent, and normal leave requests, approvals, and editable paid/entitlement policies.
- PKR compensation history, employee-specific joining dates, pay/cutoff dates, working-week schedules, scheduled-day proration, maker-checker payroll approval, payslip records, and payment tracking.
- Private leave-document and payslip storage with organization/employee RLS.
- Native Liquid Glass on iOS 26 with an iOS 17–25 material fallback.
- Open
ios/ChickyBitesAttendance.xcodeprojin Xcode. - Select the
ChickyBitesAttendancescheme and an iOS 17+ simulator or device. - Build and run. The public InsForge URL and anonymous client key are already configured; the administrative key is server-only.
- The designated owner email is the only account permitted to claim the initial owner membership. Employees register with their assigned email and claim the one-time code generated by an administrator.
Before real attendance, the owner must configure the Main Branch coordinates and at least one approved public IP in Branch Settings. Leave paid status/entitlements and every employee's salary, pay day, cutoff day, and working week should also be confirmed before the first payroll run.
The repository is linked to InsForge project 929bfc90-513b-4c13-84e5-71b8fc8c40d1. Versioned SQL is under migrations/, and the trusted attendance endpoint is functions/attendance-action.ts.
npx @insforge/cli db migrations list
npx @insforge/cli functions listDo not embed an InsForge administrative key in iOS. Database changes must be made as migrations and checked into the repository.
A modern web-based attendance platform for Chicky Bites with:
- Secure admin authentication (session-based)
- Admin-only control panel
- Employee lifecycle management (add/update/delete)
- Attendance tracking (
present,absent,leave) - Leave request and approval workflow (admin-managed)
- Biometric attendance
- Face recognition (enroll/verify/remove profile)
- Separate operational modes
Attendance Mode(kiosk-style daily operations)Biometric Management(admin-only)
- Node.js + Express + EJS
- SQLite (
better-sqlite3) - Session auth (
express-session) - Client-side face detection (
face-api.js)
- Install dependencies:
npm install- Configure environment:
cp .env.example .env- Start the app:
npm start- Open:
http://localhost:3000
This project includes /render.yaml for one-click Blueprint deployment.
Render deploys from a Git repository.
git add .
git commit -m "Prepare Render deployment"
git branch -M main
git remote add origin <your-github-repo-url>
git push -u origin main- In Render Dashboard, click
New->Blueprint. - Connect your GitHub repo.
- Render reads
render.yamland creates the web service with a persistent disk.
In Render service settings, define:
ADMIN_EMAIL(your admin login email)ADMIN_PASSWORD(strong password)KIOSK_PIN(optional, for kiosk access)
Already configured by render.yaml:
NODE_ENV=productionDB_PATH=/var/data/chickybites.db(persistent SQLite path)SESSION_SECRET(auto-generated)
Session storage in production uses SQLite-backed sessions (not MemoryStore), so login sessions survive restarts on the persistent disk.
At startup, the app now logs the active DB path and warns if production DB_PATH is not under /var/data. It also performs a one-time safe migration from legacy ./chickybites.db to the configured DB_PATH when the target file is missing.
After the first deploy completes, open your Render URL and sign in with the admin credentials set above.
Note: If you change ADMIN_PASSWORD later in Render, restart/redeploy the service to sync the existing admin login hash.
- Email:
admin@chickybites.com - Password:
ChangeMe@123
Change this immediately in production.
- Face recognition:
- Uses browser camera +
face-api.jsdescriptor extraction. - Requires decent lighting and front-facing image capture.
- Uses browser camera +
- Only
admincan sign in. - Optional
kioskattendance access viaKIOSK_PIN. - Employee records do not have web login accounts.
- Admin manages all employee data, including biometric and facial data.
- Use HTTPS and secure cookies (
secure: true) - Rotate
SESSION_SECRET - Add CSRF protection
- Add login rate limiting and account lockouts
- Add audit dashboard and immutable attendance logs
- Add encrypted biometric template storage and retention policy
- Replace local SQLite with managed DB for scale
/server.js- Routes, auth flow, and biometric API endpoints/db.js- SQLite schema and data access functions/middleware/auth.js- Auth + role middleware/services/biometric.js- Face descriptor normalization + matching helpers/views- EJS pages/public- CSS and browser-side biometric JS/assets/logo.png- Chicky Bites logo/ios/ChickyBitesAttendance.xcodeproj- Native SwiftUI iPhone/iPad app
The first scaffold used the web server. It has now been replaced by the native InsForge integration described above. Legacy browser face descriptors are intentionally not reused. An authorized manager enrolls each employee from the iOS Team screen using three live samples. Attendance requires a blink-and-turn liveness check, an on-device AdaFace IR-18 embedding, server-side matching against that employee's private template, and a short-lived one-use proof bound to the employee, branch, account, and device. Raw photos and video are not stored.