{"id":46716500,"url":"https://github.com/cofacts/rumors-site","last_synced_at":"2026-03-09T10:31:34.103Z","repository":{"id":15591585,"uuid":"75942611","full_name":"cofacts/rumors-site","owner":"cofacts","description":"Rumors list / creation UI, with server-side rendering","archived":false,"fork":false,"pushed_at":"2025-12-16T12:07:30.000Z","size":20754,"stargazers_count":91,"open_issues_count":56,"forks_count":55,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-12-20T01:52:33.002Z","etag":null,"topics":["crowdsourcing","fact-checking"],"latest_commit_sha":null,"homepage":"https://cofacts.tw","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cofacts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-12-08T14:00:11.000Z","updated_at":"2025-12-09T13:17:03.000Z","dependencies_parsed_at":"2024-01-07T15:26:09.737Z","dependency_job_id":"c89752b6-0284-4f55-a518-9a010a9a405a","html_url":"https://github.com/cofacts/rumors-site","commit_stats":null,"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"purl":"pkg:github/cofacts/rumors-site","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cofacts%2Frumors-site","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cofacts%2Frumors-site/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cofacts%2Frumors-site/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cofacts%2Frumors-site/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cofacts","download_url":"https://codeload.github.com/cofacts/rumors-site/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cofacts%2Frumors-site/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30291807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: 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":["crowdsourcing","fact-checking"],"created_at":"2026-03-09T10:31:32.852Z","updated_at":"2026-03-09T10:31:34.089Z","avatar_url":"https://github.com/cofacts.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rumors-site\n\n[![CI test](https://github.com/cofacts/rumors-site/actions/workflows/ci.yml/badge.svg)](https://github.com/cofacts/rumors-site/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/cofacts/rumors-site/badge.svg?branch=master)](https://coveralls.io/github/cofacts/rumors-site?branch=master)\n\nRumors list / creation UI, with server-side rendering.\n\n## Configuration\n\nFor development, copy `.env.sample` to `.env` and make necessary changes.\n\nFor production via [rumors-deploy](http://github.com/cofacts/rumors-deploy), do setups in `docker-compose.yml`.\n\n## Development\n\nThis project uses NodeJS 24. Use a node version manager like `nvm` to install version 24 (ex. `nvm install 24`)\n\n``` bash\n$ npm install\n$ npm run dev # Then visit http://localhost:3000\n\n# Before you pull request, please lint your code first\n$ npm run lint\n# fix eslint\n$ npm run lint:fix\n# run test\n$ npm t\n```\n### styled-jsx syntax highlighting\n\nSee: https://github.com/zeit/styled-jsx#syntax-highlighting\n\n## Try built image on local\n\nBuild docker image.\n\n``` bash\n# build en version\n$ docker build --build-arg APP_ID=RUMORS_SITE --build-arg LOCALE=en_US -t rumors-site-test-en .\n# build tw version\n$ docker build --build-arg APP_ID=RUMORS_SITE --build-arg LOCALE=zh_TW -t rumors-site-test-tw .\n```\n\nThis will build both `rumors-site-test` image.\n\nRun the docker image on local machine, then visit `http://localhost:3000`.\n\n``` bash\n# English version:\n$ docker run --rm --env-file .env -e NODE_ENV=production -p 3000:3000 rumors-site-test-en\n\n# zh_TW version:\n$ docker run --rm --env-file .env -e NODE_ENV=production -p 3000:3000 rumors-site-test-tw\n```\n\n### Storybook\nWe use storybook to demonstrate components.\n```bash\n# run storybook localserver on port 6006\n$ npm run storybook\n```\nwe also use storyshot to do snapshot test with stories, make sure to run:\n```\n$ npm test -- -u\n```\nbefore pushing to update stories snapshots.\nStorybook will be available under /storybook/index.html after build.\n\n## Analytics\n\nThis project supports Google Tag Manager. You can prepare the following setup in `.env` file:\n- `PUBLIC_GTM_ID`: Google Tag Manager Container ID (`GTM-XXXXXXX`)\n\nThe application will fire the following custom events in GTM `dataLayer`:\n\n- `routeChangeStart` - when next-router starts route change\n- `routeChangeComplete` - when next-router finish route change\n- `dataLoaded` - when article / reply is loaded in article \u0026 reply page\n\nAlso, it will push the following custom variable to `dataLayer`;\n\n- `CURRENT_USER` - Current user object, set by `useCurrentUser`.\n- `doc` - Set when `dataLoaded` event fires. The loaded content itself in object, including its `__typename`.\n\nLastly, in Google Tag Manager we use `data-ga` property to track clicks.\nIf user clicks a decendant of an React element with `data-ga` property,\na click event will be sent to Google analytics with the written `data-ga`.\n(It doesn't even need to be rendered, we [setup the Google Tag Manager](https://github.com/cofacts/rumors-site/pull/254) to read private React instance)\n\nAlso, if a component has its `displayName` set,\na click event with that `displayName` is also sent to Google Analytics when any of its decendant is clicked.\n\n## Design and Mockups\n\n* [真的假的 hackfoldr](http://beta.hackfoldr.org/rumors)\n* [網站 UI flow](https://i.imgur.com/lxas2Ic.jpg)\n\n\n## Translation\n\nWe use [ttag](https://ttag.js.org/) to support build-time i18n for the SSR website. During deploy,\nwe build one Docker image for each locale.\n\nPlease refer to ttag documentation for [annotating strings to translate](https://ttag.js.org/docs/quickstart.html).\n\nTo extract annotated strings to translation files, use:\n\n```\n$ npm run i18n:extract\n```\n\n### Translation files\n\nThe translation files are located under `i18n/`, in [Gettext PO format](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html).\n\n- `en_US.po`: Since the language used in code is already English, this empty translation file exists to simplify settings.\n- `zh_TW.po`: Traditional Chinese translation.\n- `ja.po`: Japanese translation.\n\n### Supporting other languages\n\nYou can replace this with [any language](https://www.gnu.org/software/gettext/manual/html_node/Locale-Names.html) you want to support, by leveraging Gettext [`msginit` command](https://www.gnu.org/software/gettext/manual/html_node/msginit-Invocation.html).\n\nYou will need to change the following to reflect the locale change:\n\n- `i18n:extract` script in `package.json`\n- `i18n:validate` script in `package.json`\n\n### Building in different languages\n\nBy default, the chatbot will be built under `en_US` locale.\n\nDuring development, changing `LOCALE` in `.env` allows you to spin up dev server under a specific locale.\nPlease set `LOCALE` to one of `en_US`, `zh_TW` or any other language code that exists under `i18n/` directory.\n\nWhen previewing translated site on local machine, sometimes the translated text does not appear.\nYou may need to set `BABEL_DISABLE_CACHE` (example: `BABEL_DISABLE_CACHE=1 npm run dev`) to disable\nbabel cache for the new translation to appear correctly.\n\nWhen building using Docker, `LOCALE` can be provided via build args.\n\n### Typescript and API types\n\nThis repository uses GraphQL Code Generator with [client preset](https://the-guild.dev/graphql/codegen/plugins/presets/preset-client).\n\nWhen writing Typescript file with GraphQL, please run this command to generate or update the GraphQL codegen result (`TypedDocumentNode` in `typegen/*`):\n\n```bash\n$ npm run typegen\n```\n\nIf encountering GraphQL operations or fragments wrapped with `gql`, please change to codegen result instead:\n```typescript\n// Old syntax\nimport gql from 'graphql-tag';\n\ngql`...`;\n\n// New syntax\nimport { graphql } from 'path-to-typegen';\ngraphql(/* GraphQL */ `...`)\n```\n\nTo consume the fragments from typed API, see [Fragment Masking documentation](https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#fragment-masking) of the client preset.\n\n## Legal\n\n`LICENSE` defines the license agreement for the source code in this repository.\n\n`LEGAL.md` is the user agreement for Cofacts website users.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcofacts%2Frumors-site","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcofacts%2Frumors-site","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcofacts%2Frumors-site/lists"}