This is an example frontend app made by Nader Dabit to start to build on top of Lens Protocol. Publish directory: out
, build command: pnpm install && pnpm build
.
/
├── abi/
│ └── lenshub.json
│ └── lensperiphery.json
├── api/
│ └── index.js
│ └── mutations.js
│ └── queries.js
├── components/
│ └── index.js
│ └── ...
├── pages/
│ └── profile/
│ └── index.js
│ └── _app.js
│ └── ...
├── public/
│ └── ...
├── styles/
│ └── ...
└── package.json
└── ...
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
pnpm install |
Installs the project dependencies |
pnpm run dev |
Starts local dev server at localhost:3001 |
pnpm run build |
Build your production site to ./out/ |
pnpm run start |
Preview your build locally, before deploying |
pnpm run lint |
Runs eslint |
This project has a dependency on having a Infura IPFS API Key used on
uploadToIPFS()
.
Setup your Infura keys inenv.local
. You can checkexample.env.local
for reference.
You can checkout Lens documentation and available functions.
The main API calls used in this app are defined in api/index.js:
Method | Result |
---|---|
recommendProfiles | Get popular profiles |
getProfiles | Get profiles by passing in an array of profileIds |
getPublications | Returns a list of publications based on your request query |
searchProfiles | Allows a user to search across hashtags on publications or profile handles. This query returns either a Post and Comment or Profile. |
follow | Follow a user |
burn | Unfollows a user |
timeline | Shows a feed of content tailored to a signed in user |
createSetProfileMetadataTypedData | Allows a user to update the metadata URI for their profile |
post | Allows a user to publish content |
You can configure this site deployment using Fleek CLI and running:
> fleek sites init
WARN! Fleek CLI is in beta phase, use it under your own responsibility
? Choose one of the existing sites or create a new one. ›
❯ Create a new site
It will prompt you for a name
, dist
directory location & build command
name
: How you want to name the sitedist
: The output directory where the site is located, for this template it'sdist
build command
: Command to build your site, this will be used to deploy the latest version either by CLI or Github Actions
After configuiring your fleek.json
file, you can deployt the site by running
fleek sites deploy
After running it you will get an output like this:
WARN! Fleek CLI is in beta, use it at your own discretion
> Success! Deployed!
> Site IPFS CID: QmTf8fUabGohaRztcbXuZCEZ46hrRrCswVPYrquLezWFRF
> You can visit through the gateway:
> https://ipfs.io/ipfs/QmTf8fUabGohaRztcbXuZCEZ46hrRrCswVPYrquLezWFRF
- Continuous Integration (CI):
fleek sites ci
Documentation. - Adding custom domains:
fleek domains create
Documentation.
You can learn more about Lens visiting our Build3rs Stack - web3 infrastructure overview series in the official Fleek Blog. Where we provide a developer guide to start to build with it.