A lightweight, Dockerized general-purpose time clock and hours tracker with a React frontend and Node.js backend that syncs with Google Sheets. Designed to be hosted locally and accessed via Tailscale or other VPN on mobile for personal use.
This application helps you track time spent on various tasks, jobs, or personal projects with a modern, simple interface.
This setup is required to allow the application to connect to your Google Sheet. Despite setting up through an external provider, it is free.
- Go to the Google Cloud Console.
- Create a new project (e.g.,
time-tracker). - Enable Google Sheets API:
- Search for "Google Sheets API" or Click Here.
- Click ENABLE.
- Enable Google Drive API:
- Search for "Google Drive API" or Click Here.
- Click ENABLE.
- Note: This is required for the backend to find and interact with the sheet.
- Go to IAM & Admin > Service Accounts.
- Click + CREATE SERVICE ACCOUNT.
- Name:
tracker-bot(or similar). - Click Done.
- Name:
- Click on the newly created service account's email address.
- Go to the KEYS tab.
- Click ADD KEY > Create new key > JSON.
- A JSON file will download. Save it in the root of this project folder. The filename will be long (e.g.,
time-tracker-xxxxxxxxxxxx.json).
- Create a new Google Sheet.
- Click Share (top right).
- Copy the Service Account Email (from step 2.3) and paste it into the Share box.
- Give it Editor permission.
- Important: Copy the Sheet ID from the URL. The URL looks like this:
https://docs.google.com/spreadsheets/d/THIS_IS_THE_SHEET_ID/edit.
Create a file named .env in the root of the project and add the following content.
# The full filename of the JSON key file you downloaded
CREDS_FILE="time-tracker-xxxxxxxxxxxx.json"
# The name of the tab in your Google Sheet where entries are logged
G_SHEET_NAME="Hours Tracker"
# The ID of your Google Sheet (from the URL)
G_SHEET_ID="YOUR_GOOGLE_SHEET_ID_HERE"
# The local IP to bind the container to (127.0.0.1 is recommended)
LOCAL_IP=127.0.0.1
# Your active Tailscale IP address for the host machine
TAILSCALE_IP=100.x.x.xOpen a terminal in the project folder and run:
docker build -t time-tracker .The project includes helper scripts for both bash and PowerShell to run the container.
Option A: Local-Only Mode
By default, the container binds only to 127.0.0.1. This makes the app accessible on the host machine at http://localhost:8501.
- Bash (Linux/macOS):
./run_local.sh
- PowerShell (Windows):
./run_local.ps1
Option B: Local Network Mode (Phone Access)
To access the app on your local network (e.g. from your phone on the same Wi-Fi) without using Tailscale, pass the network flag. The script automatically detects your machine's local IP address and binds the container to it.
- Bash (Linux/macOS):
./run_local.sh --network
- PowerShell (Windows):
./run_local.ps1 -Network
Option C: Tailscale Mode
This makes the app accessible only via your Tailscale network. This requires TAILSCALE_IP to be set to an active IP on your machine.
- Bash (Linux/macOS):
./run_tailscale.sh
- PowerShell (Windows):
./run_tailscale.ps1
- Computer:
http://localhost:8501(under Local-Only Mode) - Local Network (e.g., Phone):
http://<YOUR_DETECTED_IP>:8501(under Network Mode) - Phone (via Tailscale):
http://<YOUR_TAILSCALE_IP>:8501(under Tailscale Mode)
For quick access, you can add the web app to your phone's home screen.
- Open Safari and navigate to the app's URL (e.g.,
http://<YOUR_TAILSCALE_IP>:8501). - Tap the Share button (a square with an arrow pointing up).
- Scroll down and tap Add to Home Screen.
- Name the shortcut (e.g., "Time Tracker") and tap Add.
- Open Chrome and navigate to the app's URL (e.g.,
http://<YOUR_TAILSCALE_IP>:8501). - Tap the three-dot menu in the top-right corner.
- Tap Add to Home screen.
- Name the shortcut and tap Add.
If you want to run the application locally for development without Docker:
- Node.js (v18 or later)
- Install Backend Dependencies:
cd server npm install cd ..
- Install Frontend Dependencies:
cd client npm install cd ..
- Ensure your
.envfile is configured correctly as described above.
-
Start the Backend Server:
cd server npm startThe backend will run on
http://localhost:3001. -
Start the Frontend Dev Server: Open a new terminal window.
cd client npm startThe frontend will open automatically at
http://localhost:3000. The development server is configured to proxy API requests to the backend.