Documentation
Documentation
Introduction

Getting Started

Getting started
Getting StartedInstallationQuick StartProject Structure

Configuration

Configuration
ConfigurationEnvironment ConfigurationEdge ConfigDatabaseAuth SecretStripeFirebaseStorageGoogle Maps And Cloud Service AccountOAuth ProvidersEmail DeliverySentryFeature Flags

Architecture

Architecture
Architecture OverviewTech StackoRPC MiddlewareDesign Principles

Patterns

Patterns
Code Patterns & ConventionsFeature ModulesError HandlingType Safety

Database

Database
DatabaseSetupSchema DefinitionDatabase OperationsMigrationsCaching
Data Tables

API

oRPCProceduresRoutersoRPC Proxy Setup
APIsOpenAPIREST Endpoints

Auth & Access

AuthenticationConfigurationOAuth ProvidersRolesSession Management
AuthorizationUser RolesPermissions

Routing & i18n

RoutingDeclarative RoutingNavigation
InternationalizationTranslationsLocale Routing

Components & UI

ComponentsButtonsFormsNavigationDialogs
StylesTailwind CSSThemingTypography

Storage

Storage
StorageConfigurationUsageBuckets
Stripe Billing

Extra

Caching

Templates

Templates
Template GuidesCreate New FeatureCreate New PageCreate Database TableCreate oRPC RouterAdd Translations

Development

Development
DevelopmentCommandsAI AgentsBest Practices
Pulling Updates

Configuration

Provider selection and storage extension points

Environment Setup

For all environment variables and provider credentials, use:

  • Environment Storage Setup
  • Environment Configuration Index

Provider Selection

The active provider is selected in src/config/app.ts:

Storage: {
  STORAGE_PROVIDER: "firebase", // or "s3"
}

Runtime Resolution

Storage routes resolve the provider at runtime from src/lib/storage/server.ts:

export async function getStorageProvider(): Promise<StorageProvider> {
  switch (Config.Storage.STORAGE_PROVIDER) {
    case "firebase":
      return (await import("./providers/firebase")).firebaseStorageProvider;
    case "s3":
      return (await import("./providers/s3")).s3StorageProvider;
    default:
      throw new Error(`Unknown storage provider: ${Config.Storage.STORAGE_PROVIDER}`);
  }
}

Custom Provider Interface

You can implement custom storage providers by implementing the StorageProvider interface:

interface StorageProvider {
  readonly name: string;
  upload(options: UploadOptions): Promise<UploadResult>;
  download(path: string): Promise<DownloadResult>;
  getPublicUrl(path: string): string;
  getSignedUrl(options: SignedUrlOptions): Promise<string>;
  exists(path: string): Promise<boolean>;
  getMetadata(path: string): Promise<FileMetadata>;
  delete(path: string): Promise<void>;
}

Related Pages

  • Storage Overview
  • Storage Usage
  • Storage Buckets

On this page

Environment Setup
Provider Selection
Runtime Resolution
Custom Provider Interface
Related Pages