Code Monkey home page Code Monkey logo

pycaster-boilerplate's Introduction

PyCaster Boilerplate

PyCaster is a python lib that makes it easy to build apps on Farcaster. It can be used to create Farcaster Frames. This boilerplate provides a demo of it's usage.

Using PyCaster to build your frames backend is easy. I wrote a blog post about it at https://pranavprakash.in/2024/02/12/building-a-farcaster-frame-in-python-with-flask/

If you have any questions, open an issue in this repo or cast to me on Farcaster

Getting Started

Install

  1. Clone this repo
git clone [email protected]:merokudao/pycaster-boilerplate.git
  1. Optional

Create a virtual environment using python -m venv venv and activate it using source venv/bin/activate

  1. Install Dependencies
pip install -r requirements.txt

Environment Variables

Depending on your use case, you may need to set one or more of the following env variables that are needed by PyCaster.

Var Required Description
NEYNAR_API_KEY Recommended Used to perform various crucial calls related to user. If your app does user related functions (ex: check if the user follows a channel or has casted something), this will be needed.
REDIS_HOST Yes Highly recommended to increase speed of frame response. Without this, the pycaster lib has to be changed significantly to bypass.
MEROKU_API_KEY Optional Required if you're building on Meroku dApp Store Kit APIs
OPENAI_API_KEY Optional Required if you're using OpenAI
AWS_ACCESS_KEY_ID Optional If your frame needs to upload media to S3, this is needed.
AWS_SECRET_ACCESS_KEY Optional If your frame needs to upload media to S3, this is needed.

Create your own .env by copying from .env.example.

cp .env.example .env

Set env variables in terminal by

set -a; source .env; set +a

Run

Local

RUN using

flask run --host 0.0.0.0 --port 9091

Docker

Build

docker build -t pycasterdemo .

Run

docker run -p 9091:5000 --env-file .env pycasterdemo

Check

ruff .

Contributing

We'd love to accept contriutions. Please open an issue with what you'd like to build and we'll discuss and take it from there.

pycaster-boilerplate's People

Watchers

 avatar  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.