{"id":25767875,"url":"https://github.com/htsandaruvan/text-sentiment-analysis-backend","last_synced_at":"2026-06-10T18:31:14.808Z","repository":{"id":277435572,"uuid":"932409948","full_name":"HTsandaruvan/text-sentiment-analysis-backend","owner":"HTsandaruvan","description":"This is the backend API for the Text Sentiment Analysis project. It handles user authentication, sentiment history storage, and sentiment analysis via a Flask ML API.","archived":false,"fork":false,"pushed_at":"2025-02-15T21:50:07.000Z","size":5683,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T03:29:48.880Z","etag":null,"topics":["analysis","api","data-science","flask","javascript","ml","python"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HTsandaruvan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-13T21:39:04.000Z","updated_at":"2025-02-15T21:50:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"8dd70dcd-0f8d-44a3-a6a7-3744aca599c3","html_url":"https://github.com/HTsandaruvan/text-sentiment-analysis-backend","commit_stats":null,"previous_names":["htsandaruvan/text-sentiment-analysis-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HTsandaruvan/text-sentiment-analysis-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HTsandaruvan%2Ftext-sentiment-analysis-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HTsandaruvan%2Ftext-sentiment-analysis-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HTsandaruvan%2Ftext-sentiment-analysis-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HTsandaruvan%2Ftext-sentiment-analysis-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HTsandaruvan","download_url":"https://codeload.github.com/HTsandaruvan/text-sentiment-analysis-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HTsandaruvan%2Ftext-sentiment-analysis-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34165482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analysis","api","data-science","flask","javascript","ml","python"],"created_at":"2025-02-27T00:41:21.051Z","updated_at":"2026-06-10T18:31:14.804Z","avatar_url":"https://github.com/HTsandaruvan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Text Sentiment Analysis - Backend**\n\nThis is the **backend API** for the **Text Sentiment Analysis** project. It handles **user authentication**, **sentiment history storage**, and **sentiment analysis** via a **Flask ML API**.\n\n---\n\n## **Table of Contents**\n- [Features](#features)\n- [Technologies Used](#technologies-used)\n- [Project Structure](#project-structure)\n- [Setup and Installation](#setup-and-installation)\n- [Steps to Set Up and Run the Project Locally](#steps-to-set-up-and-run-the-project-locally)\n\n---\n\n## **Features**\n✅ User authentication (JWT-based login/signup).  \n✅ Stores user sentiment analysis history.  \n✅ Communicates with a Flask ML API for text analysis.  \n✅ Role-based authentication (Admin/User).  \n✅ Admin can view all users’ sentiment history.  \n✅ Admin can manage users and sentiment anlyzing.\n\n\n---\n\n## **Technologies Used**\n- **Node.js \u0026 Express.js** – Backend framework  \n- **Flask \u0026 Machine Learning (Python)** – Sentiment analysis model  \n- **MongoDB Atlas** – NoSQL cloud database  \n- **Mongoose** – ODM for MongoDB  \n- **JWT (JSON Web Tokens)** – Secure authentication  \n\n---\n\n\n## **Project Structure**\n\n```\ntext-sentiment-analysis-backend/\n│── flask-api/   # (Sentiment analysis model)\n│── src/\n│   ├── config/\n│   ├── controllers/\n│   ├── models/\n│   ├── routes/\n│   ├── utils/\n│   │── app.js\n|   |── server.js\n│── .env\n│── .gitignore\n│── package.json\n\n```\n## **Setup and Installation**\n\n### **Step 1: Clone the Repository**\n\n```sh\ngit clone https://github.com/HTsandaruvan/sentiment-analysis-project.git\ncd sentiment-analysis-backend\n```\n\n### Step 2: Install Dependencies\n\n```sh\nnpm instal\n```\n### Step 3: Set Up Environment Variables\nCreate a .env file inside backend/ and configure it with your details:\n\n```sh\nPORT=5000\nMONGO_URI=mongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@cluster0.mongodb.net/sentiment_db?retryWrites=true\u0026w=majority\nJWT_SECRET=your_jwt_secret\nFLASK_API_URL=http://127.0.0.1:5001/predict\nEMAIL_USER=your-email@gmail.com\nEMAIL_PASS=your-email-password\n\n```\n### Step 4: Set Up MongoDB Atlas\n 1. Create an account on MongoDB Atlas.\n 2. Set up a new cluster and get the connection URI.\n 3. Add your MongoDB connection URI to the .env file.\n\nEnsure Node.js is installed (node -v to check).\n### Step 5: Run the Backend Server\n\n```sh\nnodemon src/server.js\n\n```\n\nThe API will run at http://localhost:5000.\n\n### Step 6: Install and Run Flask API\nEnsure Python is installed (python --version to check).\n\nNavigate to the Flask API folder:\n\n```sh\n\ncd flask-api\n\n```\nCreate a virtual environment:\n\n```sh\npython -m venv venv\n\n```\n\nActivate a virtual environment:\n\n```sh\nsource venv/bin/activate   # On Windows: venv\\Scripts\\activate\n\n```\n\nInstall dependencies:\n\n```sh\npip install -r requirements.txt\n\n```\n\nRun the Flask API:\n\n```sh\npython app.py\n\n```\n\nFlask API should run at http://127.0.0.1:5001.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtsandaruvan%2Ftext-sentiment-analysis-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhtsandaruvan%2Ftext-sentiment-analysis-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtsandaruvan%2Ftext-sentiment-analysis-backend/lists"}