Documentation
Documentation
Introduction

Getting Started

Getting StartedInstallationQuick StartProject Structure

Architecture

Architecture OverviewTech StacktRPC MiddlewareDesign Principles

Patterns

Code Patterns & ConventionsFeature ModulesError HandlingType Safety

Database

DatabaseSchema DefinitionDatabase OperationsMigrationsCaching

API

tRPCProceduresRouterstRPC Proxy Setup
APIsOpenAPIREST Endpoints

Auth & Access

AuthenticationConfigurationOAuth ProvidersRolesSession Management
AuthorizationUser RolesPermissions

Routing & i18n

RoutingDeclarative RoutingNavigation
InternationalizationTranslationsLocale Routing

Components & UI

ComponentsButtonsFormsNavigationDialogs
StylesTailwind CSSThemingTypography

Storage

StorageConfigurationUsageBuckets

Configuration

ConfigurationEnvironment VariablesFeature Flags

Templates

Template GuidesCreate New FeatureCreate New PageCreate Database TableCreate tRPC RouterAdd Translations

Development

DevelopmentCommandsAI AgentsBest Practices

Storage

File upload and storage with S3-compatible providers

Overview

The storage module provides a unified interface for file uploads using S3-compatible storage providers (AWS S3, Cloudflare R2, MinIO, etc.).

Architecture

The storage system is organized in src/lib/storage/:

src/lib/storage/
├── index.ts       # Client-safe exports
├── server.ts      # Server-side storage instance
├── types.ts       # Type definitions and bucket config
├── utils.ts       # Utility functions
└── providers/
    └── s3.ts      # S3 storage provider implementation

Key Concepts

Storage Provider

The storage provider is a class that implements the storage interface. Currently, the S3 provider is available which works with any S3-compatible service.

Buckets

Buckets define different storage areas with specific configurations:

  • File size limits - Maximum upload size per bucket
  • Allowed MIME types - Restrict file types
  • Path prefixes - Organize files in the bucket

Upload Flow

  1. Client requests a presigned upload URL
  2. Server validates the request and generates a signed URL
  3. Client uploads directly to storage
  4. Server stores the file path in the database

Getting Started

  1. Configure your storage provider credentials
  2. Define your buckets in types.ts
  3. Use the FileUpload component for uploads

Continue to Configuration to set up your storage provider.

On this page

Overview
Architecture
Key Concepts
Storage Provider
Buckets
Upload Flow
Getting Started