Try   HackMD

【Cofacts 真的假的】Homepage for Developers

Show me the code!

Cofacts is comprised of several components, in separate repositories. The website cofacts.g0v.tw (rumors-site) and the LINE bot (rumors-line-bot) acts as a client to the server (rumors-api).

rumors-site

Website that lists all submitted instant messages (articles). Editors can submit replies to the articles in this website.

📃 Readme - https://github.com/cofacts/rumors-site

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Issues - https://github.com/cofacts/rumors-site/labels/good first issue

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Tech stack - Next.js (React.js)

rumors-line-bot

The line bot server behind "Cofacts 真的假的 - 轉傳查證".

📃 Readme - https://github.com/cofacts/rumors-line-bot (Including state diagram)

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Issues - https://github.com/cofacts/rumors-line-bot/labels/good first issue

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Tech stack - Node.js, Svelte.js (LIFF)

rumors-api

API server for listing, searching and submitting forwarded instant messages (Articles) and replies.

📃 Readme - https://github.com/cofacts/rumors-api

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Issues - https://github.com/cofacts/rumors-api/labels/good first issue

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Tech stack - Node.js, GraphQL, koa2

url-resolver

When rumors-api receives a URL, it sends to url-resolver; url-resolver crawls and analyzes the page, then returns a summarized text of that URL.

📃 Readme - https://github.com/cofacts/url-resolver

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Issues - https://github.com/cofacts/url-resolver/issues

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Tech stack - Node.js, Puppeteer, APIs (Youtube API), readability. Uses gRPC to communicate with rumors-api.

rumors-db

Home to Elasticsearch schema (indexes) & migration scripts

📃 Readme - https://github.com/cofacts/rumors-db

🗺️ Fields in each index & their relations - https://g0v.hackmd.io/@mrorz/S1caurZq8

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Issues - https://github.com/cofacts/rumors-db/labels/help wanted

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Tech stack - Node.js, Elasticsearch

The ER Model

The logical entities used across Cofacts codebase can be depicted in this ER model.







mappings



replyrequests

Reply Request   

Record of a user wants
an article to be replied
   



replyrequestfeedbacks

Reply Request Feedback   

User feedback voting toward
a reply request
   



replyrequests--replyrequestfeedbacks

n
1



articlereplies

Article-Reply   

N-N mapping connecting
an article and a reply 
   



articlereplyfeedbacks

Article-Reply Feedback   

User feedback voting toward
an article-reply
   



articlereplies--articlereplyfeedbacks

n
1



replies

Reply   

Editor reply to the message
   



articlereplies--replies

1
n



articlecategories

Article-Category   

N-N mapping connecting
an article and a category 
   



articlecategoryfeedbacks

Article-Category Feedback   

User feedback voting toward
an article-category
   



articlecategories--articlecategoryfeedbacks

n
1



categories

Category   

Topic label
   



articlecategories--categories

1
n



articles

Article   

User-reported suspicious message
   



articles--replyrequests

n
1



articles--articlereplies

n
1



articles--articlecategories

n
1



:::WARNING
Due to non-relational nature of ElasticSearch, the actual DB mapping does not 100% align to the ER model above, as some of the entities are nested under another entity.
:::

For further explaination of the terminologies and fields under each entity, please consult Cofacts Opendata documentation and DB index mapping. Although the fields in opendata and database index does not 100% map to Elasticsearch indexes directly, the relations between entities and the basic meaning of each fields can help understanding each entity in Cofacts system.

Running all components

See Run Cofacts on your own laptop - This tutorial teaches you to deploy the whole Cofacts system in your own laptop.

Note: This is for testing purposes only, do not do this in production!


Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Back to Cofacts Home Page