Skip to content

A #BuildInPublic Application built on the Cloudflare Stack, leaning in hard to Workflows

Notifications You must be signed in to change notification settings

craigsdennis/punderful-workflows

Repository files navigation

Punderful

Punderful is a #BuildInPublic project that collects puns from everyone and helps them find them ones that make the chuckle.

It was built with 🧡 on the Cloudflare Stack. Most importantly, this code focusses heavy on the new kid on the block Workflows.

Learn More

Setup

You should be able to create all of this on the free tier. Let me know if you run into any problems

D1

This uses a D1 database, so you need to create one

npx wrangler d1 create punderful

Copy and Paste the returned value and replace it in wrangler.toml

Dev mode

npx wrangler d1 migrations apply punderful

Production

npx wrangler d1 migrations apply punderful --remote

Vectorize

Create the index with the settings of embedding model we are going to use

npx wrangler@beta vectorize create punderful --preset "@cf/baai/bge-large-en-v1.5"

(This is already in wrangler.toml)

KV

Create the namespace

npx wrangler@workflows kv namespace create LEADERBOARD

Copy and Paste the returned value and replace it in wrangler.toml

AI Gateway

The Workers AI calls that I do in this app pass through an AI Gateway named punderful. This let's me log and monitor of all AI usage.

Here is a link to your AI Gateway in dashboard.

Or head over to Dash > Your Account > AI > AI Gateway

Click the ➕ sign to create a new Gateway and name it punderful.

Optional: OpenAI

Moderation is available using the free OpenAI the PublishWorkflow. You will need an OpenAI API Key to use it.

npx wrangler secret put OPENAI_API_KEY 

Develop

You can develop locally, mostly.

npm run dev

But you probably really should deploy it.

npm run deploy

About

A #BuildInPublic Application built on the Cloudflare Stack, leaning in hard to Workflows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published