Code Monkey home page Code Monkey logo

js-links's Issues

How should we handle data for this app?

From my standpoint, I don't see much relational data happening in this app. When I see a link, I see unstructured data like title, description, date of creation, tags etc attached to the single input object.

So I was thinking of using a cloud based GraphQL service like https://www.graph.cool/ to host the data for our project. Yes. This is just like Parse or Firebase.

I will publish a small primer on GraphQL and what it does exactly. Rest assured it has fantastic integration with the React community.

What do you think about this choice? Would anyone else like to handle data in a different way?

How should we rank/score our shared links?

We want to make sure that the best daily content shows up on top anytime someone checks in. The links with the best score will show up on top. This means we have to assign a computed score to each link item that is posted.

So how do we score the best links?

  1. The latest links - sorted by time posted
  2. The most upvoted links - sorted by number of votes accumulated

In effect we can say that links decay over time - they have a certain freshness to them. Adding votes adds to their score but only incrementally.

Worth adding this excerpt:

Effects of gravity (G) and time (T)

Gravity and time have a significant impact on the score of an item. Generally these things hold true:

  • the score decreases as T increases, meaning that older items will get lower and lower scores
  • the score decreases much faster for older items if gravity is increased

For reference I am also adding the ranking algorithm at the heart of Hacker News:

In Python

def calculate_score(votes, item_hour_age, gravity=1.8):
      return (votes - 1) / pow((item_hour_age+2), gravity)

In PHP

function calculate_score($votes, $item_hour_age, $gravity=1.8) {
    return ($votes - 1) / pow(($item_hour_age+2), $gravity);
}

From the excerpt again:

Score = (P-1) / (T+2)^G

where,
P = points of an item (and -1 is to negate submitters vote)
T = time since submission (in hours)
G = Gravity, defaults to 1.8 in news.arc

more on the HN algo here: https://medium.com/hacking-and-gonzo/how-reddit-ranking-algorithms-work-ef111e33d0d9

Unable to run npm install

I forked and cloned the repo and ran npm install it gives me following error: npm WARN enoent ENOENT: no such file or directory . package.json is missing.

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.