Mindfulpath: An AI-Enhanced Platform For Mental Wellbeing Using NLP And CBT Principles
DOI:
https://doi.org/10.63665/pv63dm20Keywords:
Mental Wellbeing, NLP, Sentiment Analysis, AFINN, CBT, Crisis Detection, Chatbot, Mood Tracking, Node.js, Express.js, SQLite, JWT, Bootstrap 5, Chart.js, DockerAbstract
The growing global mental health crisis demands accessible, immediate, and stigma-free support mechanisms.
MindfulPath is an AI-enhanced web platform for mental wellbeing that integrates Natural Language Processing
(NLP)-based sentiment analysis with Cognitive Behavioral Therapy (CBT) principles to deliver real-time therapeutic
support. Built on Node.js and Express.js with an SQLite relational database (seven tables), the system employs the
AFINN-165 lexicon through the npm sentiment package for live emotional-state assessment of user messages. The
platform supports three role-based user types — Admin, Therapist, and User — secured via JWT authentication and
bcryptjs password hashing. Core features include an AI CBT chatbot with crisis detection and helpline surfacing,
daily mood journaling with auto-computed sentiment scores visualized as Chart.js line charts, a curated library of ten
guided meditations across six categories, a therapist directory with session booking, and comprehensive role-based
dashboards. Mathematical formulations of the AFINN scoring model, comparative score normalization, CBT
sentiment-to-response mapping, JWT authentication flow, and bcrypt cost function are derived. System architecture,
NLP pipeline flowchart, algorithmic pseudocode, and comparative performance tables are presented alongside results
analysis with bar and line graphs.
Downloads
References
[1] World Health Organization, 'Mental Health Atlas
2021,' WHO, Geneva, 2021.
[2] K. R. Fitzpatrick, A. Darcy, and M. Vierhile,
'Delivering CBT to Young Adults via Woebot: An
RCT,' JMIR Mental Health, vol. 4, no. 2, e19, 2017.
[3] R. A. Calvo et al., 'Natural Language Processing in
Mental Health Applications Using Non-Clinical
Texts,' Natural Language Engineering, vol. 23, no. 5,
pp. 649–685, 2017.
[4] E. G. Lattie et al., 'Digital Mental Health
Interventions for Depression, Anxiety, and
Enhancement of Psychological Well-Being,' JMIR
Mental Health, vol. 6, no. 12, e14168, 2019.
[5] F. A. Nielsen, 'A New ANEW: Evaluation of a
Word List for Sentiment Analysis in Microblogs,'
ESWC 2011 Workshop, vol. 718, pp. 93–98, 2011.
[6] G. Andersson et al., 'Internet-Delivered
Psychological Treatments,' Annual Review of Clinical
Psychology, vol. 10, pp. 157–179, 2014.
[7] D. Bakker et al., 'Mental Health Smartphone Apps:
Review and Evidence-Based Recommendations,'
JMIR Mental Health, vol. 3, no. 1, e7, 2016.
[8] A. T. Beck, 'Cognitive Therapy and the Emotional
Disorders,' International Universities Press, 1976.
[9] C. J. Hutto and E. Gilbert, 'VADER: A
Parsimonious Rule-Based Model for Sentiment
Analysis of Social Media Text,' ICWSM, 2014.
[10] B. Liu, 'Sentiment Analysis and Opinion Mining,'
Morgan & Claypool, Synthesis Lectures in HLT, vol.
5, 2012.
[11] Node.js Foundation, 'Node.js v18
Documentation,' 2024. [Online]. Available:
[12] Express.js, 'Express 4.x API Reference,' 2024.
[Online]. Available: https://expressjs.com/
[13] SQLite Consortium, 'SQLite Write-Ahead
Logging,' 2024. [Online]. Available:
https://www.sqlite.org/wal.html
[14] Auth0, 'Introduction to JSON Web Tokens,' 2024.
[Online]. Available: https://jwt.io/introduction
[15] Chart.js Contributors, 'Chart.js v4
Documentation,' 2024. [Online]. Available:
[16] Docker Inc., 'Docker Documentation,' 2024.
[Online]. Available: https://docs.docker.com/
[17] World Health Organization, 'World Mental
Health Report 2022,' WHO, Geneva, 2022.
