This is a simple file uploader built with React Router, Shadcn (themed via tweakcn), and Lucide.
- Create a public R2 bucket and give it a custom domain
- Edit the CORS policy like so:
[
{
"AllowedOrigins": [
"http://localhost:5173",
"your-custom-domain.com"
],
"AllowedMethods": [
"GET",
"PUT",
"HEAD"
],
"AllowedHeaders": [
"*"
],
"ExposeHeaders": [
"ETag"
],
"MaxAgeSeconds": 3600
}
]
- Clone the repository and create a
.dev.vars
file fromdev.vars.example
- Follow API Token to create access key and secret key
- Replace the variables in the
.dev.vars
file with your own - Install dependencies via
pnpm i
- Run the development server via
pnpm dev
- Put the main domain behind Cloudflare Access so you only can access and you're good to go!
Add R2_ACCESS_KEY_ID
and R2_SECRET_ACCESS_KEY
to Variables and Secrets with type set to Secret