A lightweight, serverless web application built with Google Apps Script that allows employees to mark their attendance (IN/OUT) within a specific geographic radius. All data is logged directly into a Google Sheet, with automated wage calculations and monthly summaries.
- Location-Restricted Punching: Employees can only mark attendance if they are within a configurable radius (e.g., 100 meters) of the office coordinates.
- Automated Wage Calculation: Automatically calculates regular hours, overtime, and total daily wages based on per-employee rates.
- Zero-Touch Monthly Summaries: Automatically generates new sheets for each month and compiles a wage summary for the previous month.
- Device Anomaly Detection: Flags suspicious punches if an employee suddenly uses a different device to mark attendance.
- Admin Dashboard (Google Sheets): Manage active employees and hourly rates directly from an "Employees" sheet—no code changes required.
- Automated Email Reports: Emails the finalized monthly attendance and wage report (.xlsx) to the admin on the 1st of every month.
- Backend: Google Apps Script (
Code.gs) - Frontend: HTML, CSS, Vanilla JavaScript (
Index.html) - Database: Google Sheets
- Create a new Google Sheet.
- Copy the long ID from the URL (e.g.,
12shhw3V7...).
- Open your Google Sheet and go to Extensions > Apps Script.
- Replace the default code with the contents of
Code.gs. - Add a new HTML file named
Index.htmland paste the frontend code. - In
Code.gs, update the Configuration section at the top:const GEOFENCE_CENTER = { lat: YOUR_LAT, lng: YOUR_LNG }; const SPREADSHEET_ID = 'YOUR_SPREADSHEET_ID_HERE'; const ADMIN_EMAIL = 'admin@example.com';
- Click Deploy > New deployment.
- Select type: Web app.
- Execute as: Me.
- Who has access: Anyone (or restrict to your Google Workspace domain).
- Click Deploy and authorize the script.
- Open the resulting Web App URL once as the admin. This automatically creates the "Employees" config sheet and installs the necessary background triggers.
- Open your Google Sheet and go to the newly created Employees tab.
- Add your employees' names, hourly rates, and set their status to "Active".