Giter Site home page Giter Site logo

unglish-frame's Introduction

poster-animated

A zero-cost, zero-framework, dynamic Farcaster Frame template

This is the "simplest" version of a Frame that can do all of the things a Frame should be able to do. It may be more than you need. It may be less. But it's a great place to start, IMHO. And it is indebted to all the great work by the team over at https://framesjs.org

My needs for starting this were:

  1. ๐Ÿšฑ Zero Framework: Didn't want a framework baked in, and most options default to Next.js/React. No offense, but those seem like overkill.
  2. ๐Ÿ†“ Zero Cost: Frames are for experiments! Experimenting is more fruitful when it's free.
  3. ๐Ÿงฑ Stable: The domain and its attached state should be reasonably stable over the horizon of an experiment. Replit can only give you this at cost (see above)
  4. ๐Ÿคธ Dynamic: You can get all the above pretty easy with static files, but let's be real: we want dynamism or something! And, as social animals, we want to act and react.
  5. ๐Ÿคค Small: and hopefully easy. Nobody to impress here. If my quite smooth brain can write this, your quite prune-like brain can understand it to.
  6. ๐Ÿ˜Ž Cool Tech: We want to be at the ๐Ÿคฌ edge here, people! I admit this is somewhat in tension with "simplest".

Features

  • โ‘ƒ Flow Definition: Define button & input behaviour within each frame file.
  • ๐ŸŽ‡ Static & Dynamic Images: Support for both static & dynamic frame images.
  • ๐Ÿง Validate trustedData: Verify the current payload's trustedData via Farcaster Hubs (eg. wield.co), to protect against tomfoolery.
  • โŒจ๏ธ Text inputs: Accept that UGC with byte-level protection. Our safeDecode function leverages dompurify to give you a literal, and helpful purity test. The judgement of whether the content meets your standards is still up to you, though.
  • โ†—๏ธ Redirect Support: Because frames can't do everything ... yet! And, doggonit, there's a whole world wide web out there for y'all to explore.
  • ๐ŸŽŸ๏ธ Mint from frame (COMING SOON): Using Syndicate + Base, this boilerplate gives you what you need to make random interactions with your frame unforgettable. Is that a good idea? That sounds like a you problem.
  • ๐Ÿ” Anti-theft: Don't bet the engagement farm! Bind your Frame to a specific cast or account so nobody else can get your likes, follows, recasts ... and respect. Capisci?

Example

simplest-frame https://warpcast.com/depatchedmode/0xecad681e

Getting started

  1. Clone the repo
  2. Install the Netlify CLI
  3. Copy sample.env to .env and add:
    • your Netlify Key, for deploys: NETLIFY_AUTH_TOKEN
    • a Wield Key for reading Farcaster state: WIELD_API_KEY
  4. npm install
  5. netlify dev

Testing

Quick & easy: Proxying to the WWW

  1. Run netlify dev --live will give proxy your local machine to the world wide web.
  2. Test that link in either:

Local & reliable:

Follow instructions here on how to setup the Frame.js debugger locally: depatchedmode/simplest-frame#22 (comment)

Note: you'll still need to be connected to the internet for Hubs communication ... unless you run your own locally

Defining your Frame

We'll update with a proper docs soon*, but you'll find everything you need in the public and src directories.

To add a new frame, create a {frameName}.js file in /src/frames and add it as an import to /src/frames/index.js. You'll find examples of dynamic (eg. rendered HTML) and static (eg. served from the public folder) frames in that directory.

*Y'all are welcome to help me write them.

Deploying

This should be as simple as watching a git repo for commits.

You may encounter a 502 gateway error after deployment on the /og-image endpoint. This is a known issue with the sharp module this repo relies upon. We'll hopefully have this fixed by default, but for now there are workarounds. Follow this thread for fixes: depatchedmode/simplest-frame#3

Caveats

I am a designer larping as a dev. I invite your collaboration and feedback. Please be kind.

And please! Can we make it simpler?

Roadmap

  1. Less bad
  2. More better
  3. Migration to the everywhere.computer

unglish-frame's People

Contributors

depatchedmode avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.