You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a simple [Pastebin](https://pastebin.com) clone where every paste is backed by [Tigris](https://tigrisdata.com/) and [Keyv](https://keyv.org/) using [@tigrisdata/keyv-tigris](https://www.npmjs.com/package/@tigrisdata/keyv-tigris).
4
+
5
+
To get started:
6
+
7
+
1. Create a bucket at [storage.new](https://storage.new).
8
+
2. Create an [access key](https://www.tigrisdata.com/docs/iam/manage-access-key/) for that bucket with Editor permissions.
9
+
3. Copy `.env.example` to `.env`.
10
+
4. Start the service in Docker:
11
+
12
+
```text
13
+
docker run --name pastebin --env-file .env -p 3333:3333 ghcr.io/tigrisdata-community/pastebin
14
+
```
15
+
16
+
Then open your browser to [localhost:3333](http://localhost:3333) and post away! All your posts will be seamlessly stored across the globe in Tigris.
17
+
18
+
## How it works
19
+
20
+
This app is an [Express.js](https://expressjs.com/) app written with [HTMX](https://htmx.org/) to make the website interactive. If you are using an environment where JavaScript is disabled, this app will not function.
21
+
22
+
Creating a paste inserts a JSON object like this into Tigris:
23
+
24
+
```json
25
+
{
26
+
"value": {
27
+
"id": "019acb05-df16-758f-a4fe-c5026f54e12e",
28
+
"title": "arst",
29
+
"body": "arst",
30
+
"createdAt": "2025-11-28T15:12:31.000Z"
31
+
}
32
+
}
33
+
```
34
+
35
+
When you visit a paste URL (eg: `/paste/019acb05-df16-758f-a4fe-c5026f54e12e`), Keyv loads the paste data out of Tigris and renders it in the browser.
36
+
37
+
The cool part about this flow is that the server returns only the bit of HTML on the page that needs to change:
Please [dig through the source code](./src/main.ts) and try this pattern out for yourself! Tigris' globally distributed and consistent object storage makes for a great backend for simple apps like this. Try enabling lifecycle deletion and see how that changes what you do! The sky's the limit!
0 commit comments