Skip to content

MindSpace is a comprehensive mental wellness platform designed to analyze user sentiment through social media. The application uses machine learning to detect mental health indicators and provides users with detailed history, graphical insights, and data-driven feedback to help monitor their emotional well-being.

Notifications You must be signed in to change notification settings

SanjayMarathi/MindSpace

Repository files navigation

📸 Screenshots


1️⃣ Home Page — Start New Analysis

Users land on the main interface and choose to start a new analysis.


2️⃣ Platform Selection Modal

User selects the platform: Reddit, Instagram, or Twitter/X.


3️⃣ Enter Username / Profile URL

User inputs a public profile ID for analysis.


4️⃣ Login Page (Optional)

Optional login for storing analysis history.


5️⃣ Register Page

Simple registration form for account creation.


6️⃣Graph Insights — Sentiment & Abnormality Trends

Visual trends over time for abnormality and negative sentiment.


7️⃣ Per‑Post Detailed Sentiment & Abnormality Breakdown

Each scraped post includes sentiment scores and abnormality probability.


8️⃣ Dark Theme

Full analysis summary showing verdict, average sentiment, abnormality %, and graphs.


9️⃣ Analysis History Page

List of all previous analyses with quick metrics and PDF download links.


🔟 Generated PDF Report Preview

Professional PDF generated summarizing the analysis with charts.


MindSpace

MindSpace is a full‑stack web application that analyzes public social media posts for abnormality (risk) indicators and sentiment. It uses a dual‑engine approach (custom Naïve Bayes abnormality model + NLTK VADER sentiment scores) to produce interactive charts, per‑post breakdowns, and downloadable PDF reports. Registered users can save and revisit analysis history.


✅ Key Features

Platform & Scraping

• Reddit, Instagram, Twitter/X scraping (public posts)  
• Platform selector modal for quick analysis

Analysis & ML

• Custom Naïve Bayes abnormality model (model_nb.pkl)  
• VADER sentiment (neg/pos/neu)  
• Per‑post probability + sentiment tags

UI & Reports

• Interactive time series & bar charts  
• Per‑post cards with sentiment chips  
• Downloadable, printable PDF reports  
• Light + Dark UI themes

User & History

• Registration & login  
• Saved analyses with thumbnails and PDF links  
• Timestamps and platform metadata

💻 Tech Stack

Frontend: HTML, Bootstrap, JS (charts via Chart.js / Matplotlib for PDFs)  
Backend: Python (Flask)  
ML: scikit‑learn (Naïve Bayes), NLTK VADER  
DB: PostgreSQL / SQLite  
PDF: Matplotlib + ReportLab  
Scraping: AsyncPRAW, Apify, Playwright (where applicable)

⚙️ Setup & Quick Start

git clone https://github.com/SanjayMarathi/MindSpace.git
cd MindSpace
python -m venv venv
# activate venv
source venv/bin/activate  # mac/linux
# or .\venv\Scripts\activate  # windows
pip install -r requirements.txt
python app.py  # or `flask run` depending on entrypoint

Environment: create a .env with keys for any third‑party scraping services and DB connection string.


🧭 Usage

  1. Open the app in a browser.
  2. Click Start New Analysis → choose platform → enter a public username/profile URL.
  3. Wait for scraping and model processing — results page shows charts, per‑post cards and a PDF export button.
  4. Register / log in to save the analysis to your history.

Example analysis URL:

http://127.0.0.1:5000/analyze?platform=reddit&user=example_user

📁 Project Structure

MindSpace/
├── app.py
├── requirements.txt
├── models/
│   └── model_nb.pkl
├── static/
├── templates/
│   ├── index.html
│   ├── results.html
│   ├── history.html
│   └── report_pdf.html
├── scrapers/
│   ├── reddit_scraper.py
│   ├── instagram_scraper.py
│   └── twitter_scraper.py
└── utils/
    ├── pdf_utils.py
    └── viz_utils.py

📝 Developer Notes

  • Keep screenshots in outputs/ for README rendering on GitHub.
  • Place ML model files in models/ and load them from the analysis pipeline.
  • When deploying, ensure Matplotlib fonts are available to avoid PDF rendering issues.
  • Respect platform scraping policies and rate limits — use official APIs where required.

🧑‍💻 Author

Sanjay Marathi
GitHub: https://github.com/SanjayMarathi

About

MindSpace is a comprehensive mental wellness platform designed to analyze user sentiment through social media. The application uses machine learning to detect mental health indicators and provides users with detailed history, graphical insights, and data-driven feedback to help monitor their emotional well-being.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published