An implementation of a comment section design provided by frontendmentor.
- Built with node.js.
- Hosted on Hostinger. The project uses the KVM1 hosting solution, where the code is deployed using pm2. MySql is used as the database technology.
- The design used is the interactive-comments-section challenge from frontendmentor.
- I used sass and Google Fonts for styling.
- The upvotes functionality.
- The replies at the moment are normal comments with a span containing @[username] referencing the replied to comment. Ideally they would be placed under the comment that is being replied to and indented a bit.
- On my phone the website does not load correctly. svg icons don't get loaded and logging in causes the css to not get loaded. I could not replicate this on my friend's iphone or on https://appetize.io/.
- Handling niche situations such as: Deleting a comment that has replies pointing to it.
- Validate inputs server side. Currently they're only validated client-side. At the least guard against SQL injection.
- Refactoring the code to use a modern frontend framework such as React for client-side rendering instead of rendering server-side with handlebars.
Refactoring the backend-side to use a framework such as express or fastify instead of the http node module.
Run the command node server.js
in the root of this repo to start the server.
Platform: Windows
I'm using MySQL Community Server - GPL, version 8.0.36.
server.js will assume this computer has a MySql server running for user = "root" with password = "qweasd123" on localhost:3306.
These details can be changed in db_config.json.
If you're on windows, download the installer from: https://dev.mysql.com/downloads/installer/ and follow the instructions provided.