Skip to content

AllanOtieno254/Online-Mental-Health-Platform-for-Enhanced-Emotional-Well-Being-and-Self-Reflection

Repository files navigation

🌿 Online-Mental-Health-Platform-for-Enhanced-Emotional-Well-Being-and-Self-Reflection-

A secure, user-focused journaling web application built using Node.js, Express.js, and MongoDB. The platform encourages emotional self-reflection, mood tracking, and self-care, particularly for youth and young adults. This system prioritizes privacy, security, and accessibility.

🌿 user interface outlook

user.interface.mp4

🌿 admin interface outlook:

admin.interface.mp4

πŸ” Project Description

This platform serves as a mental health and journaling system allowing users to log their thoughts, track moods, and reflect on their emotional well-being. It is developed with a focus on data protection, ethical design, and accessibility.


πŸš€ Features

  • πŸ“ Secure personal journaling with date and mood tagging
  • πŸ”’ Role-based dashboard protection (Admin/User)
  • βœ… Consent-based onboarding with Terms & Conditions checkbox
  • πŸͺ  Visualization of journal history and emotional trends (planned)
  • πŸ‘¨β€βš–οΈ Admin control panel to monitor system usage
  • 🧹 Modular backend architecture using MVC
  • 🌐 MongoDB Atlas cloud-based database

βš™οΈ Tech Stack

  • Frontend: HTML, CSS, JavaScript
  • Backend: Node.js, Express.js
  • Database: MongoDB (MongoDB Atlas)
  • Authentication: JWT (JSON Web Tokens), bcrypt
  • Testing: Manual and security checks (Protected routes, Password strength)
  • Dev Tools: MongoDB Compass, Postman, VS Code

🏠 System Architecture

Frontend (Journaling UI) --> Express API Server --> MongoDB Atlas
                             |
                          Middleware (JWT, Auth Checks)
                             |
                          Controllers (Logic Handling)

πŸ“ File Structure

mental-health-reflection-platform/
β”œβ”€β”€ client/              # Frontend UI files
β”œβ”€β”€ server/              # Backend logic
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ middleware/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ config/
β”‚   └── server.js
β”œβ”€β”€ .env
β”œβ”€β”€ .gitignore
β”œβ”€β”€ README.md
β”œβ”€β”€ package.json
└── LICENSE

πŸ› οΈ Setup Instructions

  1. Clone the repository:

    git clone https://github.com/AllanOtieno254/mental-health-reflection-platform.git
    cd mental-health-reflection-platform
  2. Install backend dependencies:

    cd server
    npm install
  3. Add environment variables in .env:

    PORT=5000
    MONGODB_URI=your_mongodb_connection_string
    JWT_SECRET=your_secret_key
  4. Start the server:

    npm start
  5. Access MongoDB Atlas or Compass to monitor your database


πŸ”§ How the System Handles Data

  • Uses MongoDB as a NoSQL database, which is resilient to SQL injection.
  • Passwords are hashed before storage using bcrypt.
  • Protected routes: You cannot access the dashboard without logging in.
  • Strong password policies implemented during signup.
  • Uses Express.js to create API endpoints that communicate securely with MongoDB using the connection URI. Data is visualized via Atlas or Compass.

πŸ” How the Backend Manages User Data

  • Routes folder: Defines route access (e.g., /admin for admin panel).
  • Controllers folder: Contains the logic for user authentication, data manipulation, and journaling.
  • Middleware folder: Protects routes using JWT tokens and role-based logic.
  • Role restriction: If not an admin, you cannot access protected dashboard areas.

πŸ“ˆ Data Privacy & Ethical Considerations

  • All data is stored in a secure cloud-based environment.
  • Only authenticated users can access their journals.
  • JWT tokens ensure secure session validation.
  • Consent required: Users must check a box agreeing to the platform’s terms before proceeding.
  • Clear ethical boundary: Data is not shared with third parties.

πŸ₯ Healthcare Guidelines

  • The system is managed by an admin role.
  • Admins can oversee the journaling environment and ensure healthy practices.
  • Though it is not a clinical tool, it is built with care and privacy in mind, aligning with general mental health tech standards.

πŸ–ΌοΈ Screenshots

User interface

journal dashboard crisis resources community therapist resources mood tracker

Admin interface

admin

πŸ“š Topics Covered

  • Secure user authentication
  • RESTful API design with Express.js
  • MongoDB schema modeling
  • Middleware and route protection
  • Role-based access control
  • Environment configuration (.env)
  • Cloud-based NoSQL database (MongoDB Atlas)
  • Frontend and backend integration
  • Journaling and emotional intelligence
  • Data ethics in mental health platforms

🌱 Future Improvements

  • Sentiment analysis using Natural Language Processing (NLP)
  • Mood graphs and emotional trends using Chart.js or D3.js
  • Counseling chatbot integration
  • Push notifications for journaling reminders
  • Mobile-friendly PWA version
  • More granular role privileges (e.g., Moderators)

πŸ“š License

This project is licensed under the MIT License. Feel free to fork, adapt, and use with attribution.


🌟 Author

Allan Otieno Akumu
Student of Computer Science, Zetech University
GitHub: AllanOtieno254


🌍 GitHub Topics

mental-health
journaling
nodejs
expressjs
mongodb
emotion-tracking
self-care
data-privacy
jwt-auth
secure-app

About

A secure, user-focused journaling web application built using Node.js, Express.js, and MongoDB. The platform encourages emotional self-reflection, mood tracking, and self-care, particularly for youth and young adults. This system prioritizes privacy, security, and accessibility.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages