Skip to content

Escuela-dev/tracking

Repository files navigation

Student & Client Time Tracking API

A Next.js application for tracking student and client hours using Toggl Track integration.

Features

  • 🕒 Hours tracking integration with Toggl Track
  • 📊 Client-specific time tracking with custom tags
  • 💾 SQLite database for client data storage
  • 🔒 Type-safe API endpoints with Zod validation

Getting Started

Prerequisites

  • Node.js
  • Toggl Track account with API access

Environment Variables

Create a .env file with:

cp .env.example .env.local

Installation

npm install

Database Setup

Seed the database with initial data:

npm run seed

Development

Start the development server:

npm run dev

Build

Create a production build:

npm run build

API Endpoints

GET /api/client/[clientId]

Retrieves client tracking data including remaining hours and last tracked entry.

Parameters

  • clientId (UUID): The unique identifier for the client

Response

{
  "clientId": "uuid",
  "hoursRemaining": 40,
  "lastPaidDate": "2024-01-01T00:00:00.000Z",
  "togglLink": "https://track.toggl.com/timer?tags=client-tag",
  "lastEntryTrackedDate": "2024-01-02T10:00:00.000Z"
}

Testing

Run the test suite:

npm test

Tech Stack

About

Students and freelance tracking by integrating with Toggl Track API

Resources

Stars

Watchers

Forks