I actually started a simple HN-like site in python+Django two weeks ago because I was bored, which you can study and use/modify since it's free software:
At minimum you probably need HTML, CSS, SQL and a back-end language (which could be anything). One of the hardest parts is the nested comments. Building the moderation system may be a large task. Here's my ongoing attempt:
https://sic.nessuent.xyz/
https://sic.nessuent.xyz/about/
https://github.com/epilys/sic/