Platform

Overview~5 min

Shared capabilities that power your entire application — authentication, configuration, state, and data access.

Read this when you need to understand how cross-cutting functionality works in Catalyst.
Useful for developers building features that span multiple surfaces or modules.

What is the Platform Layer?

Platform is the shared foundation your app runs on. It provides cross-cutting capabilities — authentication, data access, configuration — that work the same way regardless of which surface or module uses them.

Think of it as the infrastructure layer between your framework (Next.js) and your domain logic (modules). Platform code lives in lib/ and provides consistent APIs across your entire application.

Why This Matters

Platform capabilities solve problems that appear everywhere:

Single source of truth

Authentication happens once. Every surface and module uses the same auth system — no duplication, no drift.

Consistent behavior

Same API, everywhere. Whether you're in the App surface or a module, data access patterns work identically.

Easy to update

Change in one place. Update a platform capability and every surface and module benefits immediately.

How Platform Relates to Other Layers

Understanding the layers helps you know where to put code:

Surfaces

Different UIs for different audiences (Web, App, Docs)

Pages, layouts, surface-specific components

Modules

Self-contained domain features

CRM contacts, activity feeds, diagrams

Platform

Shared capabilities used by surfaces and modules

Auth, config, state, database utilities

Packages

Third-party dependencies

Next.js, Tailwind, Supabase, shadcn/ui

Platform Capabilities

What the platform layer provides:

Platform makes AI agents effective. When an AI needs to add a feature that requires authentication or data access, it doesn't have to figure out patterns from scratch. Platform provides documented, consistent APIs that agents can use immediately.

Where Platform Code Lives

lib/
├── config.ts          # App configuration
├── navigation.ts      # Navigation data
├── utils.ts           # Utility functions
├── hooks/             # Shared React hooks
│   └── use-hash-state.ts
├── auth/              # Authentication
│   ├── config.ts
│   └── get-url.ts
├── supabase/          # Database layer
│   ├── client.ts
│   ├── server.ts
│   ├── repository.ts
│   └── crud.ts
├── project-state.ts   # Project state reader
├── briefs.ts          # Brief management
└── specs.ts           # Spec utilities

Next Steps

Explore specific platform capabilities: