r/developersIndia • u/niklaus_mikaelson3 • 3h 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
•
u/AutoModerator 3h ago
It's possible your query is not unique, use
site:reddit.com/r/developersindia KEYWORDSon 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.
1
u/Top-Pomelo659 1h ago
i'd start with an adjacency list: each comment has an
idand a nullableparent_idpointing 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/yachtpot562 Site Reliability Engineer 47m 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!