Skip to content

Commit 14cea24

Browse files
G4brymdeloreyjspersadshaunpersad
authored
Add r2-explorer template (#572)
Co-authored-by: James Delorey <jdelorey@cloudflare.com> Co-authored-by: spersad <spersad@cloudflare.com> Co-authored-by: Shaun Persad <shaunpersad@gmail.com>
1 parent 1601c95 commit 14cea24

File tree

10 files changed

+8425
-586
lines changed

10 files changed

+8425
-586
lines changed

pnpm-lock.yaml

Lines changed: 704 additions & 586 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

r2-explorer-template/.gitignore

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/node,macos
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=node,macos
3+
4+
### macOS ###
5+
# General
6+
.DS_Store
7+
.AppleDouble
8+
.LSOverride
9+
10+
# Icon must end with two \r
11+
Icon
12+
13+
# Thumbnails
14+
._*
15+
16+
# Files that might appear in the root of a volume
17+
.DocumentRevisions-V100
18+
.fseventsd
19+
.Spotlight-V100
20+
.TemporaryItems
21+
.Trashes
22+
.VolumeIcon.icns
23+
.com.apple.timemachine.donotpresent
24+
25+
# Directories potentially created on remote AFP share
26+
.AppleDB
27+
.AppleDesktop
28+
Network Trash Folder
29+
Temporary Items
30+
.apdisk
31+
32+
### Node ###
33+
# Logs
34+
logs
35+
*.log
36+
npm-debug.log*
37+
yarn-debug.log*
38+
yarn-error.log*
39+
lerna-debug.log*
40+
.pnpm-debug.log*
41+
42+
# Diagnostic reports (https://nodejs.org/api/report.html)
43+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
44+
45+
# Runtime data
46+
pids
47+
*.pid
48+
*.seed
49+
*.pid.lock
50+
51+
# Directory for instrumented libs generated by jscoverage/JSCover
52+
lib-cov
53+
54+
# Coverage directory used by tools like istanbul
55+
coverage
56+
*.lcov
57+
58+
# nyc test coverage
59+
.nyc_output
60+
61+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
62+
.grunt
63+
64+
# Bower dependency directory (https://bower.io/)
65+
bower_components
66+
67+
# node-waf configuration
68+
.lock-wscript
69+
70+
# Compiled binary addons (https://nodejs.org/api/addons.html)
71+
build/Release
72+
73+
# Dependency directories
74+
node_modules/
75+
jspm_packages/
76+
77+
# Moved from ./templates for ignoring all locks in templates
78+
templates/**/*-lock.*
79+
templates/**/*.lock
80+
81+
# Snowpack dependency directory (https://snowpack.dev/)
82+
web_modules/
83+
84+
# TypeScript cache
85+
*.tsbuildinfo
86+
87+
# Optional npm cache directory
88+
.npm
89+
90+
# Optional eslint cache
91+
.eslintcache
92+
93+
# Optional stylelint cache
94+
.stylelintcache
95+
96+
# Microbundle cache
97+
.rpt2_cache/
98+
.rts2_cache_cjs/
99+
.rts2_cache_es/
100+
.rts2_cache_umd/
101+
102+
# Optional REPL history
103+
.node_repl_history
104+
105+
# Output of 'npm pack'
106+
*.tgz
107+
108+
# Yarn Integrity file
109+
.yarn-integrity
110+
111+
# dotenv environment variable files
112+
.env
113+
.env.development.local
114+
.env.test.local
115+
.env.production.local
116+
.env.local
117+
118+
# parcel-bundler cache (https://parceljs.org/)
119+
.cache
120+
.parcel-cache
121+
122+
# Next.js build output
123+
.next
124+
out
125+
126+
# Nuxt.js build / generate output
127+
.nuxt
128+
dist
129+
130+
# Gatsby files
131+
.cache/
132+
# Comment in the public line in if your project uses Gatsby and not Next.js
133+
# https://nextjs.org/blog/next-9-1#public-directory-support
134+
# public
135+
136+
# vuepress build output
137+
.vuepress/dist
138+
139+
# vuepress v2.x temp and cache directory
140+
.temp
141+
142+
# Docusaurus cache and generated files
143+
.docusaurus
144+
145+
# Serverless directories
146+
.serverless/
147+
148+
# FuseBox cache
149+
.fusebox/
150+
151+
# DynamoDB Local files
152+
.dynamodb/
153+
154+
# TernJS port file
155+
.tern-port
156+
157+
# Stores VSCode versions used for testing VSCode extensions
158+
.vscode-test
159+
160+
# yarn v2
161+
.yarn/cache
162+
.yarn/unplugged
163+
.yarn/build-state.yml
164+
.yarn/install-state.gz
165+
.pnp.*
166+
167+
### Node Patch ###
168+
# Serverless Webpack directories
169+
.webpack/
170+
171+
# Optional stylelint cache
172+
173+
# SvelteKit build / generate output
174+
.svelte-kit
175+
176+
# End of https://www.toptal.com/developers/gitignore/api/node,macos
177+
178+
# Wrangler output
179+
.wrangler/
180+
build/
181+
182+
# Turbo output
183+
.turbo/

r2-explorer-template/README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# R2-Explorer App
2+
3+
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/templates/tree/main/r2-explorer-template)
4+
5+
![R2 Explorer Template Preview](https://imagedelivery.net/wSMYJvS3Xw-n339CbDyDIA/e3c4ab7e-43f2-49df-6317-437f4ae8ce00/public)
6+
7+
<!-- dash-content-start -->
8+
9+
R2-Explorer brings a familiar Google Drive-like interface to your Cloudflare R2 storage buckets, making file management simple and intuitive.
10+
11+
## Key Features
12+
13+
- **🔒 Security**
14+
15+
- Basic Authentication support
16+
- Cloudflare Access integration
17+
- Self-hosted on your Cloudflare account
18+
19+
- **📁 File Management**
20+
21+
- Drag-and-drop file upload
22+
- Folder creation and organization
23+
- Multi-part upload for large files
24+
- Right-click context menu for advanced options
25+
- HTTP/Custom metadata editing
26+
27+
- **👀 File Handling**
28+
29+
- In-browser file preview
30+
- PDF documents
31+
- Images
32+
- Text files
33+
- Markdown
34+
- CSV
35+
- Logpush files
36+
- In-browser file editing
37+
- Folder upload support
38+
39+
- **📧 Email Integration**
40+
- Receive and process emails via Cloudflare Email Routing
41+
- View email attachments directly in the interface
42+
43+
<!-- dash-content-end -->
44+
45+
> [!IMPORTANT]
46+
> When using C3 to create this project, select "no" when it asks if you want to deploy. You need to follow this project's [setup steps](https://github.com/cloudflare/templates/tree/main/r2-explorer-template#setup-steps) before deploying.
47+
48+
## Getting Started
49+
50+
Outside of this repo, you can start a new project with this template using [C3](https://developers.cloudflare.com/pages/get-started/c3/) (the `create-cloudflare` CLI):
51+
52+
```
53+
npm create cloudflare@latest -- --template=cloudflare/templates/r2-explorer-template
54+
```
55+
56+
A live public deployment of this template is available at [https://demo.r2explorer.com](https://demo.r2explorer.com)
57+
58+
## Setup Steps
59+
60+
1. Install the project dependencies with a package manager of your choice:
61+
```bash
62+
npm install
63+
```
64+
2. Create a [R2 Bucket](https://developers.cloudflare.com/r2/get-started/) with the name "r2-explorer-bucket":
65+
```bash
66+
npx wrangler r2 bucket create r2-explorer-bucket
67+
```
68+
3. Deploy the project!
69+
```bash
70+
npx wrangler deploy
71+
```
72+
73+
## Next steps
74+
75+
By default this template is **readonly**.
76+
77+
in order for you to enable editing, just update the `readonly` flag in your `src/index.ts` file.
78+
79+
Its highly recommended that you setup security first, [learn more here](https://r2explorer.com/getting-started/security/).

0 commit comments

Comments
 (0)