Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 76 additions & 118 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,136 +1,76 @@
# SentiLog AI
# 🧠 SentiLog AI

[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/openml-stack/SentiLog-AI/pulls)
[![Build Status](https://img.shields.io/github/actions/workflow/status/openml-stack/SentiLog-AI/ci.yml?branch=main)](https://github.com/openml-stack/SentiLog-AI/actions)
[![Open Issues](https://img.shields.io/github/issues/your-org/SentiLog-AI)](https://github.com/openml-stack/SentiLog-AI/issues)
[![Open Issues](https://img.shields.io/github/issues/openml-stack/SentiLog-AI)](https://github.com/openml-stack/SentiLog-AI/issues)

---

## 🧠 What is SentiLog AI?
## 🌟 Overview

SentiLog AI is an open-source platform that combines news sentiment analysis and personal mood journaling. It features a modern React frontend, a robust Node.js/Express backend, and a Python/Flask microservice for ML-powered sentiment/emotion analysis.
**SentiLog AI** is a full-stack application that blends real-time news sentiment analysis with personal mood journaling. It helps users track their emotions and detect news bias using machine learning.

---

## 🌟 Core Features
## 🔧 Tech Stack

SentiLog AI provides a unique fusion of sentiment-aware news analysis and personal mental wellness tracking through the following key features:

### 📰 Real-Time News Bias Filter

- Automatically analyzes current news articles and classifies them based on political bias: Left, Right, or Neutral.
- Helps users recognize media bias and form balanced opinions.
- Uses Natural Language Processing (NLP) models to assess sentiment and ideological leaning in real-time.

### 📓 Daily Mood Journal

- Users can write daily journal entries about their thoughts or experiences.
- The system performs sentiment and emotion analysis (e.g., happy, sad, anxious).
- Helps users track their mental state over time, identifying patterns or triggers.
- Journal data can be cross-referenced with consumed news to understand the impact of external events on personal emotions.
| Layer | Technology |
|-------------|-------------------------------|
| Frontend | React, Vite, Tailwind CSS |
| Backend | Node.js, Express, MongoDB |
| ML API | Python, Flask, VaderSentiment |
| Auth | JWT-based Authentication |
| DB | MongoDB Atlas (via Mongoose) |

---

## 📁 Project Structure
## 🗂️ Architecture

```
project-root/
├── client/
| ├── index.html/
| ├── public/
│ └── src/ # React frontend (Vite + Tailwind)
│ ├── pages/ # JournalPage, NewsPage, Dashboard
│ ├── components/ # Navbar, SentimentCard, ChartPanel
│ ├── App.jsx
│ └── main.jsx
├── server/ # Node.js + Express backend
│ ├── routes/ # journal.js, news.js
│ ├── controllers/
| ├── middlewares/ # Express entry
| ├── uploads/
| ├── utils/
│ ├── models/ # Mongo schemas
│ └── index.js
├── ml-api/ # Flask-based ML service
│ ├── app.py
│ ├── model/
| ├── vader_service.py/
│ └── requirements.txt
|
├── notebook/
| ├── varder_sentiment_demo.ipynb
├── .gitignore
├── README.md
└── package.json / envs
```mermaid
graph LR
A[React Frontend] --> B[Node.js/Express API]
B --> C[MongoDB]
B --> D[Flask ML API]
D --> E[Sentiment Analysis]
```

---

## 🚀 Quick Start
## 🚀 Getting Started

### 1. Clone the Repository

```bash
git clone https://github.com/your-org/SentiLog-AI.git
git clone https://github.com/openml-stack/SentiLog-AI.git
cd SentiLog-AI
```

---

### 2. Setup the Frontend (client/)
### 2. Install & Run Client

```bash
cd client
npm install
npm run dev
```

- Built with [Vite](https://vitejs.dev/) + [React](https://react.dev/) + [Tailwind CSS](https://tailwindcss.com/)
- Main routes: `/journal`, `/news`, `/dashboard`
- Placeholder components: `Navbar`, `TextInput`, `SentimentCard`, `LineChart`

---

### 3. Setup the Backend (server/)
### 3. Install & Run Server

```bash
cd ../server
npm install
cp .env.example .env
# Fill your MongoDB URI and other secrets in .env
npm run dev
```

- [Express.js](https://expressjs.com/) API server
- Connects to MongoDB (see `.env.example`)
- Routes:
- `POST /api/journal/analyze` → calls ML API
- `POST /api/news/analyze` → calls ML API
- Uses [Mongoose](https://mongoosejs.com/) for MongoDB schemas

---

---

### 📘 API Documentation (Swagger)

Once your backend server is running, you can explore all API endpoints using **Swagger UI**:

[https://sentilog-ai.onrender.com/api-docs](https://sentilog-ai.onrender.com/api-docs)

This interactive documentation provides:

- Available endpoints and HTTP methods
- Required parameters and request formats
- Sample requests and responses
- Error status codes

> **Note:** If your server runs on a different port, update the URL accordingly (e.g., `http://localhost:3000/api-docs`).

### 4. Setup the ML API (ml-api/)
### 4. Install & Run ML API

```bash
cd ../ml-api
Expand All @@ -140,64 +80,82 @@ pip install -r requirements.txt
python app.py
```

- [Flask](https://flask.palletsprojects.com/) microservice
- `/predict` POST endpoint: accepts `{"text": "..."}` and returns mock sentiment/emotion

---

### 5. Environment Variables
## 🌍 Environment Variables

- Copy `.env.example` in `server/` to `.env` and fill in your MongoDB URI and other secrets.
Update `.env` in `server/` folder with:

```
PORT=8080
MONGODB_URI=mongodb://localhost:27017/sentilog
ML_API_URL=http://localhost:8060
JWT_SECRET=your_secret_key
```

---

## 🧩 Contributing
## 📄 API Documentation

1. Comment on the issue you want to work on (frontend, ml-api, express route, schema)
2. Fork the repo & clone locally
3. Work in the corresponding subfolder
4. Open a PR with the title: `[Feature]: <Your Component or Route>`
You can find detailed API information in [server/API_DOC.md](server/API_DOC.md), including:

---
- All Server and ML API endpoints
- Request/response formats
- Sample payloads
- Status codes & error handling

## 📦 Tech Stack
Additionally, the Swagger documentation is available at:

- **Frontend:** React, Vite, Tailwind CSS
- **Backend:** Node.js, Express, MongoDB, Mongoose
- **ML API:** Python, Flask, transformers, vaderSentiment
```text
http://localhost:8080/api-docs
```

---

## 📝 License
## ✨ Features

This project is licensed under the **MIT License** — see the [LICENSE](./LICENSE) file for details.
### 📰 News Bias Filter
- Classifies articles as Left, Right, or Neutral.
- Real-time NLP-based sentiment + ideological analysis.

The MIT License is a permissive license that allows you to:
### 📓 Mood Journal
- Users log their mood and track emotional trends.
- Analyzed using ML-based sentiment/emotion scoring.

- Freely use, copy, modify, and distribute the code.
- Use the project in commercial and non-commercial applications.
- Attribute the original creator(s) in any reused version.
---

By contributing to this repository, you agree that your contributions will be licensed under the MIT License as well.
## 📁 Project Structure

```
SentiLog-AI/
├── client/ # Frontend (React)
├── server/ # Backend (Express + MongoDB)
├── ml-api/ # Python Flask ML service
├── notebook/ # Research notebooks
├── README.md
└── server/API_DOC.md # Detailed API docs
```

---

## 🙌 Community
## 🧩 Contributing

- [Open Issues](https://github.com/openml-stack/SentiLog-AI/issues)
- [Pull Requests](https://github.com/openml-stack/SentiLog-AI/pulls)
1. Comment on an open issue.
2. Fork the repository.
3. Work in a feature branch.
4. Open a pull request with descriptive title.

---

## 📄 Acknowledgements
## 📝 License

- [Vite](https://vitejs.dev/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Flask](https://flask.palletsprojects.com/)
- [transformers](https://huggingface.co/transformers/)
- [vaderSentiment](https://github.com/cjhutto/vaderSentiment)
MIT License — see [LICENSE](./LICENSE)

---

> _Let’s build the future of mood and news analysis together — one contribution at a time! _
## 🙌 Community & Support

- [Issues](https://github.com/openml-stack/SentiLog-AI/issues)
- [Discussions](https://github.com/openml-stack/SentiLog-AI/discussions)

> Let’s build the future of sentiment + media intelligence together.
Loading