Stack is a workspace‑centric chat and collaboration app where organizations create workspaces from GitHub repositories and collaborate in real time around code.
Each workspace is backed by a GitHub repo and provides:
- Channels for discussion.
- Collaborative coding spaces tied to repository content.
- Integration with GitHub (webhooks for PRs, issues, etc.).
- A path to richer real‑time features (live editing, threads, etc.).
This repo contains the desktop web app (Next.js) and Convex backend.
- Frontend
- Next.js 16 (App Router)
- React 19
- TypeScript
- Tailwind CSS 4 / shadcn‑ui / Radix UI
- Backend
- Convex (database + serverless functions)
- Convex schema for users, workspaces, memberships, channels, messages, threads, integrations
- Auth
- better-auth with GitHub OAuth
@convex-dev/better-authConvex integration
- Integrations
- GitHub webhook handling for PRs, issues, comments, reviews, pushes
- Web Crypto API for webhook signature validation
- Event processing to create threads/messages from GitHub events
- Desktop
- Tauri 2 (Rust wrapper)
apps/desktop/
├── app/ # Next.js App Router pages
│ ├── (onboarding)/ # Login/onboarding flow
│ └── (workspace)/ # Workspace pages
├── components/ # React components
│ ├── ui/ # shadcn/ui components
│ ├── workspace/ # Workspace-specific components
│ └── onboarding/ # Onboarding flow components
├── convex/ # Convex backend
│ ├── schema.ts # Database schema
│ ├── auth.ts # Better-auth integration
│ ├── users.ts # User queries/mutations
│ ├── workspace.ts # Workspace CRUD
│ ├── channels.ts # Channel queries
│ ├── messages.ts # Message queries/mutations
│ ├── presence.ts # User presence
│ ├── github.ts # GitHub API (Octokit)
│ ├── http.ts # HTTP routes (webhooks)
│ └── integrations/ # Integration providers
│ ├── types.ts # Integration type definitions
│ └── github.ts # GitHub provider
├── hooks/ # Custom React hooks
├── lib/ # Utilities
└── types/ # Shared TypeScript types
- users - User profiles with auth info, status, avatar
- workspaces - Workspace entities (name, slug, icon)
- memberships - User-workspace relationships with roles
- channels - Text/voice channels within workspaces
- messages - Chat messages with thread support
- threads - Threaded conversations on messages
- presence - User online/offline status
- unread - Unread message counts
- integrations - GitHub/Jira/Linear configs per workspace
- integrationEvents - Raw webhook events for processing
- integrationSettings - Channel mapping & event filters
- Auth: GitHub OAuth via Convex better-auth
- Onboarding: Multi-step workspace creation wizard with repo selection
- Workspaces: Full CRUD with members and roles
- Channels: Default channels (general, pull-requests, releases) + custom channels
- Messaging: Real-time chat with threads, @mentions, #channel mentions
- Message rendering: Rich embeds for URLs, attachments, mentions
- Consecutive grouping: Messages grouped by author with timestamps
- GitHub webhooks: Pull requests, issues, comments, reviews, pushes
- EmbedBuilder: Fluent API for Discord-style rich embeds
- Event processing: Creates threads/messages from GitHub events
- Integration routing: Webhook routing by workspace slug
- Integration settings: Channel mapping and event filters
- Project board: Kanban with drag-and-drop, tasks, labels, due dates, comments
- Unread counts: Per-channel unread tracking
- OAuth flow UI: User-initiated GitHub OAuth (functions exist, UI not connected)
- Presence indicators: Real-time online/offline UI (schema exists)
- Jira/Linear integrations: Schema ready, handlers not implemented
- Event enrichment:
enrichGithubEvent()function not wired into webhook flow - Desktop app: Tauri setup exists, app not complete
- Node.js (LTS)
- pnpm
- GitHub OAuth app
- Convex account
Create .env.local in apps/desktop/:
NEXT_PUBLIC_SITE_URL=http://localhost:3000
BETTER_AUTH_SECRET=your-secret
GITHUB_CLIENT_ID=your-client-id
GITHUB_CLIENT_SECRET=your-client-secret# Install dependencies
pnpm install
# Run Convex backend
npx convex dev
# Run Next.js app
pnpm devStack supports integrations with external services (GitHub, Jira, Linear). Each integration can:
- Receive webhooks
- Authenticate via OAuth
- Create threads/messages in configured channels
- Webhook events: pull_request, issues, issue_comment, pull_request_review, push
- OAuth: User authorization for repo access
- Message formatting: Rich embeds with PR/issue details, emoji indicators
- Add provider to
integration.providerunion in schema - Create provider file in
convex/integrations/ - Implement webhook parsing & validation
- Add OAuth flow if needed
- Create frontend settings UI
- Workspace creation wizard
- Real-time messaging with threads
- GitHub webhook integration
- Event processing → threads
- Rich embed rendering
- Project board (Kanban)
- OAuth flow UI
- Presence indicators
- Jira/Linear integrations
- Desktop app (Tauri)
- Real-time code collaboration
- Video/audio calls
- Search
- Notifications
- Keep Convex schema and TypeScript types in sync
- Follow existing code patterns (Effect for error handling, Convex queries/mutations)
- Update this README when changing core flows