Contents
Key takeaways
- Seven modules: employees, contracts, schedule, time tracking, cards, payroll and settings.
- Each PC works on its local database and syncs every 15 seconds, with conflict resolution.
- Ivorian payroll (CNPS, CMU, ITS) based on dated, editable legal parameters, never hard-coded.
- Signed contracts and validated payslips frozen with a SHA-256 hash.
- QR card time tracking on the register's Android phone, even without Internet.
AA Foods Staff Management is the HR software of a restaurant in Côte d'Ivoire: employee records, contracts compliant with Ivorian labor law, scheduling, QR card time tracking and monthly payroll with CNPS, CMU and ITS. It runs on the restaurant's Windows PCs, on an online server and on an Android phone at the register, and it keeps working when the Internet goes down.
HR software built for an Ivorian restaurant
In a restaurant, staff management often happens on paper or in a spreadsheet: contracts copied from a template, hours written by hand, payroll worked out mentally. Mistakes are costly, especially once social contributions and payroll tax come into play. AA Foods Staff Management replaces all of this with a single tool used by the owners and the managers.
The software covers seven modules: employees, contracts, schedule, time tracking, cards, payroll and settings. It handles several establishments: you pick the restaurant from a selector at the top left, and each time-clock phone is tied to one establishment. Permissions are split by role: management sees everything, managers work on the schedule, time tracking and employees.
The flow, from hiring to payslip
- Hiring: the employee record holds identity, photo, marital status and number of children (used for ITS), CNPS number and pay.
- Contract: the contract is generated from a template, then signed on screen, through a secure link or on paper.
- Card: a time card with photo and QR code is created automatically and prints on a sheet.
- Schedule: the week is built by day and by position (kitchen, floor, register, dishwashing).
- Time tracking: staff show their card to the register phone when they arrive and leave.
- Payroll: at month end, payroll is computed from validated hours and produces PDF payslips.

Main features
Employees and contracts
- Permanent, fixed-term, part-time, daily and internship contracts, with labor law checks (minimum wage, fixed-term duration, probation period, part time).
- Contract template editor: articles, conditional paragraphs and auto-filled data.
- Dated versions: any change to a signed contract creates an amendment or a renewal, and the previous version stays available.
- On-screen signature, signing link sent by WhatsApp or email, or paper signature with a scan that can be attached later.
- File documents, certificates and a dated history of every change.
Schedule and time tracking
- Weekly schedule by position, fixed hours, absences (leave, sickness, unjustified absence) and public holidays.
- Planned vs punched comparison: lateness, gaps, hours beyond the schedule, overtime.
- Automatic clock-out at the establishment's closing time, flagged as such.
- Corrections by the manager with a reason and an author, keeping the original punch.
- Overview: staff on site, punctuality, attendance, punches to fix and issues to resolve.
Payroll
- Monthly calculation from validated hours: base salary, overtime, bonuses, absences, benefits in kind.
- Employee deductions and employer contributions, amounts to declare for CNPS, CMU, ITS and the employer contribution.
- PDF payslips with Ivorian legal mentions, payroll ledger and year-to-date totals.
The technical challenges, and how they were solved
Working offline, on several computers
An Internet outage must not stop the restaurant. Each PC therefore keeps its own SQLite database and works on it: employees, contracts, schedule, payroll, documents. The online server, in PHP and MySQL, is the meeting point. Every 15 seconds, each computer sends its pending changes and fetches the others' from the change log.
The classic problem appears when two computers edit the same record offline. Each record has a unique ID, a version number and a modification date. The higher version wins; with equal versions, the most recent change wins and the server gives it the next version, so every machine converges to the same state. Business duplicates are handled separately: the same employee number assigned on two computers, or the same month's payroll computed twice, is resolved and reported on the Synchronization screen.
Each change leaves from a local queue with its SHA-256 hash. It only leaves the queue after an acknowledgment that quotes this hash, and a replayed send creates no duplicate.
One business logic, two environments
To avoid writing payroll or contract rules twice, the same PHP code runs in two places. On the PC, the Electron app starts an embedded PHP on SQLite, then shows the React interface. On the server, the same code runs on MySQL. PDFs are produced by Electron from HTML templates, with no heavy dependency.
Ivorian payroll, configurable and dated
Payroll in Côte d'Ivoire combines several mechanisms. CNPS pension applies to a capped base, family benefits, maternity and work accidents to another. CMU is counted per covered person: the employee, their spouse and their children up to a limit. ITS follows a progressive scale, with a number of shares based on family situation and a reduction per half share. Some lines, such as the meal allowance or part of the transport allowance, are not part of every base.
In the software, each earnings line states whether it belongs to the CNPS base, the ITS base and whether it is paid in cash. No rate is hard-coded: minimum wage, rates, caps, tax scale and overtime premiums are dated parameters, editable when the law changes, with their source and reliability level. They rely on a research file citing the Labor Code, decrees, the collective agreement and CNPS and DGI documents.

Signed documents that never change
A signed contract must stay exactly what was signed, even if the template changes later. Once both parties have signed, the version is frozen: the HTML document is kept as is and its SHA-256 hash is recorded. Any change goes through a new version with its effective date. The same principle applies to annexes and finalized documents. On the payroll side, a validated payroll can no longer be recomputed and a validated payslip can no longer be edited.
The signing link sent to an employee only stores the hash of its token on the server, not the token itself.

QR card time tracking, even offline
Instead of buying badge readers, time tracking uses the Android phone already at the register and printed cards. The AA Pointage app, built with Expo, reads cards continuously, with no button. It recognizes the card from its memory, works out whether it is an arrival or a departure from the history, then shows the photo, name and time. The photo lets the cashier see that nobody is punching with someone else's card.
- Without Internet, punches are kept on the phone with their real time, even after a restart.
- When the connection returns, they are sent in batches with no duplicates; the server remains the arbiter and the phone's history aligns with it.
- A disabled card is refused even offline, and so is a card from another establishment.
- The QR code only holds a random code, not the employee's name. The phone's key is encrypted on the device and the server only keeps its hash.
- Phone updates arrive remotely and are only accepted if signed with the publishing key.

Tech stack
- Desktop app: Electron, React, TypeScript and Tailwind CSS, with an embedded PHP and a local SQLite database.
- Server: PHP API and MySQL database, source of truth and sync point.
- Time-clock phone: Expo Android app with camera, SQLite and secure storage.
- Updates: Windows installer and automatic updates for the PCs, signed remote updates for the phone.
- Tests: business tests (contracts, schedule, overtime, hand-checked payroll), an end-to-end offline test and a sync integration test.
What this project shows
AA Foods Staff Management was designed and built end to end by Ahmed Sanoko: desktop app, PHP API, synchronization, Android time clock and deployment. The project combines three requirements that rarely meet: precise regulations to turn into calculations, legally binding documents that must never change, and reliable operation across several machines with an unstable connection. The online ordering side of AA Foods is covered in another article.
Do you have a business software project, a staff management tool or an app that must work offline? Get in touch. You can also see all the screenshots of the software.
Frequently asked questions
Does the software work without Internet?
Yes. Each PC works on its own local database and the time-clock phone keeps punches in memory. Everything is sent to the server when the connection returns, with no duplicates.
What happens when a contribution rate or the minimum wage changes?
Rates, caps and tax scales are dated parameters in the settings. You enter the new value with its effective date, without changing the code. Payslips already validated do not change.
Do I need to buy time clocks?
No. Time tracking uses an Android phone with a camera and printed cards carrying a QR code. The phone is paired with the software once.