Browse by type
This is a Next.js project that demonstrates how to integrate Cloudflare R2 for file upload, download, and deletion functionalities. It is bootstrapped with create-next-app.
https://github.com/user-attachments/assets/9b5b8922-167c-4519-a49c-5efbc932c999
To install the necessary dependencies, run the following command:
npm install
# or
yarn install
# or
pnpm install
# or
bun install
To run the project, first ensure you have installed the necessary dependencies. Then, start the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
The project is structured as follows:
/src
/app
/api
/files
route.ts # API routes for file operations
/upload
route.ts # API route for file upload
/components
file-manager.tsx # Component for managing file uploads, downloads, and deletions
layout.tsx # Main layout component
page.tsx # Home page component
/utils
r2.ts # Utility functions for interacting with Cloudflare R2
/globals.css # Global styles
Make sure to set the following environment variables in your .env file:
R2_ACCOUNT_ID=<your_r2_account_id>
R2_ACCESS_KEY_ID=<your_r2_access_key_id>
R2_SECRET_ACCESS_KEY=<your_r2_secret_access_key>
R2_BUCKET=<your_r2_bucket_name>
This project uses the following packages:
This project is licensed under the MIT License.
browse all types & interfaces →
$ claude mcp add cloudflare-r2-with-nextjs-upload-download-delete \
-- python -m otcore.mcp_server <graph>