Skip to content

Reaper-ai/FlashPoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

68 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โšก FlashPoint v2.0: Real-Time Geopolitical Intelligence Platform

โšก FlashPoint: Real-Time Geopolitical Intelligence Platform

"While other AI models tell you what happened yesterday, FlashPoint tells you what is happening right now."

"While other AI models tell you what happened yesterday, FlashPoint tells you what is happening right now."

FlashPoint is a production-ready intelligence aggregation and analysis platform that ingests data from 50+ sources in real-time, performs semantic analysis, and provides RAG-powered insights through an interactive dashboard.

Watch Demo



๐Ÿšจ The Problem: The "Knowledge Cutoff" in Crisis

๐ŸŽฏ What It Does

Decision-makers (Governments, NGOs, Logistics) face a critical gap during rapidly evolving crises:

FlashPoint solves the "Knowledge Cutoff" problem in crisis intelligence:

  1. News Lags: Mainstream media takes 30-60 minutes to verify and publish.
  • ๐Ÿ“ก Real-Time Ingestion: Monitors 25 Telegram channels, 10 Reddit communities, 18 RSS feeds, and news APIs2. AI Hallucinates: Standard LLMs have a knowledge cutoff or rely on slow browsing tools.

  • ๐Ÿง  Semantic Analysis: Generates embeddings and stores in Qdrant vector database for intelligent retrieval3. Noise Overload: Human analysts cannot manually filter thousands of Telegram messages per minute.

  • ๐Ÿค– RAG-Powered Chat: Ask questions about current events with LangChain + OpenRouter LLM

  • ๐Ÿ“Š Visual Dashboard: Live feed with Leaflet map, commodity prices, conflict tracking---

  • ๐Ÿ“„ Auto-Reports: Generate intelligence SITREPs with one click (Markdown + PDF)

๐Ÿ›ก๏ธ The Solution: FlashPoint


FlashPoint is a Live RAG (Retrieval Augmented Generation) engine that listens to the raw pulse of the world โ€” Telegram channels, Reddit threads, and News Wires โ€” in real-time.

โšก Quick Start

It uses Pathway to ingest, embed, and index streaming data instantly, allowing an AI LLM to answer strategic questions based on events that happened seconds ago.

Prerequisites

  • Docker & Docker ComposeThe backend is a FastAPI service that serves both the REST API and a fully static HTML/CSS/JS dashboard โ€” no separate frontend server needed. The Pathway engine runs as a parallel process, continuously updating the RAG context and pushing events over SSE.

  • Python 3.11+

  • OpenRouter API key (free tier works)---

  • Telegram API credentials (for Telegram sources)

โœจ Key Features

1. Clone & Configure

  • ๐Ÿ“ก Multi-Source Intel โ€” Aggregates live data from Telegram (raw speed), Reddit (human intel), GNews and RSS feeds (verified reporting).

git clone https://github.com/Reaper-ai/FlashPoint.git- **๐Ÿ“ Live Geopolitical Hotspot Map** โ€” spaCy NER auto-extracts locations from text; map markers scale **proportionally** to how frequently a location is mentioned.

cd FlashPoint- **๐Ÿ”ด Real-Time SSE Feed** โ€” New events are pushed to the browser instantly via Server-Sent Events; newest item animates to the top of the live feed.

- **๐Ÿค– Streaming AI Chat** โ€” Ask the AI anything; it responds token-by-token with a live typing effect, grounded in the most recent 20 feed events.

# Copy environment template- **๐Ÿ“„ Automated SITREP Reports (PDF)** โ€” Gemini generates structured intelligence briefs downloadable as PDF directly from the browser.

cp .env.example .env- **โšก Zero-DB Architecture** โ€” No vector database to manage. Pathway handles streaming embedding and retrieval entirely in-memory.



# Edit .env with your credentials---

nano .env

```## ๐Ÿ—๏ธ Architecture



### 2. Start Infrastructure```

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”

```bashโ”‚                   Data Sources                          โ”‚

# Start PostgreSQL, Redis, Qdrantโ”‚  Telegram ยท Reddit ยท GNews API ยท RSS Feeds ยท Simulation โ”‚

docker-compose up -dโ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

                    โ”‚  pw.io.python.read()

# Verify services are healthy                    โ–ผ

docker-compose psโ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”

```โ”‚              Pathway Streaming Engine  (pipeline.py)    โ”‚

โ”‚  SentenceTransformerEmbedder โ†’ DocumentStore (KNN)      โ”‚

### 3. Install Dependenciesโ”‚  โ†’ query_service  (port 8011, OpenRouter/Gemini)        โ”‚

โ”‚  โ†’ stream_writer  (POST /v1/stream โ†’ FastAPI)           โ”‚

```bashโ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

python -m venv .venv                    โ”‚  HTTP POST /v1/stream

source .venv/bin/activate  # Windows: .venv\Scripts\activate                    โ–ผ

pip install -r requirements.txtโ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”

```โ”‚            FastAPI Server  (api.py, port 8000)          โ”‚

โ”‚  geo_extractor  โ€” spaCy NER + Nominatim geocoding       โ”‚

### 4. Initialize Databaseโ”‚  report_service โ€” Gemini SITREP generation              โ”‚

โ”‚  SSE broadcast  โ€” asyncio.Queue fan-out to browsers     โ”‚

```bashโ”‚  StaticFiles    โ€” serves frontend/web/ at "/"           โ”‚

python backend/init_infra.pyโ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

```                    โ”‚  SSE / REST / Static files

                    โ–ผ

### 5. Launch FlashPointโ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”

โ”‚         Browser Dashboard  (frontend/web/)              โ”‚

```bashโ”‚  EventSource feed ยท Leaflet map ยท Bias meter ยท Chat     โ”‚

./start.shโ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

This starts:---

  • Celery workers (data ingestion)

  • Celery beat (task scheduler)## ๐Ÿ› ๏ธ Tech Stack

  • FastAPI server (http://localhost:8000)

| Layer | Technology |

Open your browser: http://localhost:8000|---|---|

| Streaming Engine | Pathway โ€” live ETL, embedding, KNN index |

---| Backend API | FastAPI + uvicorn โ€” async REST + SSE |

| RAG Inference | OpenRouter โ†’ google/gemini-2.0-flash-lite (Pathway query service) |

๐Ÿ—๏ธ Architecture| AI Chat / SITREP | Google Gemini (gemini-flash-latest) via google-generativeai |

| NER / Geocoding | spaCy en_core_web_sm + OSM Nominatim |


โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”| **Map** | Leaflet.js v1.9.4 โ€” dark CartoDB tiles, proportional circle markers |

โ”‚                    DATA SOURCES                          โ”‚| **PDF Reports** | jsPDF 2.5.1 (client-side, CDN) |

โ”‚  RSS (18) โ”‚ Telegram (25) โ”‚ Reddit (10) โ”‚ News APIs     โ”‚| **Connectors** | `Telethon` (Telegram MTProto), `requests` (Reddit/GNews), `feedparser` (RSS) |

โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜| **Deployment** | Docker Compose |

                     โ”‚

                     โ–ผ---

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”

โ”‚               CELERY WORKERS (Distributed)               โ”‚## ๐Ÿ“‚ Project Structure

โ”‚  RSS Worker (5min) โ”‚ Reddit (1min) โ”‚ News (10min)       โ”‚

โ”‚  Telegram (realtime) โ”‚ Conflicts (12h) โ”‚ Commodities    โ”‚```text

โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜FlashPoint/

                     โ”‚โ”œโ”€โ”€ backend/

                     โ–ผโ”‚   โ”œโ”€โ”€ main.py              # Entry point โ€” uvicorn on port 8000

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚   โ”œโ”€โ”€ pipeline.py          # Pathway orchestrator (run separately)

โ”‚                 PROCESSING PIPELINE                      โ”‚โ”‚   โ”œโ”€โ”€ api.py               # FastAPI routes (SSE feed, chat, report, health)

โ”‚  Dedup (SHA256) โ†’ Embed (sentence-transformers)         โ”‚โ”‚   โ”œโ”€โ”€ geo_extractor.py     # spaCy NER + Nominatim geocoding service

โ”‚  โ†’ Store (PostgreSQL + Qdrant) โ†’ Publish (Redis)        โ”‚โ”‚   โ”œโ”€โ”€ report_service.py    # Gemini SITREP generation service

โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚   โ”œโ”€โ”€ rag_pipeline.py      # Pathway DocumentStore + embedding pipeline

                     โ”‚โ”‚   โ”œโ”€โ”€ query_service.py     # Pathway HTTP query intake โ†’ LLM โ†’ response

                     โ–ผโ”‚   โ”œโ”€โ”€ stream_writer.py     # Pathway โ†’ FastAPI bridge with startup retry

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚   โ”œโ”€โ”€ data_registry.py     # Source connector registry

โ”‚                   STORAGE LAYER                          โ”‚โ”‚   โ”œโ”€โ”€ auth_telegram.py     # Telegram MTProto authentication

โ”‚  PostgreSQL + TimescaleDB โ”‚ Qdrant โ”‚ Redis              โ”‚โ”‚   โ”œโ”€โ”€ connectors/

โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚   โ”‚   โ”œโ”€โ”€ telegram_src.py

                     โ”‚โ”‚   โ”‚   โ”œโ”€โ”€ reddit_src.py

                     โ–ผโ”‚   โ”‚   โ”œโ”€โ”€ news_src.py

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚   โ”‚   โ”œโ”€โ”€ rss_src.py

โ”‚                   FASTAPI SERVER                         โ”‚โ”‚   โ”‚   โ””โ”€โ”€ sim_src.py       # Simulation source (dummy.jsonl)

โ”‚  SSE Stream โ”‚ RAG Chat โ”‚ Reports โ”‚ Commodities          โ”‚โ”‚   โ””โ”€โ”€ Dockerfile

โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”œโ”€โ”€ frontend/

                     โ”‚โ”‚   โ””โ”€โ”€ web/                 # Static dashboard (served by FastAPI)

                     โ–ผโ”‚       โ”œโ”€โ”€ index.html       # Three-column command dashboard

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚       โ”œโ”€โ”€ styles.css       # Dark cyber theme + SSE animations

โ”‚              FRONTEND (ES6 Modules)                      โ”‚โ”‚       โ””โ”€โ”€ app.js           # SSE feed, map, bias meter, streaming chat

โ”‚  Live Feed โ”‚ Leaflet Map โ”‚ Chat โ”‚ Commodities           โ”‚โ”œโ”€โ”€ data/

โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚   โ””โ”€โ”€ dummy.jsonl          # 20 realistic geopolitical test events

```โ”œโ”€โ”€ docker-compose.yaml

โ”œโ”€โ”€ requirements.txt

### Key Technologiesโ””โ”€โ”€ README.md

Backend:

  • FastAPI - Async web framework---

  • Celery - Distributed task queue

  • SQLAlchemy - ORM with async support## ๐Ÿš€ Getting Started

  • LangChain - RAG framework

  • sentence-transformers - Embeddings (all-MiniLM-L6-v2)### Prerequisites

Storage:- Python 3.10+

  • PostgreSQL 15 + TimescaleDB - Time-series event storage- Docker & Docker Compose (for containerised deployment)

  • Redis 7 - Caching, deduplication, pub/sub- Telegram API ID & Hash โ€” my.telegram.org

  • Qdrant - Vector database (384-dim COSINE)- Google Gemini API key

  • GNews API key

AI:- OpenRouter API key (for Pathway RAG queries)

  • OpenRouter - LLM API (Llama 3.3 70B)

  • LangChain - RAG orchestration### Local Development

  • spaCy - NER for entity extraction

  1. Clone the repository

Frontend:```bash

---2. Install dependencies

## ๐Ÿ“ Project Structurepip install -r requirements.txt

python -m spacy download en_core_web_sm

FlashPoint/

โ”œโ”€โ”€ backend/3. Configure environment

โ”‚ โ”œโ”€โ”€ api.py # FastAPI routes```bash

โ”‚ โ”œโ”€โ”€ main.py # Application entry pointcp .env.example .env

โ”‚ โ”œโ”€โ”€ init_infra.py # Database initialization# Edit .env and fill in all API keys

โ”‚ โ”œโ”€โ”€ models/```

โ”‚ โ”‚ โ”œโ”€โ”€ database.py # SQLAlchemy models

โ”‚ โ”‚ โ””โ”€โ”€ redis_client.py # Redis utilities4. Run the FastAPI server (Terminal 1)

โ”‚ โ”œโ”€โ”€ services/```bash

โ”‚ โ”‚ โ”œโ”€โ”€ rag_service.py # LangChain RAGcd backend && python main.py

โ”‚ โ”‚ โ”œโ”€โ”€ report_service.py # SITREP generation```

โ”‚ โ”‚ โ”œโ”€โ”€ commodity_service.py # Price tracking

โ”‚ โ”‚ โ”œโ”€โ”€ conflict_service.py # CFR scraping5. Run the Pathway pipeline (Terminal 2)

โ”‚ โ”‚ โ””โ”€โ”€ geo_extractor.py # NER + geocoding```bash

โ”‚ โ”œโ”€โ”€ workers/tasks/cd backend && python pipeline.py

โ”‚ โ”‚ โ”œโ”€โ”€ rss_worker.py # RSS polling```

โ”‚ โ”‚ โ”œโ”€โ”€ reddit_worker.py # Reddit API

โ”‚ โ”‚ โ”œโ”€โ”€ news_worker.py # GNews API6. Open the dashboard

โ”‚ โ”‚ โ”œโ”€โ”€ telegram_worker.py # Telethon streaming

โ”‚ โ”‚ โ”œโ”€โ”€ conflict_worker.py # CFR scrapingNavigate to http://localhost:8000

โ”‚ โ”‚ โ”œโ”€โ”€ commodity_worker.py # Price fetching

โ”‚ โ”‚ โ””โ”€โ”€ processor.py # Embedding generation> Offline / demo mode: Set USE_DUMMY = true in frontend/web/app.js to load the built-in test feed without a running backend.

โ”‚ โ””โ”€โ”€ config/

โ”‚ โ”œโ”€โ”€ celery_config.py # Celery configuration### Docker (full stack)

โ”‚ โ””โ”€โ”€ auth_telegram.py # Telegram credentials

โ”œโ”€โ”€ frontend/web/```bash

โ”‚ โ”œโ”€โ”€ index.html # Main pagedocker-compose up --build

โ”‚ โ”œโ”€โ”€ app.js # Entry point```

โ”‚ โ””โ”€โ”€ js/

โ”‚ โ”œโ”€โ”€ feed.js # SSE event streamAuthenticate Telegram on first run by entering your phone number and the OTP sent to the Telegram app.

โ”‚ โ”œโ”€โ”€ map.js # Leaflet integration

โ”‚ โ”œโ”€โ”€ chat.js # RAG chat interface---

โ”‚ โ”œโ”€โ”€ commodities.js # Price widget

โ”‚ โ”œโ”€โ”€ conflicts.js # Conflict markers## ๐Ÿ•น๏ธ Usage

โ”‚ โ”œโ”€โ”€ reports.js # SITREP generation

โ”‚ โ””โ”€โ”€ utils.js # Shared utilities1. Open the dashboard at http://localhost:8000.

โ”œโ”€โ”€ data/2. Watch the Live Intel Feed (left column) โ€” new events slide in from the top as they arrive.

โ”‚ โ””โ”€โ”€ data_sources.json # Source configuration (53 sources)3. The Geopolitical Hotspot Map (centre) shows circle markers sized by how frequently each location appears in the stream.

โ”œโ”€โ”€ docker-compose.yml # Infrastructure services4. The Narrative Balance bar (right column) updates in real time based on the last 50 events.

โ”œโ”€โ”€ start.sh # One-command startup5. Type a question in the AI Chat panel โ€” the response streams back token-by-token.

โ”œโ”€โ”€ stop.sh # Graceful shutdown6. Click Generate Report to produce a Gemini-authored PDF SITREP of current conditions.

โ””โ”€โ”€ docs/ # Documentation




---## ๐Ÿ”Œ API Endpoints



## ๐ŸŽฎ Usage| Method | Path | Description |

|---|---|---|

### Dashboard Features| `GET` | `/health` | Liveness probe |

| `POST` | `/v1/stream` | Pathway โ†’ API event ingestion |

1. **Live Feed** - Real-time event stream with SSE| `GET` | `/v1/feed/stream` | SSE stream of live events (EventSource) |

2. **Interactive Map** - Click markers to see event details| `GET` | `/v1/frontend/feed` | Snapshot of last 100 events (JSON) |

3. **RAG Chat** - Ask questions: *"What's happening in Gaza?"*| `GET` | `/v1/generate_report` | Trigger Gemini SITREP generation |

4. **Commodity Prices** - Gold, silver, oil prices (auto-refresh)| `POST` | `/v1/chat` | SSE-streaming LLM chat |

5. **Conflict Tracker** - CFR Global Conflict Tracker integration| `GET` | `/` | Static dashboard (index.html) |

6. **SITREP Generation** - One-click intelligence reports

---

### API Endpoints

## ๐Ÿ‘ฅ Team

```bash

# Health check- **Gaurav Upreti** โ€” Backend, Pathway Pipeline, API

curl http://localhost:8000/health- **Ashmeet Singh Sandhu** โ€” Frontend, Data Connectors & Design



# Recent events---

curl http://localhost:8000/api/events/recent?limit=10

*Built with โค๏ธ using [Pathway](https://pathway.com).*

# Event stream (SSE)
curl http://localhost:8000/api/events/stream

# RAG chat
curl -X POST http://localhost:8000/v1/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "What are the latest developments in Ukraine?"}'

# Generate report
curl http://localhost:8000/v1/generate_report

# Commodities
curl http://localhost:8000/api/commodities/latest

# Conflicts
curl http://localhost:8000/api/conflicts/all

Adding Data Sources

Edit data/data_sources.json:

{
  "telegram_channels": [
    {
      "username": "new_channel",
      "bias": "Neutral",
      "enabled": true
    }
  ],
  "reddit_subreddits": ["worldnews"],
  "rss_feeds": [
    {
      "url": "https://example.com/feed.xml",
      "name": "Example News",
      "enabled": true
    }
  ]
}

Restart workers: ./stop.sh && ./start.sh


๐Ÿ”ง Configuration

Environment Variables

# PostgreSQL
DATABASE_URL=postgresql://flashpoint:password@localhost:5432/flashpoint

# Redis
REDIS_URL=redis://localhost:6379/0

# Qdrant
QDRANT_URL=http://localhost:6333

# OpenRouter (for RAG)
OPENROUTER_API_KEY=your_key_here

# Telegram
TELEGRAM_API_ID=your_id
TELEGRAM_API_HASH=your_hash
TELEGRAM_PHONE=your_phone

# GNews API (optional)
GNEWS_API_KEY=your_key

Worker Schedules

Edit backend/config/celery_config.py:

beat_schedule = {
    'fetch-rss': {'task': 'rss_worker.fetch_all_rss', 'schedule': 300},  # 5 min
    'fetch-reddit': {'task': 'reddit_worker.fetch_reddit', 'schedule': 60},  # 1 min
    'fetch-news': {'task': 'news_worker.fetch_news', 'schedule': 600},  # 10 min
    # ...
}

๐Ÿ“Š Monitoring

View Logs

# Celery worker
tail -f logs/celery-worker.log

# Celery beat
tail -f logs/celery-beat.log

# Docker services
docker-compose logs -f postgres
docker-compose logs -f redis
docker-compose logs -f qdrant

Database

# Connect to PostgreSQL
docker exec -it flashpoint-postgres psql -U flashpoint

# Check events
SELECT COUNT(*) FROM events;
SELECT source, COUNT(*) FROM events GROUP BY source;

Redis

# Connect to Redis
docker exec -it flashpoint-redis redis-cli

# Check keys
KEYS *
GET recent_events

๐Ÿš€ Deployment

Production Recommendations

  1. Use PostgreSQL managed service (AWS RDS, DigitalOcean)
  2. Use Redis managed service (Redis Cloud, AWS ElastiCache)
  3. Deploy Qdrant on K8s or use Qdrant Cloud
  4. Run Celery workers as separate containers
  5. Use HTTPS with Let's Encrypt
  6. Set up monitoring with Grafana + Prometheus
  7. Enable backups for PostgreSQL

Docker Deployment

# Build production image
docker build -t flashpoint:latest .

# Run with docker-compose
docker-compose -f docker-compose.prod.yml up -d

๐Ÿค Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

See docs/DEVELOPMENT.md for development setup.


๐Ÿ“„ License

MIT License - see LICENSE file


๐Ÿ™ Credits

  • Pathway (original RAG implementation, now replaced)
  • LangChain for RAG orchestration
  • OpenRouter for LLM access
  • CFR Global Conflict Tracker for conflict data
  • Leaflet.js for mapping
  • All open source contributors

๐Ÿ“š Documentation


๐Ÿ› Known Issues & Roadmap

See GitHub Issues

Roadmap:

  • Twitter/X integration
  • Sentiment analysis dashboard
  • Multi-language support
  • Mobile app
  • GraphQL API

Built with โค๏ธ for intelligence analysts, journalists, and decision-makers

FlashPoint v2.0 - Native Architecture (March 2026)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors