Eduvest - Journal of Universal Studies
Vol. 6 No. 9 (2026): Eduvest - Journal of Universal Studies

Implementation of a Real-Time Chat System Based on the MERN Stack and Socket.io with Natural Language Processing Integration for Automatic Sentiment Analysis

Tirta Patria Nandhika (Universitas Kristen Satya Wacana)
Adi Nugroho (Universitas Kristen Satya Wacana)



Article Info

Publish Date
23 Sep 2026

Abstract

Digital communication through chat platforms has become a primary medium for consultation services; however, the absence of non-verbal cues makes early detection of users’ emotional states challenging. This study implemented a real-time chat system based on the MERN Stack (MongoDB, Express.js, React.js, and Node.js) integrated with a lexicon-based Natural Language Processing (NLP) module to automatically detect message sentiment and risk levels. The system utilized Socket.io for bidirectional communication, with the NLP module positioned within the Controller layer and executed inline in the sendMessage event handler without requiring external services or message queues. Functional testing of the analyzeText() function across ten scenarios showed that all risk-level classifications matched the expected results. Sentiment classification achieved 80% accuracy, with two misclassifications attributed to the inherent limitations of lexicon-based matching in handling negation and substring ambiguity. All eleven Socket.io communication scenarios and seven REST API endpoints successfully passed testing. The MVC pattern within the MERN Stack demonstrated sufficient flexibility to accommodate an inline NLP module without requiring modifications to the Model or View layers. Furthermore, the tiered priority logic, which placed risky-word detection above sentiment scoring, maintained system reliability in critical cases despite occasional sentiment classification errors.

Copyrights © 2026






Journal Info

Abbrev

edv

Publisher

Subject

Aerospace Engineering Computer Science & IT Health Professions Neuroscience Social Sciences

Description

Eduvest - Journal of Universal Studies is a double blind peer-reviewed academic journal and open access to multidiciplinary fields. The journal is published monthly by Green Publisher Indonesia. Eduvest - Journal of Universal Studies provides a means for sustained discussion of relevant issues that ...