# Locate the News 🌍 ### AI-Powered Spatial Journalism Platform ![Status](https://img.shields.io/badge/Status-Prototype-blue) ![Tech](https://img.shields.io/badge/Stack-FastAPI_React_Mapbox-orange) ![License](https://img.shields.io/badge/License-MIT-green) **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

Global Overview

Smart Clustering & HUD

Popup List

Crisis Detection (Red Alert)

Crisis View

Detailed News Reading

Article Detail
> *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