Standalone local app for tracking time, customers/projects, invoices, invoice PDFs, and local company invoice branding.
- Node.js 20 or newer
- npm
cd ~/Sites/customer-time-tracker
npm installnpm startOpen:
http://localhost:8787
Use a different port:
PORT=8790 npm startUse this when you want the app to stay running after the terminal closes:
cd ~/Sites/customer-time-tracker
setsid bash -c 'exec env PORT=8787 node server.js' >/tmp/customer-time-tracker.log 2>&1 < /dev/null &Check that it is running:
pgrep -af "node server.js"
curl -fsS http://127.0.0.1:8787/api/stateStop it:
kill <pid>Create a service file:
sudo tee /etc/systemd/system/customer-time-tracker.service >/dev/null <<'EOF'
[Unit]
Description=Customer Time Tracker
After=network.target
[Service]
Type=simple
WorkingDirectory=/home/control/Sites/customer-time-tracker
ExecStart=/usr/bin/env PORT=8787 node server.js
Restart=always
RestartSec=5
User=control
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target
EOFStart and enable it:
sudo systemctl daemon-reload
sudo systemctl enable --now customer-time-tracker
sudo systemctl status customer-time-trackerView logs:
journalctl -u customer-time-tracker -fRestart after updates:
sudo systemctl restart customer-time-trackerAll app data is stored locally in:
data/time-tracker.json
Back up that file to preserve:
- customers and projects
- time entries
- invoice records
- paid/unpaid status
- company name, address, and logo data
Backup example:
cd ~/Sites/customer-time-tracker
cp data/time-tracker.json data/time-tracker.$(date -u +%Y%m%d-%H%M%S).jsoncd ~/Sites/customer-time-tracker
npm install
node --check server.js
node --check public/app.js
node --check public/invoice-edit.jsThen restart the running process or service.
http://localhost:8787/
http://localhost:8787/#invoices
http://localhost:8787/#company
http://localhost:8787/api/export.csv
Invoice HTML and PDF exports use invoice IDs:
http://localhost:8787/api/invoices/<invoiceId>.html
http://localhost:8787/api/invoices/<invoiceId>.pdf
Restore a known-good copy of the project files and data file, then restart the app:
cd ~/Sites/customer-time-tracker
node --check server.js
npm start