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.
๐ S3 Batch Uploader
A feature-complete, beautifully designed AWS S3 batch file upload system with drag-and-drop upload, progress monitoring, and advanced features.
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
- Login to AWS Console
- Create new S3 bucket
- Configure CORS policy:
[
{
"AllowedHeaders": ["*"],
"AllowedMethods": ["GET", "PUT", "POST", "DELETE"],
"AllowedOrigins": ["*"],
"ExposeHeaders": []
}
]
Create IAM User
- Create new IAM user
- 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
- Visit http://localhost:3003
- Select "Upload" page (default)
- Drag files to upload area or click to select files
- Configure upload options
- Check files to upload
- Click "Start Upload"
View Storage Bucket
- Click "Storage Bucket" menu on the left
- Browse uploaded files
- 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