Skip to Content
Engineering11 Documentation πŸ”₯

React (Web)

Next.js 15 platform with a pnpm + Turborepo monorepo, ShadCn/Radix component library, TanStack Query data layer, and server-side auth β€” giving you a fully wired web application foundation.

What It Does

The React web platform lives in sdks-react alongside React Native. It provides:

  • ~24 shared Foundation packages covering auth, data, theming, error handling, files, messaging, notifications, maps, search, and more
  • ~45 web UI components built on Radix primitives with Tailwind v4 and CVA variants
  • A showcase starter app (Next.js 15) demonstrating every Foundation SDK with mock mode for offline development
  • CI/CD pipelines deploying to GCP Cloud Run with Storybook on Firebase Hosting

Key Capabilities

CapabilityDescription
Next.js 15 + App RouterServer-side rendering with Turbopack, file-based routing, and server-side auth middleware
pnpm + TurborepoDependency-aware build orchestration with task caching across ~24 packages
ShadCn/Radix UI Library~45 accessible components with CVA variants, dark mode, and Tailwind v4
TanStack QueryDeclarative data fetching with caching, invalidation, realtime subscriptions, and infinite scroll
Platform AbstractionIRepository, IAuthService, IStorage interfaces β€” code against abstractions, swap implementations
Firebase IntegrationFull wrappers for Auth, Firestore, Storage, Remote Config, Analytics, and App Check
Server-Side Authnext-firebase-auth-edge middleware validates tokens on every request with role-based redirects
Mock ModeMockRepository swaps in for Firestore β€” fully offline frontend development
Dependency InjectionAwilix-style container with useRegisterProviders and useContainer hooks
ChangesetsAutomated versioning and publishing to GitHub Packages
Storybook38 documented stories with a11y testing and Chromatic visual regression

How It Fits Together

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Product App (apps/web β€” Next.js 15) β”‚ β”‚ Providers β†’ Pages β†’ Feature Components β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Feature SDKs β”‚ β”‚ auth Β· user Β· files Β· messaging Β· β”‚ β”‚ notifications Β· maps Β· multimedia Β· β”‚ β”‚ access Β· registration Β· search Β· config β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Foundation APIs β”‚ β”‚ platform Β· firebase Β· rest-client Β· β”‚ β”‚ di Β· error Β· theme Β· tenant-bootstrap β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ UI Components (@engineering11/react-ui) β”‚ β”‚ ~45 ShadCn/Radix components + Tailwind v4 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Foundation packages define abstract interfaces. Firebase packages provide concrete implementations. Feature SDKs compose them into domain capabilities. The product app wires everything together through nested providers.

Architecture

Provider Composition

The app composes Foundation capabilities through ordered providers:

<PlatformProvider platformContainer={platformContainer}> <PlatformAuthProvider user={user}> <TanstackQueryWebFirebaseProvider> <FirebaseProvider {...firebaseConfig}> <PermissionProvider> <ConfigProvider> <UIComponentProvider linkComponent={NextLink}> <FilesProvider uploadConfig={uploadConfig}> {children} </FilesProvider> </UIComponentProvider> </ConfigProvider> </PermissionProvider> </FirebaseProvider> </TanstackQueryWebFirebaseProvider> </PlatformAuthProvider> </PlatformProvider>

Data Fetching

All data flows through TanStack Query hooks wrapping the IRepository abstraction:

Component β†’ useFeatureHook() β†’ useDocumentQuery / useMutation β†’ IRepository._get / _query β†’ BaseFirestoreRepository (injected via DI)

Hooks include useDocumentQuery, useCollectionQuery, useCollectionInfiniteQuery, and mutation hooks for add/update/delete/set/transaction/batch. All support realtime subscriptions via _getValueChanges and _queryValueChanges.

Shared Code with React Native

Packages split exports by platform:

ExportTargetContent
"." (lib)Web + MobileModels, services, repositories, utilities β€” pure TypeScript
"./react"Web onlyReact hooks, providers, web components
"./rn"Mobile onlyRN hooks, providers, native components

What You Don’t Have to Build

  • Platform abstraction layer (repository, auth, storage interfaces)
  • Firebase integration (Auth, Firestore, Storage, Remote Config, Analytics, App Check)
  • TanStack Query hooks for Firestore (documents, collections, infinite scroll, aggregations, realtime)
  • Server-side auth middleware with role-based redirects
  • REST client with auth token injection, retry, and tenant headers
  • ~45 accessible UI components with dark mode and Tailwind v4
  • Structured error handling with Rollbar integration
  • White-label tenant theming with runtime brand switching
  • DI container with provider hooks
  • Storybook with 38 stories, a11y testing, and Chromatic visual regression
  • Mock mode for fully offline frontend development
  • CI/CD to Cloud Run with automated Storybook deployments
  • Package publishing with Changesets to GitHub Packages

What You Build

  • Product-specific screens, features, and business logic
  • Product-specific data models (persisted via the repository layer)
  • Custom navigation/routing and page hierarchy
  • Brand theming overrides per tenant
  • Feature flag configuration
  • Product-specific notification handlers
  • Environment-specific configuration (API endpoints, keys)

Next Steps

Last updated on