Skip to content

devOwaka/brand-watch-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

BrandWatch Backend

BrandWatch is a FastAPI backend service that collects, analyzes, and generates insights from brand reviews and user feedback.

The system performs:

  • Review scraping
  • Sentiment analysis
  • Keyword extraction
  • Brand analytics
  • Feedback insights

The goal is to transform raw reviews into actionable brand intelligence.

Project Structure

brandwatch/
│
├── app/
│   ├── main.py
│   ├── database.py
│   ├── models.py
│   ├── schemas.py
│
│   ├── routes/
│   │    ├── scraping.py
│   │    └── feedback.py
│
│   └── services/
│        ├── scraper.py
│        ├── sentiment.py
│        ├── analytics.py
│        └── text_insights.py
│
├── requirements.txt
└── README.md

Features

Review Scraping

Fetches reviews from mobile apps and stores them in the database.

Sentiment Analysis

Each review is analyzed and classified as:

  • POSITIVE
  • NEGATIVE
  • NEUTRAL

Brand Analytics

Provides sentiment statistics for brands.

Keyword Extraction

Detects common keywords in reviews and feedback.

User Feedback

Allows users to submit feedback about brands directly from the application.

Tech Stack

Backend framework: - FastAPI

Database: - PostgreSQL / SQLite (development)

ORM: - SQLAlchemy

NLP: - HuggingFace Transformers (sentiment) - Python keyword extraction

Other tools: - Pydantic - Uvicorn

Setup Instructions

1 Clone the repository

git clone https://github.com//devOwaka/brand-watch-backend
cd brand-watch-backend

2 Create a virtual environment

python -m venv venv

Activate it:

Mac/Linux

source venv/bin/activate

Windows

venv\Scripts\activate

3 Install dependencies

pip install -r requirements.txt

4 Run the server

uvicorn app.main:app --reload

The API will be available at:

http://127.0.0.1:8000

API Documentation

Swagger UI

http://127.0.0.1:8000/brand/docs

ReDoc

http://127.0.0.1:8000/brand/redoc

Key Endpoints

Scrape Reviews

POST /scrape

Example request:

{
  "query": "Uber",
  "num_reviews": 100
}

Brand Analytics

GET /scrape/analytics/{brand}

Example response:

{
  "brand": "uber",
  "total_reviews": 120,
  "positive": 60,
  "negative": 25,
  "neutral": 15
}

Brand Insights

GET /scrape/insights/{brand}

Example response:

{
  "brand": "uber",
  "total_reviews": 120,
  "top_praises": ["fast", "easy", "drivers"],
  "top_complaints": ["cancel", "price", "support"],
  "common_keywords": ["driver", "ride", "app"]
}

Compare Brands

POST /scrape/compare

{
  "brands": ["uber", "bolt"]
}

Submit Feedback

POST /feedback

{
  "brand": "uber",
  "name": "John",
  "text": "Drivers are often late",
  "rating": 2
}

Feedback Insights

GET /analytics/feedback/{brand}

Example response:

{
  "brand": "uber",
  "total_feedback": 20,
  "top_praises": ["easy", "drivers", "fast"],
  "top_complaints": ["cancel", "price", "support"]
}

Data Pipeline

Reviews
   ↓
Sentiment Analysis
   ↓
Database Storage
   ↓
Analytics + Keyword Extraction
   ↓
Brand Insights API

Future Improvements

  • Time-based sentiment trends
  • Topic modeling
  • AI-generated summaries
  • Scheduled scraping jobs
  • Frontend analytics dashboard

Releases

No releases published

Packages

 
 
 

Contributors