You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stack is a developer-focused social networking platform similar to LinkedIn but tailored for developers. It features a social feed, user profiles with dev stats, real-time messaging (DMs + groups), hashtag-driven content discovery, and a "Hire Me" system. The codebase is a Turborepo monorepo managed with pnpm workspaces.
# Install dependencies
pnpm install
# Run all apps in dev mode (via Turborepo)
pnpm dev
# Run individual apps
pnpm --filter web dev # Frontend on localhost:3000
pnpm --filter api dev # Backend on localhost:4000# Database
pnpm db:generate # Regenerate Prisma client# Build
pnpm build # Build types package first, then API# Clean Next.js cache
pnpm --filter web clean
Conventions & Patterns
Auth flow: NextAuth JWT → API token signed with API_JWT_SECRET → passed in tRPC requests for backend auth
tRPC context: Extracts JWT from Authorization header, verifies with jose, attaches userId to context
Component organization: Page-specific components live inside their route directory (e.g., feed/components/); reusable UI primitives in src/components/ui/
Styling: Tailwind CSS 4 with class-variance-authority for component variants, tailwind-merge for class merging, clsx for conditional classes
State management: Zustand for client-only state; TanStack Query for all server data fetching via tRPC
Real-time: Socket.io for live messaging; SocketContext.tsx provides the socket instance
Image hosting: AWS S3 with presigned upload URLs; Next.js remotePatterns configured for S3, GitHub, Google, Unsplash
Monorepo imports: Use workspace:* protocol for internal packages (@stack/types); path aliases configured via tsconfig.json (@/ maps to src/)