Coder Social home page Coder Social logo

ldrbored's Introduction

    __    __     __                        __
   / /___/ /____/ /_  ____  ________  ____/ /
  / / __  / ___/ __ \/ __ \/ ___/ _ \/ __  / 
 / / /_/ / /  / /_/ / /_/ / /  /  __/ /_/ /  
/_/\__,_/_/  /_.___/\____/_/   \___/\__,_/                                               

Summary

Ldrbored is a simple web-based game leaderboard visualization. It lists the stats and ranking of a fake set of players. It was written as a sample application to showcase the implementation of a simple REST API and web-based front-end.

Screenshot

Quickstart

Requirements

Ldrbored requires the following software to be pre-installed in order to run:

Running the server

Issue the following commands from a command shell to start the web server:

$ cd path/to/ldrbored
$ npm install
$ node api/server.js

Viewing the application

Open a web browser to the following url:

http://localhost:3000/public

REST API

Querying for stats by user:

GET http://localhost:3000/stats/:user

OR

GET http://localhost:3000/stats?user=:user

Example

GET http://localhost:3000/stats/john-doe

// returns
[
  {
    user: "john-doe"
    name: "time-working"
    value: 240
    createdAt: "2013-10-03T04:55:06.984Z"
    _id: "I54rWoMsXvuGEjNZ"
  },
  ...
]

Querying for stats by stat name:

GET http://localhost:3000/stats?name=:name

Example

GET http://localhost:3000/stats?name=time-on-twitter

// returns
[
  {
    user: "john-doe"
    name: "time-on-twitter"
    value: 240
    createdAt: "2013-10-03T04:55:06.984Z"
    _id: "I54rWoMsXvuGEjNZ"
  },
  ...
]

Posting a new stat:

POST http://localhost:3000/stats?name=time-on-twitter
Content-Type: application/json

Body:
{
  user:  "my-user-name"
  name:  "my-stat-name"
  value: "my-stat-value"
}

Browser Compatibility

Ldrbored has been tested on the following desktop web browsers:

  • Google Chrome
  • Mozilla Firefox 4+

ldrbored's People

Contributors

naasir avatar

Stargazers

 avatar  avatar

Watchers

 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.