Skip to content

Built for fun and game activities! you can submit scores of players, create a new game, and refresh to see who is on top of the leaderboard. It was built with JavaScript, HTML, and CSS. Thanks to the central LeaderBoard API service all data is preserved

License

clintonjosephs/LeaderBoard

Repository files navigation

LeaderBoard

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

Mini Presentation

LeaderBoard

Additional description about the project and its features.

Built With

  • Major languages (HTML, CSS, JavaScript)

  • Frameworks

     - Bootstrap css framework
  • Technologies used

    - Webpack(Code Bundlng)
    - Git(version control)
    - ESLint(JavaScript linting)
    - WebHint(linting tool)
    - Stylelint(style linting)
    - Jest(project testing)

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

$ https://github.com/clintonjosephs/LeaderBoard.git
$ cd LEADERBOARD

Run project

$ npm install
$ npm test
$ npm build
$ 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

👤 Clinton Mbonu

🤝 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.

About

Built for fun and game activities! you can submit scores of players, create a new game, and refresh to see who is on top of the leaderboard. It was built with JavaScript, HTML, and CSS. Thanks to the central LeaderBoard API service all data is preserved

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published