DEV Community 👩‍💻👨‍💻

Cover image for GFTW Web monetization guest book!
Jan Z
Jan Z

Posted on

GFTW Web monetization guest book!

What I built 😅

Ok so I started and finished this thing... today. It's really late, as in four days past the deadline kind of late, so it won't be eligible for the actual hackathon... BUT, I just heard about the hackathon (and the associated Grant for the Web request for proposal), and I decided I had to build a small sample app that uses Web Monetization in order to learn more about it!

Also, this seems like the only project built on Svelte/Sapper and using Fauna and Vercel, so that's exciting! Someone'll probably glean something from this effort.

Ok! So this is a guest book from the 90's that pays the people who sign the guest book with their username and payment pointer. The payment system is based on the Probabilistic Revenue Sharing example. Svelte pulls a new pointer every few seconds and swaps out the current pointer. Basically, the more messages you leave, the more you'll get paid.

Submission Category:

Exciting Experiments

Demo

Link to the live project: https://gftw-guestbook.vercel.app/

Link to Code

GitHub logo janzheng / web-money-guestbook

Web Monetized Guest Book Example

GFTW Web Monetized Guestbook

This is a demo of how to build a guest book using several JAMStack technologies (Svelte/Sapper, FaunaDB, and Vercel).

You can find the writeup here: https://dev.to/yawnxyz/gftw-web-monetization-guest-book-3aao

How to use

Visit the live demo (https://gftw-guestbook.vercel.app/) and type in a username, your pointer, and a message, and watch the $ roll in as others visit the page!

Developer Instructions

To run this locally, clone this repo and do a

yarn install

Run the project with

yarn dev

And open up a new browser window to

localhost:4060

Deploying to Vercel Now

To deploy, make sure you have the Vercel CLI from https://vercel.com, then deploy with

now --prod



How I built it

The demo is built on Svelte/Sapper, uses Fauna as a back-end database, and is deployed on Vercel (formerly Zeit Now) as a JAMStack project.

I had to figure out Fauna along the way (it's excellent for JAMStack projects), and discovered all the limitations of Web Monetization. For example, there's no way to authorize / recognize the same payer each time (you can't attach an identity to the payer).

The original idea for the hackathon was for people to designate a certain amount of $ to pay someone for content (e.g. like paying for a Substack subscription), but it seems this is impossible using Coil / Web Monetization right now, since it mostly focuses on the (outdated) model of time spent on a site. If Web Monetization supported other developers to build out a Coil-like experience (where you can charge users subscription $5-10/mo through Web Monetization), that would be incredible. But alas.

Top comments (0)

Update Your DEV Experience Level:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. 🛠