Skip to main content

Architecture Overview

  • Monorepo managed by pnpm workspaces and Turbo (turbo run ...).
  • Hosting: firebase.json rewrites /api/** to Express function api, and all other routes to SSR function nextapp.
  • SSR: Next.js app bundled and served from apps/functions (nextapp).
  • Functions: v2 HTTPS functions for business endpoints plus Firestore triggers.

High-Level

  • Frontend: Next.js 15 (React 19) in apps/web, UI built with react-bootstrap.
  • Backend: Firebase Functions (Node 22) in apps/functions exposing HTTPS endpoints + SSR handler.
  • Data: Firestore with collections for businesses, participants, posts, and companyLinkedInPosts.
  • Auth: Firebase Auth client-side with cookie propagation for middleware.
  • Integrations: LinkedIn content ingestion and n8n webhook forwarding.

Request Flow

  1. Browser requests a protected route → middleware.js checks cookie and redirects as needed.
  2. Client uses hooks to fetch and render data from Firestore or call HTTPS endpoints (with x-api-key for server-to-server flows).
  3. For SSR, Firebase nextapp handles requests using Next's request handler.