{"id":28956807,"url":"https://github.com/developmentseed/scoreboard","last_synced_at":"2025-06-23T21:40:55.591Z","repository":{"id":38815371,"uuid":"143461755","full_name":"developmentseed/scoreboard","owner":"developmentseed","description":"Encouraging OpenStreetMap mappers with badges, graphs \u0026 stats! ✨🕹","archived":false,"fork":false,"pushed_at":"2023-02-01T23:42:22.000Z","size":85702,"stargazers_count":27,"open_issues_count":105,"forks_count":9,"subscribers_count":34,"default_branch":"develop","last_synced_at":"2025-06-19T06:13:55.548Z","etag":null,"topics":["analytics","badges","metrics","openstreetmap"],"latest_commit_sha":null,"homepage":"https://developmentseed.org/scoreboard","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developmentseed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"contributing.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-03T18:42:05.000Z","updated_at":"2023-05-12T16:51:53.000Z","dependencies_parsed_at":"2023-02-17T12:16:08.432Z","dependency_job_id":null,"html_url":"https://github.com/developmentseed/scoreboard","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/developmentseed/scoreboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fscoreboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fscoreboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fscoreboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fscoreboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developmentseed","download_url":"https://codeload.github.com/developmentseed/scoreboard/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fscoreboard/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261561180,"owners_count":23177543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","badges","metrics","openstreetmap"],"created_at":"2025-06-23T21:40:55.158Z","updated_at":"2025-06-23T21:40:55.569Z","avatar_url":"https://github.com/developmentseed.png","language":"JavaScript","readme":"\u003ch1 align=\"center\"\u003eScoreboard 🗺🎯\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\nEngaging and encouraging mappers of OpenStreetMap by rewarding contributions, promoting campaigns, and reporting current mapper statistics\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/developmentseed/scoreboard/actions?query=workflow%3ANode.js%20CI\" target=\"_blank\"\u003e\n      \u003cimg src=\"https://github.com/developmentseed/scoreboard/workflows/Node.js%20CI/badge.svg\" alt=\"Test\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://standardjs.com\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\"\n      alt=\"Standard\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n# 🔨 Development\n\n## Dependencies\n\n- Node 12.14.x\n- Postgres 9.5+\n- Yarn\n- Docker (for development work)\n\nTo set the Node version as specified above:\n\n     $ brew install nvm\n     $ nvm use\n\nSee [this tutorial](https://www.postgresql.org/download/) for details and instructions for installing PostgreSQL on your operating system\n\n### Services\n\nScoreboard depends on three external services/APIs for statistics and functionality:\n- [OSMesa](https://github.com/azavea/osmesa) is a toolkit for processing large amounts of OSM vector data and turning them into stats (e.g: km of road added by user by country)\n- Scoreboard pulls campaigns from the [Tasking Manager](https://github.com/hotosm/tasking-manager) and uses the campaign hashtags to pull campaign specific aggregations from OSMesa\n- [OSM Teams](https://github.com/developmentseed/osm-teams) is a service that allows Scoreboard users to create teams and assign campaigns to a team.\n\n### Environment file\n\nCreate a `.env` file by copying the `.env.sample` file and filling in the\nrequired values. The sample file has comments above each possible environment\nvariable.\n\n- See [Connecting to OSM Teams](#connecting-to-osm-teams)\n- See [Administrator Settings](#administrator-settings)\n\n## Install JavaScript Dependencies\n\n     $ yarn\n\n## Database Setup\n\n### Create and run the database\n\n     $ docker-compose up  # wait for scoreboard_wait-for-db-ready_1 \n\nThis command will create and run the database on port `5433`. The database files are stored under `.tmp` folder.\n\nIf you are running the command for the first time, you should wait until the databases are created. This can take a few minutes.\n\nTo start with a new database with no data, stop the command, remove the `.tmp` folder and run the command again.\n\n### Run database migrations\n\nSet up the database schema by running:\n\n     $ yarn migrate\n\nYou can rollback migrations with `yarn rollback`.\n\n### Populate database\n\nFor the frontend and the API to work, you must have the data loaded on the local database.\n\nTo generate fake user and campaign data run:\n\n     $ yarn seed\n\n### Create an admin user\n\nTo be able to develop admin pages you'll need to have an admin user.\nMake your user an admin by running:\n\n```\n./api/bin/scoreboard create-admin-user --username {your osm username}\n```\n\nIf you were already logged in, log out and log back in, then you'll see an \"admin\" link in the menu in the top right.\n\nKnown issue: before running `create-admin-user` for username, you first have to login to the web app with that username first.\n\n### Add some edits to your user\n\nIt could be useful to give some edits to your user in development.\n\nYou can run:\n\n```\n./api/bin/scoreboard create-edits --osm-id {your osm id}\n```\n\nThis will select some random changesets from the OSMesa edits and assign them to your osm id\n\n## Start Development Server\n\nThis command will start both the frontend and the api together, with livereloading for both the front end and api\n\n     $ yarn dev\n\nThis command will start both the frontend and the api together, with a static version of the api\n    $ yarn dev-static\n\n## Tests\n\nTests for the API endpoints and related code are stored in [api/tests/](api/tests/) and UI tests are stored in [tests/](tests/). To run both:\n\n    $ yarn test\n\nTest the UI and API separately using `yarn test-ui` and `yarn test-api`.\n\n## Linter\n\nLint the code using:\n\n     $ yarn lint\n\nYou can automatically fix some lint errors using `yarn lintfix`.\n\n## Generating Docs\n\nIf you make changes to the API documentation make sure to update the README for the API which is auto-generated from the swagger YAML by running:\n\n     $ yarn docs\n\n## Connecting to OSM Teams\n\nIn OSM-teams, choose \"Connect a new app\". For the callback URL use the path\n`/auth/teams/accept`\n\nFor example in development, Scoreboard runs on localhost:8181, so the\ncallback URL would be `http://localhost:8181/auth/teams/accept` .\n\nThe client id and client secret should be saved to your Scoreboard `.env` file.\n\nScoreboard will work with a single organization at the moment. In osm-teams, record your organization's\nID from the API and use the environment variable `OSM_TEAMS_ORG_ID` to have scoreboard read and write\nto the organization's teams.\n\nIf you are setting up local development for the first time, you may need to create an organization. There is currently no way to do this via the osm teams interfaces. Instead you can use the swagger UI to make the requests.\n\n1) check to see what organizations exist on your local osm-teams \n2) if there is none, create an organization (the id can be anything, but should match `OSM_TEAMS_ORG_ID` in your scoreboard `.env`)\n3) run `yarn seed`\n4) clear your cache and login\n\n# Administrator Settings\n\nThe Administrator Settings are found in the Admin user's dashboard, or\nvia the Admin entry in the User menu.\n\n- Tasking Managers:  Currently HOT Tasking Manager (TM2 - TM3) is supported.\n- Setup Badges\n- Manage Users\n- App Settings: OSMesa integration settings\n\n# Simulated osmesa database\n\nA pg_dump of [osm-fabricator](https://github.com/developmentseed/osm-fabricator) is used to mock the osmesa \ndb when developing locally.\n\nTo update the osmesa db, first develop on osm-fabricator, then pg_dump it into `docker-context/osmesa-mock/init.sql`.\nSee scoreboard's `docker-compose.yml` for more details.\n\n# API docs\n\nSee [api/README](./api/README.md)\n\n# Production\n\nTo use scoreboard in production follow these steps:\n\n1. Make sure you have all the [requirements](#dependencies).\n1. Install dependencies: `yarn`\n1. Setup a production Postgres database\n1. Create the database by running [these commands](docker-context/scoreboard-db/create-dev-db.sh).\n1. Setup an `.env` file with correct values -\u003e [example](.env.sample).\n   - make sure to set `NODE_ENV=production` in your `.env` file\n1. Run the migrations: `npm run migrate`\n1. Add initial data to the database (skip if the database already has data) `npm run seed`\n1. [OPTIONAL] Preload list of users `npm run users`\n1. Populate stats: `npm run clocks`\n1. [OPTIONAL] Assign admin users by running `./api/bin/scoreboard create-admin-user --osm-id {your-id}`\n   - Note: \n1. Build: `npm run build`\n1. Launch the server: `node server.js`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fscoreboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopmentseed%2Fscoreboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fscoreboard/lists"}