Next.js + Tigris Storage Starter

A minimal starter template for file storage with Tigris Storage SDK and Next.js. Upload, list, download, and delete files using Tigris Storage SDK.

Features

  • File uploads — Files are uploaded with private access by default
  • Presigned URL downloads — Secure, time-limited download links via Tigris
  • Multipart uploads — Large files are uploaded in parallel chunks
  • Pagination — Browse files with pagination

Getting Started

  1. Create a new project

    npx create-next-app my-app --example "https://github.com/tigrisdata/tigris-nextjs-starter"
    cd my-app

    Or clone directly:

    git clone https://github.com/tigrisdata/tigris-nextjs-starter.git my-app
    cd my-app
  2. Set up environment variables

    cp .env.example .env.local

    Fill in your Tigris credentials. You can get these from the Tigris Dashboard.

  3. Install dependencies

    npm install
  4. Run the development server

    npm run dev

    Open http://localhost:3000 to start uploading files.

Project Structure

PathDescription
src/app/layout.tsxRoot layout with metadata and header
src/app/page.tsxMain page — owns file state and data fetching
src/app/api/files/route.tsList files and handle client uploads
src/app/api/files/[id]/route.tsGet presigned download URL and delete files
src/components/file-upload.tsxUpload widget using @tigrisdata/react
src/components/file-list.tsxPresentational file list with actions
src/lib/format.tsFile size and date formatting utilities

API Routes

MethodPathDescription
GET/api/filesList files with optional pagination
POST/api/filesHandle client upload handshake
GET/api/files/[id]Get a presigned download URL
DELETE/api/files/[id]Delete a file

Environment Variables

VariableDescription
TIGRIS_STORAGE_ACCESS_KEY_IDYour Tigris access key ID
TIGRIS_STORAGE_SECRET_ACCESS_KEYYour Tigris secret access key
TIGRIS_STORAGE_BUCKETThe name of your Tigris storage bucket

Learn More