MyApp

Getting Started

IntroductionInstallationPull Updates
Architecture

Setup

IDEAI AgentsMCP ServersEnvironment Variables

Workflow

Git WorkflowBuild & DeployTroubleshooting

Authentication

OverviewSetup & ConfigurationUsage & IntegrationTroubleshooting

Payments

OverviewSetup & ConfigurationUsage & IntegrationTroubleshooting

Supabase

OverviewSetup & ConfigurationTroubleshooting

Database

Database SetupPrisma ORMUsage & IntegrationMigrationsTroubleshooting

Storage

OverviewSetup & ConfigurationUsage & IntegrationTroubleshooting

Emails

OverviewSetup and ConfigurationUsage and IntegrationTroubleshooting

SEO

OverviewConfiguration & Best PracticesCustomization & Optimization

UI

OverviewSetup and ConfigurationThemingTroubleshooting
MyApp

Overview

Learn how AWS S3 provides file storage for Plainform.

Plainform uses AWS S3 for file storage, allowing you to upload and retrieve files like images, documents, and user avatars. The S3 client is configured in lib/amazon/s3.ts and validated by @t3-oss/env-nextjs.

What S3 Provides

AWS S3 offers scalable, secure file storage with:

  • File Uploads: Upload files to S3 buckets via the AWS SDK
  • Public URLs: Generate URLs to access uploaded files
  • Secure Storage: IAM credentials and bucket policies control access
  • Scalability: Handle any amount of files with automatic scaling
  • Durability: 99.999999999% (11 9's) data durability

How Plainform Uses S3

Plainform uses S3 for:

  • User Avatars: Placeholder avatars stored in mockupUsers/ prefix
  • Email Assets: Logo and images for email templates
  • File Uploads: Any user-uploaded content (documents, images, etc.)

The S3 client is initialized in lib/amazon/s3.ts:

lib/amazon/s3.ts
import { S3Client } from '@aws-sdk/client-s3';
import { env } from '@/env';

export const s3 = new S3Client({
  region: env.AWS_S3_REGION,
  credentials: {
    accessKeyId: env.AWS_ACCESS_KEY_ID,
    secretAccessKey: env.AWS_SECRET_ACCESS_KEY,
  },
});

Current Usage

Plainform currently uses S3 in:

  • Orders API: Retrieves placeholder user avatars from mockupUsers/ folder
  • Email Templates: References logo images hosted on S3

Alternative Storage Providers

While Plainform uses AWS S3, you can switch to other storage providers:

  • Cloudflare R2: S3-compatible API with zero egress fees
  • DigitalOcean Spaces: S3-compatible object storage
  • Backblaze B2: Cost-effective S3-compatible storage
  • Supabase Storage: Built-in storage if using Supabase
  • Vercel Blob: Integrated with Vercel deployments

Simply update the S3 client configuration to point to your chosen provider's endpoint.

Learn More

  • Setup & Configuration - Configure AWS S3 credentials
  • Usage & Integration - Upload and retrieve files
  • AWS S3 Documentation - Complete S3 reference

How is this guide ?

Last updated on

Troubleshooting

Common Prisma and database issues and how to resolve them.

Setup & Configuration

Configure AWS S3 credentials and create your storage bucket.

On this page

What S3 Provides
How Plainform Uses S3
Current Usage
Alternative Storage Providers
Learn More