
Aug 5, 2025 / 881 views / 10 minutes read
In many businesses—especially in construction, service-oriented, and project-based industries—tracking employee attendance and physical presence at project sites is critical. Imagine you're running a business managing several simultaneous projects across different parts of a city. Each project involves a variety of field workers and supervisors, and they are expected to check in and out daily. In such scenarios, how do you currently track employee check-ins and check-outs? If part of your workforce is paid based on hours spent on-site, what system do you use to log that information accurately? And if supervisors need to know the real-time location of their peers for better coordination, is making phone calls a scalable solution? In this article, I’ll walk through a simplified, hypothetical business scenario and propose a lightweight, fast, and low-cost solution using a Telegram bot and a mini Node.js backend to manage employee attendance and location tracking.
Imagine a company wants to digitize its field staff management. They approach you as a developer to build a solution. The company starts work at a fixed time each day across several project sites, where each site has a group of workers and at least one supervisor. Supervisors oversee the site, but also handle procurement of tools, materials, and logistics. Currently, employees self-report their clock-in and clock-out times to the central office, and administrative staff manually calculate working hours at the end of each month. Additionally, supervisors often need to move between sites or check the presence and location of other supervisors for coordination. This mix of needs clearly points to the demand for a precise, fast, and flexible system for logging attendance and monitoring locations in real time.
To meet the business needs, we chose to build this system around a Telegram bot and this decision is based on several practical reasons: First, Telegram is widely used and familiar to many employees, even those with minimal digital literacy. Second, building native mobile apps for Android and iOS is time-consuming and expensive. In contrast, a Telegram bot requires no installation, and users can start interacting with it immediately. Telegram also offers free access and features that make it ideal for lightweight systems:
These features allow us to build a fully functional attendance system without the overhead of mobile app development. Our system already has a database of employee records, including their phone numbers. To prevent unauthorized access, the bot starts by requesting the user’s phone number. If the submitted number matches a record in the database, the user is authenticated. Once authenticated, the employee can begin their workday by clicking "Check In" and sharing their live location. This data is sent to the server and periodically reviewed. At the end of the workday, the employee is expected to click "Check Out" and send their location again. If they fail to do so, the system can send them a reminder or restrict their access the following day. This solution strikes a perfect balance between usability, cost-efficiency, and development speed.
To create a Telegram bot, no technical background is required. Simply message Telegram’s official bot manager, @BotFather. Use the /newbot command, choose a name and username, and you’ll receive a unique token. This token is your secure access key to control your bot via the Telegram Bot API, and it will be used in your application to receive messages and respond to users.
While there were many backend options—like .NET or Python—we opted for Node.js for several reasons:
We used the widely adopted node-telegram-bot-api package to interact with Telegram’s API. This library allows for:
Here's a quick example:
const TelegramBot = require("node-telegram-bot-api"); const bot = new TelegramBot(TOKEN, { polling: true }); bot.on("message", (msg) => { bot.sendMessage(msg.chat.id, "Hello! Message received."); });
We chose MongoDB as our data store for attendance records and employee information. Here's why:
Example schema:
const attendanceSchema = new mongoose.Schema({ userId: mongoose.ObjectId, checkinTime: Date, checkoutTime: Date, checkinLocation: { latitude: Number, longitude: Number, }, });
The system architecture is intentionally simple and lightweight. Field workers interact with the Telegram bot, which acts as the main user interface. Here’s how it works:
This setup avoids the need for a standalone app and delivers a powerful, intuitive experience for both users and admins.
This article introduced a lightweight, flexible, and cost-effective approach to employee attendance tracking—especially useful for businesses with on-site staff working across different locations. By leveraging Telegram’s familiar interface and Node.js’s rapid development capabilities, we delivered a system that enables real-time check-ins and check-outs, live location tracking, and proactive alerts—all without building or installing a dedicated mobile app.