Skip to content

API Overview

The NestJS app in apps/api (@worksight/api) exposes HTTP endpoints for the MVP. Responses use shapes from @worksight/common and are fixture-backed — not loaded from Supabase or another database yet.

Base URL

EnvironmentURL
Localhttp://localhost:3123 (or your PORT)
Dockerper docker-compose.yml / nginx
Vercelproject worksight-api builds dist/ only — no serverless handler yet

Default Nest listen port is process.env.PORT ?? 3000. Prefer a non-3000 port when @worksight/web is already running.

Authentication

MVP fixture routes do not require API keys. Do not assume production API-key auth, rate-limit headers, or hosted api.worksight.com SDKs — those are not shipped.

Web auth (optional Supabase) is separate from this Nest surface.

Endpoints (MVP)

Health

MethodPathNotes
GET/App root
GET/pingLiveness
GET/healthHealth check

Users & teams

MethodPathReturns
GET/usersEmployeeProfile[] fixtures
GET/users/statsAggregate role/department stats
GET/users/:idOne profile (404 if missing)
GET/teamsTeam[]
GET/teams/:idOne team

Tasks & activities

MethodPathReturns
GET/tasksAssignment[] (?employee_id= filter)
GET/tasks/:idOne assignment
GET/tasks/stats/:employeeIdPer-employee task / balance stats
GET/activitiesActivity[] (optional ?employee_id=)

Quick smoke test

bash
pnpm --filter @worksight/common build
pnpm --filter @worksight/api build
PORT=3123 node apps/api/dist/main.js

curl -s http://localhost:3123/users | head
curl -s http://localhost:3123/tasks
curl -s http://localhost:3123/health

Not available yet

  • POST/PUT/DELETE mutations for users/tasks
  • Survey / burnout / attendance HTTP modules (types may exist in common)
  • Supabase-backed persistence for these routes
  • Serverless Vercel entrypoint
  • Official SDKs, webhooks, or Postman collections at api.worksight.com

Released under the MIT License.