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.
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
Fetches reviews from mobile apps and stores them in the database.
Each review is analyzed and classified as:
- POSITIVE
- NEGATIVE
- NEUTRAL
Provides sentiment statistics for brands.
Detects common keywords in reviews and feedback.
Allows users to submit feedback about brands directly from the application.
Backend framework: - FastAPI
Database: - PostgreSQL / SQLite (development)
ORM: - SQLAlchemy
NLP: - HuggingFace Transformers (sentiment) - Python keyword extraction
Other tools: - Pydantic - Uvicorn
git clone https://github.com//devOwaka/brand-watch-backend
cd brand-watch-backend
python -m venv venv
Activate it:
Mac/Linux
source venv/bin/activate
Windows
venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload
The API will be available at:
http://127.0.0.1:8000
Swagger UI
http://127.0.0.1:8000/brand/docs
ReDoc
http://127.0.0.1:8000/brand/redoc
POST /scrape
Example request:
{
"query": "Uber",
"num_reviews": 100
}
GET /scrape/analytics/{brand}
Example response:
{
"brand": "uber",
"total_reviews": 120,
"positive": 60,
"negative": 25,
"neutral": 15
}
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"]
}
POST /scrape/compare
{
"brands": ["uber", "bolt"]
}
POST /feedback
{
"brand": "uber",
"name": "John",
"text": "Drivers are often late",
"rating": 2
}
GET /analytics/feedback/{brand}
Example response:
{
"brand": "uber",
"total_feedback": 20,
"top_praises": ["easy", "drivers", "fast"],
"top_complaints": ["cancel", "price", "support"]
}
Reviews
↓
Sentiment Analysis
↓
Database Storage
↓
Analytics + Keyword Extraction
↓
Brand Insights API
- Time-based sentiment trends
- Topic modeling
- AI-generated summaries
- Scheduled scraping jobs
- Frontend analytics dashboard