How greenqubes/greenqubes-ops works
This repository is a role-based job-operations web application, supporting jobs from creation and design through scheduling, installation, and completion, with related leave, approvals, file, and communication workflows. It also includes an AI assistant, document scanning, and operational administration. The supplied README is empty, so product capabilities are inferred from the file tree; edges are limited to relationships shown in excerpts or SOURCE INDEX references. Several unsampled UI and API subsystems are represented without speculative connections.
Main entry points: chat/route.ts Assistant chat API · [id]/route.ts Job operations API · bugs/route.ts Bug reporting · r2.ts Object storage
Components 26
Job lifecycle
- Job intake
src/features/job-detail/NewJobShell.tsx - Job details
src/features/job-detail/JobDetailShell.tsx - Job operations API
src/app/api/jobs/[id]/route.ts - Stage rules
src/lib/utils/job-stage.ts - Design scoring
src/lib/ai/design-score.ts - Document scanning
src/features/scan/ScanModal.tsx - Scan worker
src/features/scan/scan.worker.ts - Image processing
src/lib/scan/pipeline.ts
Scheduling and operations
- Schedule board
src/features/schedule/ScheduleShell.tsx - Stage management
src/features/stages/StageListShell.tsx - Job arrangement
src/features/arrange/ArrangeCard.tsx - Approvals
src/features/approvals/ClashResolutionModal.tsx - Installer workflows
src/features/installer/InstallerShell.tsx - Leave and events
src/features/leave/LeaveShell.tsx
AI and files
- Assistant workspace
src/features/assistant/AssistantShell.tsx - Assistant chat API
src/app/api/assistant/chat/route.ts - Chat retrieval
src/lib/ai/retrieve.ts - Assistant tools
src/lib/ai/tool-runner.ts - Object storage
src/lib/storage/r2.ts
Platform services
- Administration
src/app/admin/page.tsx - Bug reporting
src/app/api/bugs/route.ts - Telegram bot
src/lib/telegram/bot.ts - Supabase data
src/lib/supabase/service.ts - Session client
src/lib/supabase/server.ts
Other components
- Staff user
- Cloudflare R2
Connections 29
- Staff user → Job intake: starts intake
- Job intake → Job details: opens job
- Job details → Job operations API: updates job
- Job operations API → Stage rules: checks stages
src/app/api/jobs/[id]/route.ts - Job operations API → Design scoring: scores design
src/app/api/jobs/[id]/route.ts - Job operations API → Supabase data: uses service client
src/app/api/jobs/[id]/route.ts - Document scanning → Scan worker: starts scan
- Scan worker → Image processing: processes page
src/features/scan/scan.worker.ts - Image processing → Object storage: uses image tools
src/lib/scan/pipeline.ts - Schedule board → Job operations API: loads job data
- Staff user → Schedule board: coordinates work
- Staff user → Stage management: manages stages
- Staff user → Job arrangement: arranges jobs
- Staff user → Approvals: resolves clashes
- Staff user → Installer workflows: handles installation
- Staff user → Leave and events: records leave
- Assistant workspace → Assistant chat API: sends chat
- Assistant chat API → Session client: authenticates
src/app/api/assistant/chat/route.ts - Assistant chat API → Chat retrieval: retrieves chats
src/app/api/assistant/chat/route.ts - Assistant chat API → Assistant tools: executes tools
src/app/api/assistant/chat/route.ts - Assistant chat API → Object storage: loads attachments
src/app/api/assistant/chat/route.ts - Object storage → Cloudflare R2: stores objects
src/lib/storage/r2.ts - Staff user → Administration: administers system
- Staff user → Bug reporting: reports issue
- Bug reporting → Telegram bot: notifies team
src/app/api/bugs/route.ts - Bug reporting → Object storage: resolves screenshot
src/app/api/bugs/route.ts - Bug reporting → Supabase data: records report
src/app/api/bugs/route.ts - Session client → Supabase data: connects session
- Administration → Design scoring: reviews scores