Back to projects

Mobile app ยท Attendance

xHR Mobile

Client: xHR by Rexolusi

Overview

Android and iOS app for employees of the xHR system: geolocation check-in against registered office areas, leave requests, payslips and push notifications. Built so the web modules can be reused as they are.

The problem

xHR Mobile is the Android and iOS app for employees of the xHR HR and attendance product. Employees clock in and out with it, and the same Laravel API and token login as the web app serve it.

Attendance by location is easy to fake with a mock-GPS app, and an app that wrongly blocks honest employees is worse than one that lets a few entries through. A web app on a phone also cannot reliably do background location, iOS push notifications or offline queues, so the mobile app needed device-level checks and a way to reuse the existing HR web code.

My part

I worked on xHR Mobile as a Senior Software Engineer at Rexolusi, and the server-side attendance rules sit within the backend architecture I lead.

What I built

Geolocation clock-in
The app reads the device location and sends raw coordinates, accuracy and device signals to the API. The server computes the distance to the employee's assigned work locations and flags entries outside the radius.
Device integrity signals
The app collects mock-location, root and developer-mode results and sends them with each clock event. A security page shows the employee these checks and labels the ones it cannot make as pending rather than passing them.
Server-side attendance rules
A mobile clock service in the Laravel backend takes the employee from the token, scores the integrity signals, checks accuracy against the geofence and reuses the web app's daily attendance calculation, with its own feature tests.
Native shell and session
Capacitor 8 packages the Vue app for both platforms, with a bearer token kept in native storage, committed Android and iOS projects, and the Firebase App Check plugin installed.
Demo build
A demo mode, enabled only by a build flag, answers clock events locally so the app can be installed on a phone without a backend.

Decisions that shaped it

Capacitor instead of a PWA, React Native or Flutter
A written stack study found three requirements a PWA cannot meet on iOS: installability, push notifications and background offline clock-in. It chose Capacitor with Vue because the existing HR types, services and queries could be reused as they are.
The client collects signals, the server decides
The app only gathers integrity signals, and the decision to block or accept lives in Laravel, because anything decided in the client can be patched out by someone willing to try.
Reject only on the system mock flag
Testing on a real phone with genuine GPS and developer options on returned a high risk score, so the score alone is ignored. Only the system provider's own mock flag blocks a clock-in, and other signals flag the entry for review.
Identity comes from the token
The mobile clock endpoint never accepts an employee ID from the request, so a valid token cannot be used to clock in a colleague.
Honest status reporting
A status document compares the written plan with the code, and placeholder screens carry a visible example label, so nobody mistakes a mock-up for finished work.

Where it stands

  • Built with Capacitor 8, Vue 3, Vite, Tailwind CSS 4 and Bun, with the Android and iOS projects in the repository.
  • Login, today's clock status, server-side geofence validation and rejection of devices that report a mock location are connected to the backend.
  • Backend tests cover the mobile clock endpoint, including that an honest employee with developer options on is not blocked.
  • The other employee screens are still in progress.

Core features

  • Geolocation check-in
  • Leave requests
  • Payslips
  • Push notifications
  • Biometrics

Tech stack

  • Capacitor 8
  • Vue 3
  • TypeScript
  • Vite
  • Tailwind CSS 4
  • Bun
  • Biometrics
  • Firebase App Check

Related clients