CaptainFact / CaptainFact/captain-fact

Vérifications par sujet

Open
#191 0 comments 4 reactions 0 assignees View on GitHub
backend complexity > complex feature frontend
Dominant language
No language data
Stars
71
Forks
7
PR merge metrics
No merged PRs in 30d

Description

CaptainFact envisage de créer un nouvel outil reprenant les mécanismes du fact-checking collaboratif existants dans l'outil vidéo, mais en centrant les vérifications autour d'un sujet. Un sujet dans le cadre qui nous intéresse peut être définit comme un énoncé simple présentant une idée dans sa forme la plus indivisible à même d'être vérifiée. Exemples de sujets : "Il y a des puces 5G dans les vaccins pour la Covid", "En France, l'insécurité est en hausse".

Chaque sujet pourra être relié à un ou plusieurs liens qui y font référence. On pourra par exemple indiquer qu'un sujet est mentionné sur tel article d'un site d'actualité, ou dans telle vidéo YouTube (en précisant le timecode).

De la même manière que pour les « statements » (affirmations), chaque sujet pourra avoir plusieurs commentaires qui, en fonction de la valeur de `comment.approve`, pourront être des confirmations (`true`), des réfutations (`false`), ou des simples commentaires (`nil`). L'interface utilisera des websockets pour assurer une discussion en temps réel. À la différence de l'outils vidéo, ces websockets seront à implémenter sur l'API GraphQL (et non sur l'API REST).

## Design
- [File](https://www.figma.com/file/Su86XR2ZLUoGII8VBB6Hdz/CaptainFact-sujet?node-id=2%3A3)
- [Prototype](https://www.figma.com/proto/Su86XR2ZLUoGII8VBB6Hdz/CaptainFact-sujet?node-id=2%3A3&scaling=scale-down&page-id=0%3A1)

## Specifications techniques
Pour simplifier l'implémentation, on cherchera autant que possible a ré-utiliser (et mettre en commun) les composants existants. L'utilisation de Redux est à proscrire en faveur du cache Apollo ou de contextes React. Si des composants devant être mis en communs utilisent Redux, il faudra séparer la partie vue de la partie état en créant deux composants.

Les spécifications ci-dessous sont en Anglais pour correspondre à la langue utilisée dans le code.

### [API](https://github.com/CaptainFact/captain-fact-api)
- [ ] Create a new `Topic` schema
- [ ] `text` string
- [ ] `slug` string
- [ ] `speaker_id`
- [ ] Create a new `TopicReference` schema
- [ ] `topic_id`
- [ ] `url`
- [ ] `text` (the exact quote, if available)
- [ ] `type` - enum(WEB, PDF, AUDIO, VIDEO)
- [ ] In `apps/cf/lib/topics/topics.ex`, create a new lib to handle topics
- [ ] `create_topic` (must create the associated user_action & check permissions)
- [ ] `update_topic` (must create the associated user_action & check permissions)
- [ ] Create a new `TopicsIndexer` to synchronize topics with Algolia
- [ ] Tweak `Comments` to make it possible to add them on a `Topic`. This implies looking for and preventing regressions in related code (flagger, notifications, subscriptions, etc.)
- [ ] Expose all the necessary helpers on the GraphQL API (the legacy REST endpoints and websockets are not meant to be used for new developments).
- [ ] `topic` query (get one topic)
- [ ] `topics` query (list all topics)
- [ ] `create_topic` mutation
- [ ] `update_topic` mutations (to submit new links)
- [ ] `create_comment(topic, text, source, direction)` mutation (direction = `CONFIRM|REFUTE`)
- [ ] `comment_added(topic)` subscription field
- [ ] `comment_removed(topic)` subscription field
- [ ] Add unit tests
- [ ] Validations on `Topic` schema
- [ ] All methods from `apps/cf/lib/topics/topics.ex`
- [ ] Add comments to topics
- [ ] GraphQL subscriptions

### [Frontend](https://github.com/CaptainFact/captain-fact-frontend)
- [ ] Add a tab for topics in search results
- [ ] Add a new `Topics` link in the sidebar (links to `/topics`)
- [ ] Implement the page to list latests topics and add new on `/topics`
- [ ] Implement the topic page on `/topics/:topic_slug`
- [ ] Comment updates/removal/addition should be reflected in real time (with GraphQL subscriptions)
- [ ] Must be able to add comments
- [ ] Must be able to add links
- [ ] Page should work when logged out
- [ ] Votes should be updated every ~30s
- [ ] Add Cypress tests for the full flow
- [ ] Search topic
- [ ] Create topic
- [ ] Add comment on topic

### Parts of the design that are **not** required for the initial implementation

- History
- Similar topics

### Tips for implementing

- Permissions are checked with `UserPermissions.check!(user, :action, :entity)`
- In the frontend, you can block an UI element based on permissions/reputation using `ReputationGuardTooltip`

## Context
- [Design](https://www.figma.com/file/Su86XR2ZLUoGII8VBB6Hdz/CaptainFact-sujet?node-id=2%3A3)
- [Forum topic](https://forum.captainfact.io/t/issue-majeure-verification-de-toutes-les-pages-du-web-avec-captainfact/458)
- [Initial discussion](https://github.com/CaptainFact/captain-fact/issues/106)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.