{"id":25580385,"url":"https://github.com/tderflinger/chi-country-facts","last_synced_at":"2026-04-14T14:32:06.558Z","repository":{"id":226442211,"uuid":"766251358","full_name":"tderflinger/chi-country-facts","owner":"tderflinger","description":"Query and analyze World Factbook country facts via a GraphQL API. Uses MongoDB for data storage.","archived":false,"fork":false,"pushed_at":"2024-05-23T18:34:56.000Z","size":362,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-02T04:07:35.209Z","etag":null,"topics":["countries","data-science","economy","geography","graphql","javascript","mongodb","node","opendata","world"],"latest_commit_sha":null,"homepage":"","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/tderflinger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-02T18:42:59.000Z","updated_at":"2024-05-23T18:34:59.000Z","dependencies_parsed_at":"2024-04-25T10:49:19.870Z","dependency_job_id":"0a970ef4-8375-4d01-b784-d5be85fc22ea","html_url":"https://github.com/tderflinger/chi-country-facts","commit_stats":null,"previous_names":["tderflinger/country-facts","tderflinger/chi-country-facts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tderflinger/chi-country-facts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tderflinger%2Fchi-country-facts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tderflinger%2Fchi-country-facts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tderflinger%2Fchi-country-facts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tderflinger%2Fchi-country-facts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tderflinger","download_url":"https://codeload.github.com/tderflinger/chi-country-facts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tderflinger%2Fchi-country-facts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31801268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["countries","data-science","economy","geography","graphql","javascript","mongodb","node","opendata","world"],"created_at":"2025-02-21T04:15:52.668Z","updated_at":"2026-04-14T14:32:06.534Z","avatar_url":"https://github.com/tderflinger.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Chi logo](./docs/chi.png)\n\n![Chi screenshot](./docs/screenshot-chi.png)\n# chi-country-facts\n\nThis projects takes the JSON data from the World Factbook and loads it into a MongoDB database.\nOnce loaded, you can query the country facts via the MongoDB API. \nAdditionally, there is a GraphQL API to query the data. This opens up possibilities to\nlearn about the countries of the world.\n\nThis project uses the [https://github.com/factbook/factbook.json](https://github.com/factbook/factbook.json)\nproject as the source of the data.\n\n## Why chi-country-facts\n\nIn Swahili, \"nchi\" means country. Since this project is about the facts of countries, we chose the name \"chi-country-facts\".\n\n## Running\n\nThere is a [Docker image available on Docker Hub](https://hub.docker.com/r/tderflinger/chi-country-facts). You can run the application using the following docker-compose-prod.yml file:\n\ndocker-compose-prod.yml:\n```yaml\nversion: '3'\nservices:\n  app:\n    image: tderflinger/chi-country-facts:0.3.0\n    ports:\n      - \"4000:4000\"\n    depends_on:\n      - db\n    environment:\n      - MONGO_URL=mongodb://db:27017/CountryFacts\n  db:\n    image: mongo:latest\n    volumes:\n      - mongodb_data:/data/db\n\nvolumes:\n  mongodb_data: \n```\n\nRun it with the following command:\n\n```bash\ndocker compose -f ./docker-compose-prod.yml up\n```\n\nThis will retrieve the image from Docker Hub and create a local Mongo DB database. Then you can access the Apollo GraphQL Sandbox via the following URL: [http://localhost:4000](http://localhost:4000).\n\n## Development\n\nClone the [https://github.com/factbook/factbook.json](https://github.com/factbook/factbook.json) project into the same directory as this project.\n\n## Mongo DB Database\n\nThere is a Docker Compose file (docker-compose.yml) in the project to run the GraphQL server together with the MongoDB database.\n\nStart with:\n\n```bash\ndocker compose up\n```\n\nAt the first start the JSON factbook data is loaded into the MongoDB database.\n\nThen you can access the Apollo Studio Sandbox by opening the following URL in your browser: http://localhost:4000\n\nInside the Apollo Studio Sandbox you can query the data.\n\n## GraphQL API\n\nIf you want to start the GraphQL server without Docker, you can do so with the following command:\n\n```bash\nnpm run start\n```\n\nNote, that you need to specify your MongoDB URL in the `MONGO_URL` environment variable (.env file).\n\n## Exporting Data\n\nOnce the data is loaded in the MongoDB database you can export the data to a JSON file using the following command:\n\n```bash\nnode export.mjs\n```\n\nThere is also the possibility to export, clean and normalize some data about the economy of the countries using the following command:\n\n```bash\nnode export-economy-csv.mjs\n```\n\nThe resulting file is a CSV file (countries-economy.csv) which can be further analyzed, for example using Excel or Pandas.\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftderflinger%2Fchi-country-facts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftderflinger%2Fchi-country-facts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftderflinger%2Fchi-country-facts/lists"}