Notification dropdown example, that loads notifications from server at random intervals. On first page load, Notifications are loaded from the Database, subsequent Notifications are loaded using sockets. Server pushes notifications to Database and to the client using sockets.
Explanation:
Why WebSockets ? Faster and smaller in size than http + suitable for these type of instant data transfer.
Extensive use of JavaScript ES6. Short and Nice. Strictly followed JavaScript style guide by airbnb, enforced the style guide using ESlint configs from elsint-config-airbnb.
Can do the same using other tech stacks, but this is the way I preffered for it to be efficient, production ready and scalable.
View Layer: ReactJs
Server: Nodejs
Database: MongoDB
I have hosted a MongoDb database Instance at mlab.com and configured it for the project, so that you don't have to fiddle with setting up one.
# Go to project root
# Install all dependencies
$ npm install
# or
$ yarn install
# build project
$ npm run build
# Start server
$ npm run server
Open http://localhost:3001/ Done!