Coder Social home page Coder Social logo

anselemodims / leaderboard Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 1.0 4.91 MB

The leaderboard website displays scores submitted by different players. It also allows you to submit your score. All data is preserved thanks to the external Leaderboard API service.

Home Page: https://anselemodims.github.io/LeaderBoard/

License: MIT License

HTML 11.92% JavaScript 54.97% CSS 33.11%
leaderboard api service rest async await javascript webpack

leaderboard's Introduction

LeaderBoard

The leaderboard website displays scores submitted by different players. It also allows you to submit your score.

Mini Presentation

screenshot

Dark Mode

screenshot

Additional description about the project and its features.

Built With

  • Major languages (HTML, CSS, JavaScript)

  • Frameworks (None)

  • Technologies used

    - Webpack(Code Bundlng et al)
    - Git(version control)
    - ESLint(JavaScript linting)
    - WebHint(linting tool)
    - Stylelint(style linting)

Live Demo

Live Demo Link

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

  • A text editor(preferably Visual Studio Code)

Install

Usage

Clone this repository

$ git clone [email protected]:AnselemOdims/LeaderBoard.git
$ cd LeaderBoard

Run project

$ npm install
$ npm run start # this will make webpack watching for your changes in code

Open page in browser

$ open dist/index.html

Interaction with the Leaderboard API

  • Each new game is created with the POST method using
        { 
            "name": "My cool new game" 
        }

This request returns a result that holds the unique ID for that game:

  {
    "result": "Game with ID: Zl4d7IVkemOTTVg2fUdz added."
  }

This gameID is saved in the localStorage automatically

The two allowed actions are posting and getting of the scores

  • The POST request creates a new Leaderboard score for the given game sending user and score as parameters like this:

    Endpoint

    https://us-central1-js-capstone-backend.cloudfunctions.net/api/games/:id/scores/

    body parameters

    { 
        "user": "John Doe",
        "score": 42
    }

    and it returns

    {
        "result""Leaderboard score created correctly."
    }
  • The GET request returns data in JSON format like this:

    Endpoint

    https://us-central1-js-capstone-backend.cloudfunctions.net/api/games/:id/scores/

    It returns

    {
      "result": [
          {
              "user": "John Doe",
              "score": 42
          },
          {
              "user": "Peter Parker",
              "score": 35
          },
          {
              "user": "Wonder Woman",
              "score": 50
          }
      ]
    }

Authors

👤 Anselem Odimegwu

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

📝 License

This project is MIT licensed.

leaderboard's People

Contributors

anselemodims avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

vigorpush

leaderboard's Issues

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.