Skip to content

tigrisdata/tigris-nextjs-starter

Repository files navigation

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.

Deploy with Vercel

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

Path Description
src/app/layout.tsx Root layout with metadata and header
src/app/page.tsx Main page — owns file state and data fetching
src/app/api/files/route.ts List files and handle client uploads
src/app/api/files/[id]/route.ts Get presigned download URL and delete files
src/components/file-upload.tsx Upload widget using @tigrisdata/react
src/components/file-list.tsx Presentational file list with actions
src/lib/format.ts File size and date formatting utilities

API Routes

Method Path Description
GET /api/files List files with optional pagination
POST /api/files Handle client upload handshake
GET /api/files/[id] Get a presigned download URL
DELETE /api/files/[id] Delete a file

Environment Variables

Variable Description
TIGRIS_STORAGE_ACCESS_KEY_ID Your Tigris access key ID
TIGRIS_STORAGE_SECRET_ACCESS_KEY Your Tigris secret access key
TIGRIS_STORAGE_BUCKET The name of your Tigris storage bucket

Learn More

About

A minimal Next.js starter template for file storage with Tigris Storage SDK

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors