Skip to content

perandre/worklog

Repository files navigation

Worklog

CI

AI-powered time logging for consultants. Aggregates your day hour-by-hour from Google, Slack, Trello, GitHub, Jira, and HubSpot — then uses AI to generate ready-to-submit time entries mapped to your projects in Milient/Moment.

Built with Next.js 14, shadcn/ui, Tailwind CSS, and Google Gemini. No database. Supports dark mode.

What it does

  1. Aggregates your day — fetches activity from up to 8 sources (Calendar, Gmail, Docs, Slack, Trello, GitHub, Jira, HubSpot) and lays it out hour by hour.
  2. Generates time entries — sends your activities + project context from Milient to Gemini, which returns structured time log suggestions with hours and descriptions.
  3. Submits to Milient — you review, edit, and submit. Time lock enforcement is handled server-side.

Setup

npm install
cp .env.example .env.local  # Fill in your credentials
npm run dev                  # Open http://localhost:3000

Development

npm run dev          # Dev server
npm run lint         # ESLint
npm run typecheck    # tsc --noEmit
npm test             # Vitest

Git hooks (installed by npm install) lint staged files on commit and run the typecheck + tests on push. CI runs the same checks on every PR. See CONTRIBUTING.md for the workflow and AGENTS.md for the full development guide.

Environment Variables

# NextAuth
NEXTAUTH_URL=https://worklog.frontkom.com
NEXTAUTH_SECRET=generate-a-random-secret

# Google OAuth (Calendar, Gmail, Drive Activity)
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...

# Slack OAuth
SLACK_CLIENT_ID=...
SLACK_CLIENT_SECRET=...

# Trello
TRELLO_API_KEY=...
TRELLO_APP_NAME=Worklog

# GitHub OAuth
GITHUB_CLIENT_ID=...
GITHUB_CLIENT_SECRET=...

# Jira Cloud OAuth
JIRA_CLIENT_ID=...
JIRA_CLIENT_SECRET=...

# HubSpot OAuth
HUBSPOT_CLIENT_ID=...
HUBSPOT_CLIENT_SECRET=...

# Milient/Moment (time tracking)
MILIENT_API_KEY=...
MILIENT_COMPANY_CODE=...

# Gemini (AI suggestions)
GEMINI_API_KEY=...

Google Cloud Setup

  1. Create a project at console.cloud.google.com
  2. Enable: Gmail API, Google Calendar API, Drive Activity API, Google Drive API
  3. Configure OAuth consent screen (add test users if in testing mode)
  4. Create OAuth credentials (Web application)
    • Redirect URI: https://your-app.vercel.app/api/auth/callback/google

Slack Setup

  1. Create an app at api.slack.com/apps
  2. Under OAuth & Permissions, add User Token Scopes: search:read, users:read, im:read
  3. Add redirect URL: https://your-app.vercel.app/api/auth/slack/callback

Nice to have — local dev HTTPS: Slack requires HTTPS redirect URIs and won't accept http://localhost. To develop locally with Slack OAuth, run next dev --experimental-https (Next.js 14 generates a local cert automatically), set NEXTAUTH_URL=https://localhost:3000 in .env.local, and add https://localhost:3000/api/auth/slack/callback as an additional redirect URL in Slack. Optionally install mkcert (brew install mkcert && mkcert -install) to avoid browser cert warnings.

Trello Setup

  1. Get your API key at trello.com/power-ups/admin
  2. Add redirect URL: https://your-app.vercel.app/api/auth/trello/callback

GitHub Setup

  1. Create an OAuth App at github.com/settings/developers
  2. Set callback URL: https://your-app.vercel.app/api/auth/github/callback
  3. Request scopes: repo, read:user

Jira Cloud Setup

  1. Create an OAuth 2.0 app at developer.atlassian.com
  2. Add callback URL: https://your-app.vercel.app/api/auth/jira/callback
  3. Add scopes: read:jira-user, read:jira-work

HubSpot Setup

HubSpot requires a developer app created via the HubSpot CLI:

npm install -g @hubspot/cli@latest
hs account auth
hs project create --name worklog-app --dest /tmp/hubspot-app --project-base app --distribution private --auth oauth

Edit src/app/app-hsmeta.json — set scope to crm.objects.deals.read and add redirect URLs:

  • https://your-app.vercel.app/api/auth/hubspot/callback
  • https://localhost:3000/api/auth/hubspot/callback

Then upload and get credentials:

hs project upload
hs project open  # → Auth tab → copy Client ID and Client secret

Milient / Moment Setup

Milient is a time management platform used by Norwegian consulting firms. The app resolves your Milient user from your Google sign-in email — no separate login needed.

  1. Get your API key and company code from your Milient administrator.
  2. Add them as MILIENT_API_KEY and MILIENT_COMPANY_CODE.

Deploy to Vercel

  1. Push to GitHub
  2. Import the project at vercel.com
  3. Add all environment variables (set NEXTAUTH_URL to your production domain)
  4. Deploy
  5. Add your custom domain in Vercel → Settings → Domains, then point its DNS at Vercel (see docs/CALLBACK-URLS.md)
  6. Update all OAuth redirect URIs to your production domain

Tech Stack

Framework Next.js 14 (App Router)
Auth NextAuth.js v5 (JWT, no database)
UI shadcn/ui + Tailwind CSS v4
AI Google Gemini 2.5 Flash Lite
Time tracking Milient / Moment
Icons Lucide React
Hosting Vercel

About

Simple overview of daily activities

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors