My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMSย for Enterprise.
Upgrade โœจLearn more
Decentralized Social Media Using Ethereum and Netlify

Decentralized Social Media Using Ethereum and Netlify

Are you bored with the centralized social apps and are being banned or targeted for no reason? Here is a Blockchain-based solution for you

Mohit Bhat's photo
Mohit Bhat
ยทFeb 26, 2022ยท

4 min read

Introduction

In the present world, social media has become a very important part of our lives. We share so much content every day ranging from what we are doing in our personal lives to professional information. For some, it's a source of income due to its marketing capabilities and for some, it's a platform to share their content, for some it's a platform to raise their voice, and for some, it's a platform to connect to the world. In fact, some social media platforms have become a political playground also. Many decisions, ideas, events are shared on these platforms, consider the case of twitter many heads of countries share updates on this platform. But with all these things we know social media has a problem due to its centralized nature. we have seen password leaks by twitter users and forceful banning of accounts due to political influence. Also, the advertisers may not know whether the ads they are promoting are not influenced by these companies. All these things force us to adopt decentralization and this project has tried to implement that.

Platform Overview

The platform is a decentralized social media something similar to twitter but totally in a decentralized way having no server. The platform is having a smart contract (built using solidity)containing all the important logic and is deployed on Ethereum Blockchain. Some of the features of the platform are:

  • Secure and user-friendly login using metamask wallet
  • Only your Public address is the key to access the platform
  • Cool user profile same as Twitter
  • Easy use interface
  • Commenting feature on dweets
  • Reporting feature on dweets
    • Once a dweet get a specified no of reports it will be sent to maintainers for action
    • You will have to stake some ethers for reporting
    • If the dweet is banned by maintainers you will get a refund and a reward
    • If the dweet is not Banned by maintainers you will get no refund and the staked amount will go to the reported dweet author
  • Like feature on dweets
  • You can upload advertisements(image and a link) and reach out to platform users at a nominal cost
    • Advertisements once submitted will be sent to maintainers for acceptance -If it is rejected then 80% amount will be refunded
  • Maintainers can be added to the platform
  • A dedicated maintainer page where you can give acceptance and ban dweets(only If it gets required reports)

Tech stack Used

  • Ethereum
  • IPFS
  • Web3js
  • HTML
  • CSS
  • Bootstrap
  • Javascript
  • Jquery
  • Truffle
  • netlify

Implementation

Now let's deep dive into how this is made.

The Frontend:

The tech stack used to make frontend is simple HTML, CSS, javascript, and node as this application is serverless and lite so no need for heavy tech stack.

The Blockchain:

The Blockchain used is ethereum and IPFS Network along with wallet support of metamask. I have used Jquery to connect all the aspects of the app with the frontend and web3js and ethereum to connect it with blockchain.

The Dweets are stored on Ethereum smart contract and the images and other big data are stored on IPFS(InterPlanetary File Storage) which is a decentralized file storage system. Ipfs returns as a hash of the data uploaded and that is what is linked in the smart contract to avoid the large gas cost.

The dweets are fetched directly from blockchain and events are used to increase the loading speed. I will not go deep into the solidity or blockchain logic part as it would take two-three blogs to explain that but you can view the solidity logic in the repo given at end.

Netlify

Netlify is used at many places like hosting and some server less functions. For a application which is mostly decentralised and just needs frontend hosting, netlify played a great role me

I just Loved the Netlify as it provides so much ease to configure and deploy things for which we usually waste a lot of time

Future Work

  • Use Meta transactions(gasless transactions) to make the platform gas-free for users
  • Add more Features like follow, profile view, etc
  • Add video Advertisement options(Integrate Voting rights)
  • Add reporting on comments
  • Aws Amplify Text to speech and AWS Sentiment Analysis for better management
  • Aws Object and Image Detection to track explicit or wrong images
  • Aws analytics to track platform
  • Aws push notifications for real-time dweet updates

Project Demo

Website ๐Ÿ‘‰ https://dwittermedia.netlify.app/

Project Repo

Repo ๐Ÿ‘‰ https://github.com/mbcse/netlify

Here Is a short video