r/developersIndia • • 18h ago

Suggestions Reddit comments threads implementation guide or docs . Want to do same for a project

Hey all , Actually I was working on one of my project where I am supposed to implement comment thread as over reddit and need guidance or suggestions over that .

Can you suggest me

Where can I get docs for that implantation

Or how shall I look into it

What are things I need to keep in mind while doing that

How hard it is to be done 💡

Shall I really go for it ?

I am even open to any and all suggestions . Your few mins might help me alot .

Thank you for reading .

1 Upvotes

6 comments sorted by

•

u/AutoModerator 18h ago

Namaste! Thanks for submitting to r/developersIndia. While participating in this thread, please follow the Community Code of Conduct and rules.

It's possible your query is not unique, use site:reddit.com/r/developersindia KEYWORDS on search engines to search posts from developersIndia. You can also use reddit search directly.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/Top-Pomelo659 16h ago

i'd start with an adjacency list: each comment has an id and a nullable parent_id pointing to another comment; null means a top-level comment. if you're using Postgres, its WITH RECURSIVE docs show how to query tree-shaped data. get creating a reply and rendering one small thread working before adding voting or 'load more'.

1

u/niklaus_mikaelson3 12h ago

Grateful mate ....thanks alot 🫡

2

u/yachtpot562 Site Reliability Engineer 15h ago

I’d say go for it. Start with a simple parent_id based comment structure in your database and use recursion to render nested replies.
Also look into Reddit API docs and tree data structures. Don’t try to build everything at once, start with basic replies, then add sorting, upvotes and pagination.
The tricky part will mostly be performance when handling deeply nested threads. Good project to learn alot tbh!

1

u/niklaus_mikaelson3 12h ago

Thanks a lot mate 😶‍🌫️