FakeCheck-  Flag a Fake News!

FakeCheck- Flag a Fake News!

·

6 min read

Screenshot_120.png

FakeCheck is an application built towards the goal of identifying the genuniness of the fabricated news that you come across on the internet.

once a piece of potentially fake news is reported using the application, people can use features like user polls, fakeness scores, and open discussions with our community members, which could help better understand the reality of the content!

The problem with false information

Many things you read online, particularly in your social media feeds, may appear to be genuine but are frequently false. False information is news, articles, or hoaxes that are intended to misinform or deceive readers. These tales are typically written to influence people's opinions, push a political agenda, or generate confusion, and they may be a successful business for web publishers. False information can confuse users by impersonating reliable websites or utilizing names and web addresses that are similar to those of respectable news organizations.

Because of the internet and social media, it is now incredibly simple for anybody to publish information on a website, blog, or social media profile and possibly reach massive audiences. Because so many individuals now acquire their news via social networking platforms, numerous content creators/publishers have taken advantage of this.

False information may be a lucrative industry, producing enormous sums of advertising income for publications that develop and distribute viral tales. The more hits a story receives, the more money online publishers get from advertising income, and social media is a great medium for many publishers to disseminate information and increase web traffic.

How do we tackle the issue of false information online

When it comes to combating incorrect information, there has never been a proven strategy. Google and Facebook have announced additional initiatives to combat false news, including the launch of reporting and flagging tools. using community strength to examine content carefully and identify its genuineness.

This is where the fakecheck application can help!. the application helps users to flag fake news by reporting minute information about the post and calculating a fakeness score based on the findings. further, the application provides a poll option to create a public poll related to the news so that this poll can be shared with people using a short URL, so the system can easily gather public opinion and display the results to whoever is in need!

Features of Fakecheck app

Report Fake News

The prime feature of the app is to report a piece of news that the user thinks might be fake!

the app provides a form interface to jot down the basic details of the news like source, URL, date published, etc along with a set of questions like "Does the author have contact info?" or "Are other outlets running the story as well?", the main aim of these questions is to further identify the chances of the news being fake, which also helps the system to calculate a fakeness score for the system!

screencapture-fake-checker-vercel-app-dashboard-report-2022-07-27-12_01_24.png

Fakeness score

After gathering all the info from the user on a piece of news, the apps fakeness score calculating algorithm will determine the fakeness score of the news which in fact tells the user immediately what the probability of the news being fake is, more the score the more the news is likely to be fake!! and every time somebody votes on the news's poll, the fakeness score updates accordingly!

User polls

Another interesting feature of the app is that the reporter of the news has the option to create a poll around the news and share it with the public, and anyone with the poll link can skim through the news details and vote, without even signing up for the web app. is the news fake or not? this will help gather more public opinion for the content!

however the user should be aware of where he is sharing the poll, one should only share the poll with a community of people who are well aware of the content and so give an expert openion!

Search for fake news

The app also features a section for users to search for a piece of news they are looking for and check the fakeness score and poll results for that particular content

Tech Stack

  • Angular v14 - the latest version of angular is used for the front end!
  • tailwindCSS - been loving tailwind, all the styling is handled well by this framework.
  • vercel - for deploying the UI
  • planetscale + prisma - for database

Building Fakecheck

I'm not diving deep into the process of building the whole web app, here are some steps and ideas how it happened

Front End in depth

I was always very much comfortable with Angular, the app is built using the latest angular framework v14, for styling TailwindCSS and its wide array of easily usable classes was used, and a pretty useful UI library called ZigZag that is built with TailwindCSS by Adithya Sreyaj was also used. coming to icons remix icons was a perfect choice.

Back end in depth

Backend is powered by nestjs, it has a lot of similarities, to angular like the concept of modules, the usage of decorators, guards, pipes, etc.

planetscale is used as the database obviously, its a MySQL-compatible serverless database, which comes with a lot of good features that make working with a database a breeze. one of the main features of planetscale is that we can do branching on our database similar to what we do with our code using git.

Prisma is used as the ORM, which connects to our plantescale database, and Prisma works very well with planetscale, and even there is official documentation on both planet scale and Prisma docs on how to set up the connection with Prisma. This makes it very easy for developers to work with databases.

here is how the database scheme looks like

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["referentialIntegrity"]
}

datasource db {
  provider             = "mysql"
  url                  = env("DATABASE_URL")
  referentialIntegrity = "prisma"
}

model User {
  id        String  @id @default(cuid())
  firstName String
  lastName  String?
  email     String  @unique
  password  String?
  image     String?
  news      News[]
  polls     Poll[]
}

model News {
  id                   String   @id @default(cuid())
  heading              String
  url                  String
  image                String?
  news_author          String
  reported_by          User     @relation(fields: [userId], references: [id])
  why_fake             String
  type                 NewsType
  date_of_news         DateTime
  date_reported        DateTime  @default(now())
  fakeness_score       Int @default(0)
  reported_fake_by     Int @default(0)
  reported_not_fake_by Int @default(0)
  poll_results         Poll[]
  other_outlet_running Boolean @default(false)
  author_has_contact   Boolean @default(false)
  read_whole_news       Boolean @default(false)
  userId               String
}

model Poll {
  id                   String   @id @default(cuid())
  news                 News     @relation(fields: [newsId], references: [id])
  newsId               String
  userId               String
  user                 User     @relation(fields: [userId], references: [id])
  reported_fake_by     Int
  reported_not_fake_by Int
  created_at           DateTime @default(now())
  updated_at           DateTime @updatedAt
}

enum NewsType {
  SocialMediaPost
  NewsArticle
}

there are a few tweaks that you have to make in your Prisma scheme file in order to make it work with planetscale

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["referentialIntegrity"]
}

datasource db {
  provider             = "mysql"
  url                  = env("DATABASE_URL")
  referentialIntegrity = "prisma"
}

Reference link

Deployment in depth

Vercel hosts the front-end. The procedure is simple since you can just push the code and see it go live.

For the backend, a Github action pipeline is utilized to generate an API build, which is then compressed and sent to a server.

Future scope

  • Browser fingerprinting - Even when cookies are disabled, fingerprints can be used to completely or partially identify particular users or devices, which could be helpful in the poll feature.
  • Comments and Open Discussions

Code and Demo

Demo - fake-checker.vercel.app

Code - github.com/fenas/fake-checker