Skip to content

The Time Variance Authority (TVA) — an automated time tracking watchdog that monitors Clockify entries and reports anomalies via Slack. Built with AWS Lambda and Node.js, it ensures temporal compliance by detecting missing entries, suspicious logs, and maintaining transparency across teams.

Notifications You must be signed in to change notification settings

team-avesta/time-variance-authority

Repository files navigation

Time Variance Authority (TVA)

Time Variance Authority

📺 Introduction

Welcome to the Time Variance Authority (TVA) — the watchdog of time tracking! This automated system ensures that no Clockify entries go missing and keeps an eye out for any unusual time anomalies.

With automated updates delivered straight from the Clockify API to Slack, TVA helps maintain transparency and accountability across the timeline. Whether it's a missed entry or a suspicious log, we've got it covered.

✨ Purpose

  • Detect and highlight missing Clockify entries
  • Identify and flag suspicious time entries for review
  • Ensure everyone's timeline stays clean and accurate
  • Provide daily and monthly reporting through Slack

🛠 Technical Overview

Architecture

  • AWS Lambda Functions with TypeScript
  • Clockify API Integration
  • Slack Notifications
  • Node.js Runtime
  • TypeScript for Type Safety

Build and Deploy

# Install dependencies
npm install

# Build TypeScript
npm run build

# The compiled JavaScript will be in the dist/ directory
# Zip the contents for AWS Lambda deployment
npm run build && cd dist && zip -r ../lambda.zip . && cd .. && zip -r lambda.zip node_modules/

Scheduled Runs

  • Daily Check: Runs at 4:30 AM (Mon-Fri)
  • Monthly Report: Runs at 11:30 AM (Every Monday)

👥 The Time Keepers

  • Yash Vekaria
  • Harish Vaja

📋 Time Keeper Ordinance

🕒 Time Requirements

  • Minimum 8 hours per working day required
  • Previous working day is checked daily
  • Gaps greater than 4 hours trigger alerts
  • Single entries longer than 10 hours are flagged as suspicious

📅 Working Days

  • Monday to Friday only
  • Weekends (Saturday & Sunday) excluded
  • Configurable holidays excluded

🔔 Monitoring & Alerts

The system monitors for:

  • Missing hours (less than 8 hours/day)
  • Long duration entries (exceeding 10 hours)
  • Large gaps (more than 4 hours between entries)
  • Overlapping time entries

⚙️ Configuration

Environment Variables

  • CLOCKIFY_API_KEY: Your Clockify API key
  • SLACK_BOT_TOKEN: Slack bot token for notifications
  • SLACK_CHANNEL_ID: Target Slack channel for notifications
  • HOLIDAYS: Comma-separated list of holidays in YYYY-MM-DD format
  • USERS: JSON string containing user configurations

🎯 Features

Daily Reports

  • Automated checks for the previous working day
  • Individual time entry analysis
  • Immediate Slack notifications for discrepancies

Monthly Reports

  • Comprehensive team-wise summaries
  • Total hours tracked per team
  • Progress tracking against expected hours

🔄 Workflow

  1. Fetches time entries from Clockify
  2. Analyzes entries for discrepancies
  3. Groups data by teams when needed
  4. Sends formatted reports to Slack
  5. Handles rate limiting and error recovery

🚀 "For all time, always."

TVA ensures temporal compliance in time tracking, maintaining order across all timelines!

About

The Time Variance Authority (TVA) — an automated time tracking watchdog that monitors Clockify entries and reports anomalies via Slack. Built with AWS Lambda and Node.js, it ensures temporal compliance by detecting missing entries, suspicious logs, and maintaining transparency across teams.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published