As per the Todo list introductory project I first worked on, the project uses Node.js in combination with Express for the web server. The database used is the MongoDB database – and this is currently hosted on Atlas. The frontend uses Bootstrap and custom CSS for styling. The HTML is served up to the frontend via EJS templates with Express. The frontend uses the Axois package for communication to the server over the various routes. The whole application follows the MVC framework of development.
Some of the things learnt in the development of this application include:
- Using Axios for Frontend HTTP asynchronous requests
- CSRF protection
- Building API using JSON Web Tokens for authentication
- Allow CORS for API calls
- Sanitize HTML for User Input (on the Backend)
- DOMPurify used for User Input (on the Frontend – because this is much more lightweight)
- Using “Markdown” language for Posts and other User Input
- Sending emails through the application via SendGrid
- Websockets for LIVE browser updates (ie. Live Chat)
- Webpack – for development, building and bundling of JS (and browser backward compatibility)
- Handling Local Environment info (.env) – not built into the source
- MongoDB database management – including building indexes – both in cloud (Atlas) and local machine (CLI)
- Use of Flash messages for user experience
The development process made use of “nodemon” for monitoring local JS changes and “webpack” for building and bundling JS. Running the local server by simple “npm run watch” command.
This application has a number of cool features and is built to be relatively easy to scale. Here is a list of features:
- Secure User Authentication (using bcrypt) – allowing for Registration and Login
- Create, Modify and Delete Posts
- Markdown support for all Posts created/modified
- LIVE chat with all fellow Users logged in
- Follow other Users (Authors)
- View a list of Posts for a particular User (Author)
- See lists of who is following an Author and who they are following.
- Welcome Email automatically sent to newly registered Author
- Followed email is sent to User (Author) now being followed.
- Clean interface and mobile responsive