# Locate the News π
### AI-Powered Spatial Journalism Platform



**Locate the News** is a global news mapping application that transforms traditional news consumption into a spatial experience. By integrating **Natural Language Processing (NLP)** and **Mapbox GL JS**, it visualizes real-time global events, extracts precise locations from text, and analyzes sentiment to highlight crisis zones.
## πΈ Screenshots
Global Sentiment Overview
|
Smart Clustering & HUD
|
Crisis Detection (Red Alert)
|
Detailed News Reading
|
> *The interface features a custom "Glassmorphism" design with 3D interactions.*
## π Features
- πΊοΈ **Interactive Global Map**: High-performance 3D visualization using **Mapbox GL JS**.
- π **NLP-Powered Extraction**: Automatic location and entity (GPE) extraction from news articles using **spaCy**.
- π **Sentiment Analysis**: Real-time sentiment scoring (Crisis π΄, Neutral π΅, Positive π’) using **TextBlob** & **VADER**.
- π§© **Multi-Source Integration**: Aggregates data from **NewsAPI** and RSS feeds (BBC, Euronews, TRT World).
- π **Intelligent Clustering**: Uses `Supercluster` for efficient multi-level zoom visualization.
- β‘ **Smart Caching**: Implements TTL-based caching to optimize API usage.
## π οΈ Technologies
### Backend (The Intelligence)
- **Framework**: FastAPI (Python)
- **NLP & AI**: spaCy (`en_core_web_sm`), TextBlob
- **Data Parsing**: Feedparser (RSS), Requests
- **Geocoding**: Geopy & Custom Caching logic
- **Database**: SQLAlchemy with SQLite
### Frontend (The Visualization)
- **Framework**: React.js
- **Mapping**: Mapbox GL JS, react-map-gl
- **Styling**: Modern CSS with Glassmorphism effects
- **Animations**: Framer Motion
## π Getting Started
### Prerequisites
- Python 3.8+
- Node.js 14+
- A valid [NewsAPI](https://newsapi.org) Key and [Mapbox](https://mapbox.com) Token.
### Quick Start
1. **Backend Setup**:
```bash
cd backend
python -m venv venv
# Windows: venv\Scripts\activate | Mac/Linux: source venv/bin/activate
pip install -r requirements.txt
python -m spacy download en_core_web_sm # Crucial: Downloads the NLP model
# Create a .env file and add: NEWS_API_KEY=your_key
python -m app.main
```
2. **Frontend Setup**:
```bash
cd frontend
npm install
# Create a .env file and add: REACT_APP_MAPBOX_TOKEN=your_token
npm start
```
## π Project Structure
```
LocateTheNews/
βββ backend/ # FastAPI backend
β βββ app/
β β βββ main.py # Application entry point
β β βββ models.py # Database models
β β βββ database.py # DB Connection & Session
β β βββ routers/ # API endpoints (events)
β β βββ services/ # NLP, Sentiment & News Fetching
β βββ requirements.txt
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # Map, HUD, and Article UI components
β β βββ api/ # Axios client & API endpoints
β β βββ styles/ # CSS modules for Glassmorphism
β β βββ App.js # Main Application logic
β βββ package.json
βββ screenshots/ # Project visual assets
βββ docs/ # Technical documentation
βββ data/ # Local data storage (SQLite DB)
βββ docker-compose.yml # Docker orchestration (optional)
βββ README.md
```
## π Context & Credits
This project was developed as a graduation/capstone project for the Computer Engineering Department at MuΔla SΔ±tkΔ± KoΓ§man University.
Developer: Ceyda ArΔ±k
Advisor: DoΓ§. Dr. BarΔ±Ε Ethem SΓΌzek