Skip to content

A minimal example of using Lens Protocol to build a blog

Notifications You must be signed in to change notification settings

PatrickAlphaC/lens-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


LensBlog


LensBlog

About

A demo decentralized blogging platform built off LensProtocol. It's feature limited, but it can:

  • View Articles of people you follow
  • Post Articles

Posting via base64 encoded contentURIs currently isn't indexed by the lens API. You can still do it since the data will be on chain, but for the lens API to index, we need to upload our data to something like IPFS first, which is why we have optional Pinata support.

Getting Started

Requirements

  • git
    • You'll know you did it right if you can run git --version and you see a response like git version x.x.x
  • Nodejs
    • You'll know you've installed nodejs right if you can run:
      • node --versionand get an output like: vx.x.x
      • You'll also need npm

Quickstart

  1. Clone and install dependencies
git clone https://github.com/PatrickAlphaC/lens-blog/
cd lens-blog
npm i
  1. Start the dev server
npm run dev

If you go to localhost:3000 you'll see something that looks like:

public/home-demo.png.

If you connect your wallet, and sign into Lens, it'll populate with Articles from those you follow. Then, you can go and write an article.

Writing Queries

Lens Protocol is a decentralized smart contract, however, reading from smart contracts can sometimes be hard. So the lens team currently has a centralized API you can query to build apps easier. The easiest way I've found to write queries is to take the api.lens.dev URL, and stick it into:

https://studio.apollographql.com/sandbox/explorer

It will auto populate with the schema and write your gql queries as you pick the parameters you want.

You can also try queries here: https://api.lens.dev/

Contributing

Contributions are always welcome! Open a PR or an issue!

Thank You!

About

A minimal example of using Lens Protocol to build a blog

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published