The Hour Tracking System is an intuitive web application designed to track and manage employee work hours. This system allows employees to clock in and out, while also providing a visual indication of their current status.
- Displays the current time in a user-friendly format.
- Updates the time display every second for accuracy.
- Allows employees to clock in and clock out.
- Employees enter their first and last names to register their time.
- Updates the status of employees in real-time as they clock in or out.
- Visual indication (such as color change) to show if an employee is clocked in or out.
- Displays error messages for situations like trying to clock in or out without being registered or attempting to clock in when already clocked in.
- Keeps a log of all clock-in and clock-out activities.
- Displays a time-stamped entry for each action, providing a clear audit trail.
- A clean and simple interface for ease of use.
- Responsive design for compatibility with various devices.
Before installing the application, ensure you have Node.js installed on your system. You also need a Google Service Account for interacting with Google Sheets.
-
Create a Google Service Account:
- Visit the Google Cloud Console.
- Create a new project or select an existing one.
- Navigate to "IAM & Admin" > "Service Accounts" and create a new service account.
- Assign a role that has permissions to access Google Sheets (e.g., Editor).
- Download the json file containing the keys for your service account. Rename it to key.json and place in the main directory
- Create a key for the service account in JSON format and download it. This file contains the credentials needed for your application.
-
Enable Google Sheets API:
- In the Google Cloud Console, navigate to "APIs & Services" > "Dashboard".
- Click on "ENABLE APIS AND SERVICES" and search for the Google Sheets API.
- Enable the Google Sheets API for your project.
-
Share Your Google Sheet:
- Upload Hour Tracker.xlsx to Sheets
- Share the sheet with the email address of your Google Service Account (found in the JSON key file).
Create a .env
file in the root directory of your project and include the following:
EMAIL=your_service_account_email
SHEET_ID=your_sheet_id
To find your Google Sheet ID:
- Open your Google Sheet in a web browser.
- Look at the URL; it will be in the format
https://docs.google.com/spreadsheets/d/[SHEET_ID]/edit
. - Copy the
[SHEET_ID]
part. This is your Google Sheet ID, which you will place in the .env
- Use
git clone [repository URL]
to clone the project repository. - Replace
[repository URL]
with the URL where the project is hosted.
- Navigate to the project directory.
- Run
npm install
to install the necessary dependencies.
- Execute
node server.js
to start the server. - The server will run on a specified port, which can be set in the server settings.
- Open a web browser and navigate to
http://localhost:[port]
. - Replace
[port]
with the port number your server is using.
For contributing to the project, please follow the standard git workflow:
- Fork the repository.
- Create a new branch for your features or fixes.
- Submit a pull request with a clear description of changes.