Skip to content

Commit

Permalink
make the site more ready for the big public
Browse files Browse the repository at this point in the history
  • Loading branch information
Wouter van der Plas2 committed Oct 22, 2023
1 parent 65a35a6 commit 072b44a
Show file tree
Hide file tree
Showing 23 changed files with 425 additions and 1,183 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_run:
workflows: ["Collect"]
branches: [main]
Expand Down Expand Up @@ -44,4 +42,4 @@ jobs:
run: |
git subtree split --prefix gitBuild -b gh-pages
git push -f origin gh-pages:gh-pages
git branch -D gh-pages
git branch -D gh-pages
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'

- name: npm install
run: npm install

- name: npm run lint
run: npm run lint

- name: npm run test
run: npm run test

- name: npm run collect
run: npm run collect

- name: npm run build
run: npm run build
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"Heijn",
"Netherlands",
"nocheck",
"pOpshelf",
"rapideditor",
"REWE",
"sonarjs",
Expand All @@ -20,7 +21,7 @@
"unzipper",
"Wikibase",
"Wikidata",
"pOpshelf"
"wvdp"
],
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "vscode-vfs://github/github-actions[bot]/isOsmComplete/.github/workflows/build.yml"
Expand Down
26 changes: 25 additions & 1 deletion FUTURE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# mcdonald's in many countries
# the future dreams of this project

in this document i will write down some ideas i have for this project.

## the cia world factbook

I am currently working on a script that would use some of the facts in the cia factbook to compare to osm.

I am focusing on the power generation section, because it is the most interesting to me.

its current state can be found in the `collect/countries/fromSource/factbook` file. Im stuck on how to get the data out of osm because the power generation is duplicated on for example the generator and the site.

## statistics sites

there are many sites offering statistics. they are often government or ngo sites. they often have a lot of data, but it is often hard to get to. i would like to make a script that can get data from these sites.

<https://data.worldbank.org/>
<https://cbs.nl/en-gb>

## mcdonald's in many countries

<https://en.wikipedia.org/wiki/List_of_countries_with_McDonald%27s_restaurants>

## untapped sources

<https://gruppe.schwarz/en>
<https://corporate.walmart.com/about>
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# isOsmComplete

This repo is published on <https://wvanderp.github.io/isOsmComplete/>
How complete is OSM, really? That's the question this website sets out to answer. We compare the number of features in OpenStreetMap to the number of features in official data sources, and the results are... well, let's say we're not quite there yet.

You can find the website at <https://wvanderp.github.io/isOsmComplete/>

## How to contribute

We are always looking for new data sources to compare to OSM. Please let us know by opening an issue or a pull request if you know of any.

If you want to add a new data source, you can add a new entry in one of the files in the `collect` folder.

Be aware that any changes to the `data` folder will be overwritten by the GitHub action that runs every day. You can run the collect script locally with `npm run collect` to test your changes.

## How to run locally

Install the dependencies with `npm install`

Run `npm run app` to start the parcel development server. This will serve the website on <http://localhost:1234>

You can use `npm run build` to build the website for production. This will create a `gitBuild` folder with the website.

The data can be collected with `npm run collect`. This will update all the data files in the `data` folder.

## Architecture

The website is built with parcel and is served from GitHub pages. The data is stored in the repository and is updated with GitHub actions.

This website is built with the idea that it should be a static site with no server-side components. This means all the data is collected beforehand, and the website is built with that data. This means that the website can be hosted on GitHub pages and that it can be served from a CDN.

The data is collected with a node script run periodically on GitHub actions. The data is then committed to the repository, and the website is built with that data.

When anything is pushed to the `main` branch, a GitHub action is triggered that builds the website and pushes it to the `gh-pages` branch. This branch is then served by GitHub pages.
9 changes: 4 additions & 5 deletions app/Country.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ export default function Country(props: {
function Comparison(props: {
comparison: Comparison;
}) {
// replace {{actual}} with actual value
const cardDescription = props.comparison.description.replace(
'{{actual}}',
props.comparison.actual.toString()
);
// replace the templates in the description with the actual values
const cardDescription = props.comparison.description
.replace('{{actual}}', props.comparison.actual.toString())
.replace('{{expected}}', props.comparison.expected.toString());

return (
<Card color="light">
Expand Down
4 changes: 2 additions & 2 deletions collect/countries/NL/netherlands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default async function netherlands(): Promise<Comparison[]> {
// normal + fast
138717 + 4875,
'https://www.rvo.nl/onderwerpen/duurzaam-ondernemen/energie-en-milieu-innovaties/elektrisch-rijden/stand-van-zaken/cijfers',
'Electric car charging stations will be more important than ever. The Netherlands has {{actual}} car chargers. Are they all in OSM?',
'Electric car charging stations will be more important than ever. The Netherlands has {{expected}} car chargers. Are they all in OSM?',
['🔋', '🚗'],
'2023-09-12',
taginfoServer
Expand All @@ -30,7 +30,7 @@ export default async function netherlands(): Promise<Comparison[]> {
['hospital', 'clinic'],
305 + 442, // hospitals + clinics
'https://www.zorgkaartnederland.nl/ziekenhuis', // and https://www.zorgkaartnederland.nl/overige-kliniek
'The Netherlands has {{actual}} hospitals and clinics. Are they all in OSM?',
'The Netherlands has {{expected}} hospitals and clinics. Are they all in OSM?',
['🏥'],
'2023-02-19',
taginfoServer
Expand Down
4 changes: 2 additions & 2 deletions collect/countries/US/unitedStates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ export default async function unitedStates(): Promise<Comparison[]> {
'Dollar General',
brandWikidata,
'Q145168', // DG Market, DGX not in Wikidata
18190, // combining Dollar General, DG Market, DGX and pOpshelf
19294, // combining Dollar General, DG Market, DGX and pOpshelf
'https://investor.dollargeneral.com/websites/dollargeneral/English/0/investor-relations.html',
'This General store, also know as DG Market, DGX and pOpshelf, sells everything for $1. How much money would we have if we got a dollar for every Dollar General store on the map?',
['🛒'],
'2023-03-17',
'2023-10-23',
taginfoServer
),
await taginfoComparisons(
Expand Down
4 changes: 2 additions & 2 deletions collect/countries/VN/Vietnam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default async function vietnam(): Promise<Comparison[]> {
['Q38076', 'Q12061542'],
25,
'https://en.wikipedia.org/wiki/List_of_countries_with_McDonald%27s_restaurants',
'McDonald\'s was never able to enter the Vietnamese market. They only managed to open {{actual}} stores. To console them, we should have them all in OSM.',
'McDonald\'s was never able to enter the Vietnamese market. They only managed to open {{expected}} stores. To console them, we should have them all in OSM.',
['🍔', '🛒'],
'2023-09-07',
taginfoServer
Expand All @@ -26,7 +26,7 @@ export default async function vietnam(): Promise<Comparison[]> {
'Q177054',
11,
'https://burgerking.vn/storepickup',
'Burger King is also not very successful in Vietnam. They only have {{actual}} stores. Are they all in OSM?',
'Burger King is also not very successful in Vietnam. They only have {{expected}} stores. Are they all in OSM?',
['🍔', '🛒'],
'2023-09-07',
taginfoServer
Expand Down
8 changes: 4 additions & 4 deletions collect/countries/worldwide/worldwide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default async function worldwide(): Promise<Comparison[]> {
[[brandWikidata, 'Q54078'], ['shop', 'furniture']],
462,
'https://www.ikea.com/global/en/newsroom/corporate/ikea-80th-anniversary-assembling-a-better-future-together-230728/',
'IKEA is a furniture store. They have {{actual}} stores in 63 countries. Are they all in OSM?',
'IKEA is a furniture store. They have {{expected}} stores in 63 countries. Are they all in OSM?',
['🛒'],
'2023-06-28'
),
Expand All @@ -43,7 +43,7 @@ export default async function worldwide(): Promise<Comparison[]> {
'Q259340',
78029,
'https://en.wikipedia.org/wiki/7-Eleven',
'A 7-Eleven is always nearby. Because there are {{actual}} of them in 18 countries. Is your closest 7-Eleven in OSM?',
'A 7-Eleven is always nearby. Because there are {{expected}} of them in 18 countries. Is your closest 7-Eleven in OSM?',
['🛒', '🍔'],
'2023-09-24'
),
Expand Down Expand Up @@ -83,7 +83,7 @@ export default async function worldwide(): Promise<Comparison[]> {
'Q524757',
27000,
'https://www.yum.com/wps/portal/yumbrands/Yumbrands/company/our-brands/kfc',
'KFC expanded out of Kentucky in 1964. They now have {{actual}} stores in 135 countries. Are they all in OSM?',
'KFC expanded out of Kentucky in 1964. They now have {{expected}} stores in 135 countries. Are they all in OSM?',
['🍔', '🛒'],
'2023-03-17'
),
Expand All @@ -93,7 +93,7 @@ export default async function worldwide(): Promise<Comparison[]> {
'Q177054',
18700,
'https://www.rbi.com/English/brands/default.aspx',
'Burger King is a fast food chain. They have {{actual}} stores in 100 countries. Are they all in OSM?',
'Burger King is a fast food chain. They have {{expected}} stores in 100 countries. Are they all in OSM?',
['🍔', '🛒'],
'2023-03-17'
),
Expand Down
Loading

0 comments on commit 072b44a

Please sign in to comment.