Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cameron-michie/live-comments

Repository files navigation

Live Comments

This is a Next.js app for live comments built to showcase Ably LiveSync's MongoDB connector. The system is simple: in order to leave comments, replies and reaction, a request is made to MongoDB. Ably LiveSync utilises MongoDB Change Streams to listen to database changes within MongoDb and sends messages over Ably to a destination channel.

Getting Started

First we need to set-up the MongoDB server. To do this, either create an account at MongoDB's website or follow the instructions in this terraform docs page. You should create a collection called comments and ably. You should ensure the the Network Access is set up to recieve on all IPs (0.0.0.0/0) and that a role and user has been created that satisfies these database permissions for LiveSync.

Secondly, we should set up the Ably LiveSync MongoDB rule. You can use this via the Control API, or through the Ably dashboard. The 'pipeline' setting is in the ably_pipeline.json file.

To run the development server:

npm install
npm run dev

Open http://localhost:3000 with your browser to see the result.

Features

  • Add comments
  • Reply to comments (one layer of nested replies)
  • React to comments and replies with emojis

License

This project is licensed under the MIT License.

About

This is a demonstration of a live collaborative comment board using Ably LiveSync MongoDB connector.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published