How rig-360-media/rig-forge works
RIG Forge is an internal workforce platform combining project and task management, communication, and AI assistance. A user signs in, works through dashboard features backed by API routes and tenant-scoped PostgreSQL, and can use Forgie to query operational data or propose confirmed actions. Distinct branches cover native chat, reporting and scheduled operations, and Google, GitHub, NAS, and WhatsApp integrations. The README documents overall behavior; source excerpts and the SOURCE INDEX support selected internal calls, so unsampled route-level wiring is not expanded.
Main entry points: route.ts Assistant message API · page.tsx Web dashboard · db.ts PostgreSQL store · service.ts Chat service
Components 24
Access and tenancy
- Web dashboard
app/dashboard/page.tsx - Sign-in UI
app/(auth)/login/page.tsx - Authentication API
app/api/auth/login/route.ts - Session and roles
lib/auth.ts - Tenant context
lib/tenant-context.ts - PostgreSQL store
lib/db.ts
Work management
- Projects
app/api/projects/route.ts - Tasks
app/api/tasks/route.ts - Ticket workflow
app/api/tickets/route.ts - Project/task threads
lib/threads.ts
Communication
- Native chat UI
components/chat/ChatApp.tsx - Chat service
lib/chat/service.ts - Supabase Realtime
Forgie assistant
- Forgie interface
components/assistant/ForgieChat.tsx - Assistant message API
app/api/assistant/message/route.ts - Context and prompts
lib/assistant/context.ts - Assistant tools
lib/assistant/ai-sdk-tools.ts - LLM providers
lib/llm/stream.ts
Operations and integrations
- Weekly reports
app/api/reports/generate/route.ts - Scheduled jobs
app/api/cron/standup-digest/route.ts - Google, GitHub, NAS
lib/assistant/tools/index.ts - WhatsApp bridge
whatsapp-bridge/index.js - Web Push
lib/push/send.ts
Other components
- Team member
Connections 28
- Team member → Sign-in UI: signs in
README.md - Sign-in UI → Authentication API: submits credentials
app/(auth)/login/page.tsx - Authentication API → Session and roles: verifies session
- Session and roles → Tenant context: sets organization
lib/auth.ts - Tenant context → PostgreSQL store: scopes queries
lib/db.ts - Team member → Web dashboard: uses
README.md - Web dashboard → Projects: manages projects
- Web dashboard → Tasks: manages tasks
- Web dashboard → Ticket workflow: manages tickets
- Web dashboard → Project/task threads: views discussions
- Projects → PostgreSQL store: reads and writes
app/api/projects/route.ts - Projects → Tasks: supports lifecycle
- Tasks → PostgreSQL store: reads and writes
app/api/tasks/route.ts - Weekly reports → PostgreSQL store: aggregates data
app/api/reports/generate/route.ts - Scheduled jobs → Team member: delivers digest
README.md - Team member → Native chat UI: communicates
README.md - Native chat UI → Chat service: uses chat API
- Chat service → PostgreSQL store: reads and writes
lib/chat/service.ts - Chat service → Supabase Realtime: separates live delivery
lib/chat/service.ts - Team member → Forgie interface: asks Forgie
README.md - Forgie interface → Assistant message API: sends message
- Assistant message API → Context and prompts: builds context
app/api/assistant/message/route.ts - Assistant message API → Assistant tools: dispatches tools
app/api/assistant/message/route.ts - Assistant message API → LLM providers: starts streaming
app/api/assistant/message/route.ts - Assistant tools → Google, GitHub, NAS: invokes capabilities
lib/assistant/ai-sdk-tools.ts - WhatsApp bridge → Assistant message API: routes inbound messages
README.md - Scheduled jobs → Assistant message API: generates assistant drafts
- Chat service → Web Push: sends notifications
lib/chat/service.ts