Back to portfolio
MobileClient work

Program Lucru (Work Schedule)

A platform for organizing work schedules, time tracking, time-off-in-lieu, and statistics, complemented by an offline PWA, synchronized mobile alarms, Web Push notifications, role-based administration, and a BBD module for tracking products and batches.

Program Lucru (Work Schedule)

Core stack

Node.js
TypeScript
Express
sql.js
SQLitebcryptexpress-rate-limitWeb PushVAPIDExcelJSReact 19ViteTailwind CSS 4PWAService WorkerZXingReact NativeExpoExpo RouterTanStack QueryZustandNativeWindExpo SecureStoreNotifeeExpo CameraVitestPM2NginxGitHub ActionsEAS Build

The challenge

The challenge was turning a personal shift calendar into a source of truth used simultaneously by scheduling, time tracking, time-off-in-lieu, statistics, notifications, and alarms, then extending the same product with administrative roles and a batch-based BBD flow. Changes had to remain consistent between web and mobile, and access to each user's data had to be separated without losing the administrator's ability to operate across accounts.

The solution

The solution centralizes rules and data into an Express/TypeScript API, with separate tables for users, sessions, shifts, time tracking, time-off-in-lieu, alarm rules, push subscriptions, and BBD entities. React consumes the API through specialized hooks and provides a PWA with offline fallback, while Expo/React Native uses TanStack Query, SecureStore, and Notifee for mobile access and synchronized local alarms. Roles and ownership are checked server-side, statistics are calculated from schedule and time-tracking data, and BBD uses batches, filtering/pagination, and Excel export. GitHub Actions, Nginx, and PM2 automate delivery of the web app and the backend on the VPS.

Notable complexity

Program Lucru evolved from a shift viewer into a multi-user operational product. Each employee has their own calendar with work, off, or vacation days, start and end times, and notes. The schedule can be edited on a single day or in bulk for a month, is available in day, week, and month views, and feeds the monthly statistics, time tracking, and ICS calendar export. The current implementation persists shifts explicitly per day; the repository does not implement a formal recurrence rule that automatically generates the schedule.

Time tracking links actual time to the planned schedule. The user can clock in and out, view monthly history, and the system calculates the estimated clock-out time and statistics such as lateness relative to the scheduled time. Manual entries are supported for corrections, with ownership control for the user and administrative access to view or operate other accounts' data. Separately, time-off-in-lieu has its own CRUD flow, with reason, number of hours, pending/resolved status, and resolution date, and the totals are included in the monthly statistics.

The product has three surfaces connected to the same API. The React PWA provides the main responsive, installable interface, with a Service Worker, offline caching, and Web Push. The React Native/Expo app reproduces the essential flows on mobile and adds precise local alarms: alarm rules are kept server-side per user, and the client synchronizes the schedule for the next 14 days and schedules the alarms locally via Notifee. The backend also includes a Web Push message scheduler adapted to the shift phase or day type, plus management of messages and the target user.

The confirmed roles are consultant, merch, and admin. The administrator can manage users and roles, inspect time tracking, view aggregated statistics, and temporarily enter an employee's interface through server-side controlled impersonation. Access to the BBD module is restricted to consultant and admin. BBD tracks products by brand and batches with an expiration month/year, quantity, and resolved status, offers server-side search and filtering, barcode scanning, brand-level notes, buyer history, and a grouped Excel export.

The backend is an Express/TypeScript application with a SQLite database loaded via sql.js and persisted to disk. The schema went through incremental migrations for multi-user support, expiring sessions, BBD batches, and moving the resolved status to the batch level. Authentication uses cryptographically generated session tokens, bcrypt passwords, and transparent migration from old SHA-256 hashes, and login is protected with rate limiting. Web and backend deployment runs automatically on push to main via GitHub Actions and SSH to a VPS, with a Node.js build, Nginx, and PM2; the database has a separate daily backup script with a seven-day retention.

The architecture is suited for an internal product with moderate volume and single-instance deployment, but the code is not presented as a horizontally scalable solution. sql.js persistence exports the database to a file after mutations, the push scheduler lives inside the API process, and some older scripts — notably the JSON importer for the single-user schema — have fallen behind the current model. These limits matter for technical evaluation and define the natural directions for evolution: transactions and stricter validation for bulk writes, conventional server-side persistence for higher concurrency, and isolating offline caches by user identity.

Key results

  • React PWA for daily, weekly, and monthly scheduling, with per-day editing and bulk month saving
  • React Native/Expo app connected to the same API, configured for internal distribution via EAS
  • Time tracking with clock-in/clock-out, monthly history, manual corrections, and correlation with the planned schedule
  • Monthly statistics for shifts, hours, off and vacation days, time-off-in-lieu, and tracking lateness
  • Separate flow for time-off-in-lieu, with pending/resolved status and inclusion in monthly statistics
  • ICS schedule export for integration with calendar apps
  • Server-side persisted alarm rules and mobile synchronization for scheduling local alarms over the next 14 days
  • Web Push with VAPID subscriptions and messages chosen based on shift phase, day off, or vacation
  • Management of users and the consultant, merch, and admin roles, plus impersonation for operational support
  • BBD module with products, brands, and batches, server-side search and filtering, barcode scanning, and per-batch status
  • Buyer history and brand-level notes in the BBD module
  • BBD Excel export grouped by brand and batches
  • Service Worker with a version automatically bumped at build time and offline fallback for the app shell and schedule data
  • Daily SQLite database backup with seven-day retention
  • Automatic deployment of the backend and PWA on push to main via GitHub Actions, SSH, and PM2/Nginx
  • Vitest tests for authentication and BBD flows, plus smoke and component tests in the frontend

Related projects

Want something similar?

Start with the estimate wizard — answer a few questions and get a realistic price range and timeline.