Clone this repo into htdocs (or similar) and it should work when accessed via localhost URL.
You can delete the data in scores.json and start with an empty array to start fresh.
It updates scores when a new one is submitted and also checks every 10 seconds for new scores.
The leaderboard is output based on highest score to lowest score.
It probably makes sense to split this off into two separate pages: 1) leaderboard page, 2) enter score page. Or put an "enter score" button to open a modal window and keep it on a single page.