GithubHelp home page GithubHelp logo

nishantrpai / rarity-score Goto Github PK

View Code? Open in Web Editor NEW
103.0 4.0 63.0 1.32 GB

Rank your NFT collection by rarity

Home Page: https://odp-rarity.vercel.app

JavaScript 99.85% Shell 0.15%
nft ranking rarity template website nextjs pinata vercel opensea

rarity-score's Introduction

Rarity Score Template

Implement your own rarity tools using this template.

Deploy with Vercel

References:

Needs

Who is this project for and what are their needs?

Creator: Person who is making the NFT collection

  • Save fees
  • Sell collection
  • Build community
  • Generate hype
  • Easily deploy

Buyer: People who have bought the nft

  • Trade nft
  • Buy low
  • Sell high
  • Collect drops

Developers: People who maintain this project

  • Clear documentation
  • Easily iterate

Features

  • List NFTs from JSON (data/collection.json).
  • Filter NFTs based on traits, attributes.
  • Share NFT for token_id: Display rarity score, rarity rank and price (useful for buyers)
  • If you deploy using Vercel, changes are deployed automatically.

PS: All webpages are responsive

How to use

Once you have deployed, you need to change the following for your use:

Using locally:

  1. Install packages
yarn install
  1. Change the JSON in data/collection.json to your collection.json. If there is an error, raise it as an issue. JSON follows opensea standards

  2. Change config/index.js:

  • env : If you're using locally set it to local, while deploying set it to prod.
  • LOCAL_API_URL: Port at which app is running locally. Default value of http://localhost:3000
  • API_URL: Your vercel URL (when you deploy)
  • COLLECTION_NAME: Opensea collection name "OneDayPunks" is an example
  • COLLECTION_TITLE: This is for the website title (for SEO)
  • COLLECTION_DESCRIPTION: og:description (for SEO)
  • COLLECTION_IMG_LINK: og:image for website (for SEO)

Reference for SEO

  1. Running it locally
yarn run dev

Stack

Fetching updates

From time to time, I push updates if you want to update your repo with those changes:

git remote add upstream https://github.com/nishantrpai/rarity-score.git
git fetch upstream
git merge upstream/main

That'll bring you all the latest changes from the repo.

😫 Having issues?

Reach out to me on Twitter or Discord, will deploy it for you.

PS: This is a paid service.

🧾 Have I done it before?

Yes, deployed it for:

Every Islander is special, but some are more special than others ...

Our custom-built open-source rarity tool is now live. Enjoy!

Hat-tip to buildooor πŸ› οΈ @PaiNishant for his code and his guidance and for being a legend πŸ‘Šhttps://t.co/7WytxK1jPH

β€” Larp Island 🏝 (@larpisland) March 18, 2022

Each Coffee Club Cup is unique, just like YOU.. β˜•οΈ

A huge s/o to the one and only @PaiNishant for assisting me with our brand new, open-source rarity ranking tool.

You can check your Cups ranking here:https://t.co/l6gN1tbeoY https://t.co/VEA7X4nwoO pic.twitter.com/t1yLPtu63c

β€” Coffee Club NFTs (@CoffeeClubNFTs) March 22, 2022

▢️ How does it work?

  1. Exchange greetings, finish payments.

  2. I'll request you for project related details, github creds.

  3. Fix the json (if any errors), ensure everything is working and update you along

  4. Tell me any issues you have, can add custom fixes.

  5. You get the rarity score for your project, you are extremely happy and leave a tweet that tells everyone how great this service was 🍻

Socials

Follow _rarityscore on twitter for updates.

Donate

  • Solana: 9dPN7gdN9cyGhjiQn5gBU9DQDBxUJafvS873BcW3mpFT

  • Ethereum: 0x5A8064F8249D079f02bfb688f4AA86B6b2C65359

  • ENS for donating: nishantpai.eth

rarity-score's People

Contributors

nishantrpai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rarity-score's Issues

# of traits not congruent with json data => leads to wrong ranking

The collection I have deployed has male and female bases. There are 13 different layer categories but males use 11 and females 10. The json data shows this correctly, they don’t show 'none' for the layers not present. 


Somehow your app shows 13 traits for each NFT. This is not correct. It should only display male or female traits, not both. This leads to wrong ranking.

Any way to disable adding 'missing_traits' in nfts.js?




https://mtvpunks-mtvtest.vercel.app

fatal: not a git repository

When entering yarn install into terminal

$ husky install
fatal: not a git repository (or any of the parent directories): .git

python?

there is no .py file didnt understand what i have to do to use it, i find that while search about python...it can use it ora i have to search for other?

Better handling of large file downloads?

My NFT collection consists of large NFT files, so when the page loads it's extremely slow and/or images never actually load (even more so when filtering). Do you have any recommendations for handling this e.g progressive loading, preloading, or at least blurred placeholders?

FetchError: invalid json response body at http://localhost:3000/api/nfts? reason: Unexpected token < in JSON at position 0

It gives me this error:

madonna

This is how i setted up the config file:

export const config = {
  env: "local",
  LOCAL_API_URL: "localhost:3000",
  API_URL: "odp-rarity.vercel.app",
  COLLECTION_NAME: "ChinChilla Gang",
  COLLECTION_TITLE: "ChinChilla Gang",
  COLLECTION_DESCRIPTION: 'ChinChilla Gang is about good energy, optimism and authenticity. The ChinChilla Gang collection is composed by 8888 ultra HD NFTs living on Celo blockchain.',
  COLLECTION_IMG_LINK: "https://punkscape.xyz/og.png",
};

And this is my collection.json file: https://we.tl/t-S8j6g1eswR

Setting STARTING_INDEX = 1 throws off NFT detail

When I set STARTING_INDEX = 1, the NFT image that's displayed on the initial screen is not the one that shows when it's clicked and the NFT detail appears. It looks like it's always pulling the next sequential number, not the one that's expected. So if the thumbnail of #200 is clicked, #201 appears in the detail screen.

My collection does starts at ID 1, not 0, did I miss some other setting?

attributes trait_type or value error

This attributes do not work with the app

"attributes": [
      {
        "trait_type": "Argenziano Territory",
        "value": "The Hood"
      },
      {
        "trait_type": "Skeleton",
        "value": "BodyAfrican"
      },
      {
        "trait_type": "Tuxedo Shirt",
        "value": "TuxedoShirt"
      },
      {
        "trait_type": "Tuxedo Jacket",
        "value": "TuxedoJacket"
      },
      {
        "trait_type": "Consigliere Weapons",
        "value": "HandBible"
      },
      {
        "trait_type": "Consigliere Eyes",
        "value": "EyesAngryBrown"
      },
      {
        "trait_type": "Consigliere Ring",
        "value": "PinkyRingDiamondGold"
      },
      {
        "trait_type": "Closed Mouth",
        "value": "MouthSmirk"
      },
      {
        "trait_type": "Consigliere Hair",
        "value": "HairBaldGrey"
      },
      {
        "trait_type": "Consigliere Glasses",
        "value": "EyewearGoldSpectacles"
      },
      {
        "trait_type": "Argenziano",
        "value": "Argenziano"
      }
    ]

or this:

 
"attributes": [
      {
        "trait_type": "Don Argenziano",
        "value": "Don AlessandroBigAlArgenziano"
      },
      {
        "trait_type": "Argenziano",
        "value": "Argenziano"
      }
    ]

Getting Error:

1
set nfts rank
TypeError: Cannot read property 'sum' of undefined
    at set_missing_traits (/Users/selimerunkut/dev/lafamiglia/rarity-score/.next/server/pages/api/nfts.js:221:40)
    at set_trait_rarity (/Users/selimerunkut/dev/lafamiglia/rarity-score/.next/server/pages/api/nfts.js:264:5)
    at getNFT (/Users/selimerunkut/dev/lafamiglia/rarity-score/.next/server/pages/api/nfts.js:329:5)
    at /Users/selimerunkut/dev/lafamiglia/rarity-score/.next/server/pages/api/nfts.js:343:26
    at Array.map (<anonymous>)
    at set_nfts_rank (/Users/selimerunkut/dev/lafamiglia/rarity-score/.next/server/pages/api/nfts.js:343:15)
    at Object.RHsr (/Users/selimerunkut/dev/lafamiglia/rarity-score/.next/server/pages/api/nfts.js:346:1)
    at __webpack_require__ (/Users/selimerunkut/dev/lafamiglia/rarity-score/.next/server/pages/api/nfts.js:23:31)
    at Module.EVir (/Users/selimerunkut/dev/lafamiglia/rarity-score/.next/server/pages/api/nfts.js:110:68)
    at __webpack_require__ (/Users/selimerunkut/dev/lafamiglia/rarity-score/.next/server/pages/api/nfts.js:23:31)
FetchError: invalid json response body at http://localhost:3000/api/nfts? reason: Unexpected token I in JSON at position 0
    at /Users/selimerunkut/dev/lafamiglia/rarity-score/node_modules/node-fetch/lib/index.js:272:32
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async getNFTs (/Users/selimerunkut/dev/lafamiglia/rarity-score/.next/server/pages/index.js:117:16)
    at async Function.module.exports.RNiq.Home.getInitialProps (/Users/selimerunkut/dev/lafamiglia/rarity-score/.next/server/pages/index.js:875:7)
    at async loadGetInitialProps (/Users/selimerunkut/dev/lafamiglia/rarity-score/node_modules/next/dist/shared/lib/utils.js:69:19)
    at async Object.loadGetInitialProps (/Users/selimerunkut/dev/lafamiglia/rarity-score/node_modules/next/dist/shared/lib/utils.js:63:28)
    at async Object.renderToHTML (/Users/selimerunkut/dev/lafamiglia/rarity-score/node_modules/next/dist/server/render.js:314:17)
    at async doRender (/Users/selimerunkut/dev/lafamiglia/rarity-score/node_modules/next/dist/server/next-server.js:1144:38)
    at async /Users/selimerunkut/dev/lafamiglia/rarity-score/node_modules/next/dist/server/next-server.js:1236:28
    at async /Users/selimerunkut/dev/lafamiglia/rarity-score/node_modules/next/dist/server/response-cache.js:64:36 {
  type: 'invalid-json'
}

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.