jason 217858ce83
Build and Push Docker Image / build (push) Successful in 2m56s
ci: unify to canonical docker-build workflow (drift labels baked in)
2026-07-19 13:07:47 -05:00
2026-07-03 10:09:25 -05:00
2026-07-03 10:35:42 -05:00
env
2026-03-12 22:58:27 -05:00
env
2026-03-12 22:58:27 -05:00
2026-03-13 09:29:39 -05:00
2026-03-12 23:20:49 -05:00
2026-03-13 11:13:45 -05:00
2026-03-12 17:09:22 -05:00
2026-03-12 17:09:22 -05:00

WFH Daily Report App

A sleek, modern, and dockerized web application for employees to track and submit their daily work-from-home reports. Features a stunning glassmorphic design and seamless integration with Google Workspace.

Features

  • Premium UI: Modern glassmorphism aesthetics with smooth animations and responsive design.
  • Google OAuth 2.0: Secure authentication using your company's Google Workspace accounts.
  • Multi-Step Reporting:
    • Morning: Log planned tasks, time estimates, and initial notes.
    • Evening: Review achievements, update statuses, and submit links to completed work.
  • Reliable Autosave: Task edits are debounced and saved automatically; failed saves are retried and surfaced in the UI so no edit is ever silently lost.
  • Smart Admin Logic:
    • The first user to log in is automatically granted the ADMIN role.
    • Exclusive Admin Panel with server-side search and paginated report browsing, user role management, and settings.
  • Google Drive Integration:
    • Automatically exports completed reports as Google Docs.
    • Admins can designate a specific folder for all exports.
  • Single-Container Architecture: Uses SQLite for persistent storage, making it ideal for "drop-in" deployments (e.g., Unraid, Synology).

🚀 Quick Start

1. Prerequisites

  • Google Cloud Console Project with:
    • OAuth 2.0 Credentials (Web Application)
    • Google Drive API enabled
  • Docker installed on your host.

2. Environment Setup

Copy .env.example to .env and provide your credentials:

cp .env.example .env

3. Run with Docker

# Build and run the container
docker build -t wfh-report .
docker run -p 3000:3000 \
  --env-file .env \
  -v $(pwd)/data:/app/data \
  wfh-report

🗄️ Database & Migrations

The schema is managed with Prisma Migrate. On every container start, entrypoint.sh runs prisma migrate deploy, which applies any pending migrations from prisma/migrations/ — additive and safe, unlike the old db push --accept-data-loss approach.

  • Fresh installs: all migrations are applied automatically to the new database.
  • Upgrading an existing deployment (created before migrations were introduced): the first boot logs a one-time P3005 error, then automatically baselines the database (marks 0_init as applied) and applies the remaining migrations. This is expected — no manual action needed.
  • Reports are unique per user per day (@@unique([userId, date])); the migration merges any pre-existing duplicate reports, keeping the earliest and moving its tasks.

To add a schema change during development:

npx prisma migrate dev --name describe_your_change

🔌 API Overview

All endpoints require a session; admin endpoints require the ADMIN role. Request bodies are validated with zod (invalid input returns 400 with field details).

Endpoint Notes
GET /api/reports Returns { reports, nextCursor }. Query params: date (YYYY-MM-DD), mine=1 (own reports only, matters for admins), q (search by employee/manager, admin), take (page size, max 100), cursor (pagination).
POST /api/reports Creates or resumes the day's report (upsert — safe against double-submits).
GET/PATCH /api/reports/[id] Owner (or admin for GET) only. A SUBMITTED report cannot be reverted.
POST /api/reports/[id]/export Exports/re-exports the report to Google Drive. User content is HTML-escaped; only http(s) links are rendered.
POST/PATCH/DELETE /api/tasks Scoped to tasks on the caller's own reports.
GET/POST /api/admin/settings Admin only. Allowed keys: GOOGLE_DRIVE_FOLDER_ID.
GET/PATCH /api/admin/users Admin only. Role management; self-demotion is blocked.

🏡 Unraid Installation

For specific instructions on installing this on Unraid (including volume mapping and Unraid UI configuration), please refer to our Unraid Installation Guide.

🛠️ Tech Stack

S
Description
Work From Home - Progress Tracker
Readme 712 KiB
Languages
TypeScript 90.5%
CSS 4.6%
Dockerfile 2.3%
JavaScript 2%
Shell 0.6%