---
# System prepended metadata

title: 【Cofacts 真的假的】Homepage for Developers
tags: [cofacts]

---

---
langs: en
tags: cofacts
GA: UA-98468513-3
---

【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`).

[<img src="https://docs.google.com/drawings/d/1VfooYFnEb_mVx9Yso_u9evYD-nq-Y-mDSwsIlg7oDlw/pub?w=846&amp;h=467">](https://docs.google.com/drawings/d/1VfooYFnEb_mVx9Yso_u9evYD-nq-Y-mDSwsIlg7oDlw/edit)

### 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

:link:  **Issues** - https://github.com/cofacts/rumors-site/labels/good%20first%20issue

:computer: **Tech stack** - Next.js (React.js)

### rumors-line-bot

> The line bot server behind ["Cofacts 真的假的 - 轉傳查證"](https://line.me/R/ti/p/%40cofacts).

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

:link:  **Issues** - https://github.com/cofacts/rumors-line-bot/labels/good%20first%20issue

:computer: **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

:link: **Issues** - https://github.com/cofacts/rumors-api/labels/good%20first%20issue

:computer: **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

:link:  **Issues** - https://github.com/cofacts/url-resolver/issues

:computer: **Tech stack** - Node.js, [Puppeteer](https://pptr.dev/), APIs (Youtube API), [readability](https://github.com/mozilla/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

:link:  **Issues** - https://github.com/cofacts/rumors-db/labels/help%20wanted

:computer: **Tech stack** - Node.js, Elasticsearch

## The ER Model

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

{%hackmd r10mCcceRy2fqq0C5__Sww %}

:::WARNING
Due to non-relational nature of ElasticSearch, the [actual DB mapping](https://g0v.hackmd.io/@mrorz/S1caurZq8) does not 100% align to the ER model above, as some of the entities are [nested](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html) under another entity.
:::

For further explaination of the terminologies and fields under each entity, please consult [Cofacts Opendata documentation](https://github.com/cofacts/opendata#fields) and [DB index mapping](https://github.com/cofacts/rumors-db/tree/master/schema). 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](https://g0v.hackmd.io/s/SJ1f6uU5X) - 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!


* * *

:::info
:arrow_left: Back to [Cofacts Home Page](http://beta.hackfoldr.org/cofacts)
:::