Back to Templates

AWS S3 Batch Uploader

An AWS S3 batch upload template based on Next.js 14 and App Router, demonstrating how to perform pre-signed uploads using AWS S3; As well as bucket file management, bucket lifecycle management, bucket permission management, etc.

View Demo
FrameworkNext.js
DatabaseAWS S3
An AWS S3 batch upload template based on Next.js 14 and App Router, demonstrating how to perform pre-signed uploads using AWS S3; As well as bucket file management, bucket lifecycle management, bucket permission management, etc.

๐Ÿš€ S3 Batch Uploader

A feature-complete, beautifully designed AWS S3 batch file upload system with drag-and-drop upload, progress monitoring, and advanced features.

Deploy with EdgeOne Pages

More Templates: EdgeOne Pages

โœจ Features

๐Ÿ“ File Upload

  • โœ… Drag & Drop Upload - Support dragging files to the page for upload
  • โœ… Click to Select - Traditional file selection method
  • โœ… Batch Processing - Select multiple files for batch upload at once
  • โœ… File Preview - Display image thumbnails and video covers
  • โœ… File Information - Show file format, size and other detailed information

๐Ÿ“Š Progress Monitoring

  • โœ… Real-time Progress Bar - Display upload progress for each file
  • โœ… Upload Status - Waiting, uploading, success, failure status indicators
  • โœ… Progress Overlay - Display semi-transparent progress layer on file preview during upload
  • โœ… Error Handling - Show error information and retry options when upload fails

โš™๏ธ Advanced Configuration

  • โœ… Concurrency Control - Configurable number of simultaneous file uploads
  • โœ… File Selection - Check/uncheck files to upload

๐Ÿ“‹ Storage Bucket Management

  • โœ… Storage Bucket - View list of uploaded files
  • โœ… File Details - Click to view detailed file information

๐ŸŽจ User Interface

  • โœ… Modern Design - Clean and beautiful user interface
  • โœ… Responsive Layout - Adapt to different screen sizes
  • โœ… Status Feedback - Rich visual feedback and interactive effects

๐Ÿš€ Quick Start

1. Project Already Running

Project is currently running at: http://localhost:3003

2. Configure AWS S3

Before using, please configure your AWS S3 settings:

# Copy environment variable template
cp .env.example .env.local

# Edit configuration file
nano .env.local

Fill in your AWS configuration:

AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
AWS_BUCKET_REGION=your-bucket-region
AWS_BUCKET_NAME=your-bucket-name

3. AWS S3 Setup

Create S3 Bucket

  1. Login to AWS Console
  2. Create new S3 bucket
  3. Configure CORS policy:
[
  {
    "AllowedHeaders": ["*"],
    "AllowedMethods": ["GET", "PUT", "POST", "DELETE"],
    "AllowedOrigins": ["*"],
    "ExposeHeaders": []
  }
]

Create IAM User

  1. Create new IAM user
  2. Add S3 access permission policy:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:PutObject",
        "s3:DeleteObject",
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::your-bucket-name",
        "arn:aws:s3:::your-bucket-name/*"
      ]
    }
  ]
}

๐Ÿ“– Usage Guide

Upload Files

  1. Visit http://localhost:3003
  2. Select "Upload" page (default)
  3. Drag files to upload area or click to select files
  4. Configure upload options
  5. Check files to upload
  6. Click "Start Upload"

View Storage Bucket

  1. Click "Storage Bucket" menu on the left
  2. Browse uploaded files
  3. Click files to view detailed information

Advanced Features

  • Batch Operations: Can upload multiple files simultaneously

๐Ÿ› ๏ธ Technical Architecture

Frontend Tech Stack

  • Next.js 14 - React full-stack framework
  • TypeScript - Type safety
  • Tailwind CSS - Styling framework
  • Lucide React - Icon library

Backend Integration

  • AWS SDK v3 - S3 client
  • Presigned URLs - Secure file upload

Core Features

  • Custom Hooks - File upload logic encapsulation
  • State Management - React useState/useEffect
  • Error Handling - Comprehensive exception handling mechanism

๐Ÿ“ Project Structure

s3-batch-uploader/
โ”œโ”€โ”€ app/                    # Next.js App Router
โ”‚   โ”œโ”€โ”€ api/               # API routes
โ”‚   โ”‚   โ””โ”€โ”€ upload-batch/  # Batch upload API
โ”‚   โ”œโ”€โ”€ components/        # React components
โ”‚   โ”‚   โ”œโ”€โ”€ FileUpload/    # File upload components
โ”‚   โ”‚   โ”œโ”€โ”€ Navigation/    # Navigation components
โ”‚   โ”‚   โ””โ”€โ”€ ui/           # Common UI components
โ”‚   โ”œโ”€โ”€ hooks/            # Custom Hooks
โ”‚   โ”‚   โ””โ”€โ”€ useFileUpload.ts
โ”‚   โ”œโ”€โ”€ lib/              # Utility library
โ”‚   โ”‚   โ””โ”€โ”€ s3-client.ts  # S3 client configuration
โ”‚   โ”œโ”€โ”€ types/            # TypeScript type definitions
โ”‚   โ”œโ”€โ”€ upload/           # Upload page
โ”‚   โ”œโ”€โ”€ history/          # History page
โ”‚   โ””โ”€โ”€ globals.css       # Global styles
โ”œโ”€โ”€ public/               # Static assets
โ”œโ”€โ”€ .env.example          # Environment variable template
โ”œโ”€โ”€ .env.local           # Local environment variables (needs configuration)
โ”œโ”€โ”€ package.json         # Project dependencies
โ”œโ”€โ”€ tailwind.config.js   # Tailwind configuration
โ”œโ”€โ”€ start.sh            # Startup script
โ”œโ”€โ”€ SETUP.md            # Setup guide
โ””โ”€โ”€ README.md           # Project documentation

๐Ÿ”ง Development

Start Development Server

npm run dev
# Or use startup script
./start.sh

Build Production Version

npm run build
npm start

Code Linting

npm run lint

๐Ÿ“š References