# Platform Architecture

Gloria’s News Data Platform is built to reliably ingest, validate, and serve curated feeds—right now from Twitter/X—while laying the groundwork for future enhancements like graph-based context and advanced RAG.

***

### **1. Data Ingestion**

**Multiple Sources**

* **Social Media:** Twitter/X for real-time sentiment and trending topics.
* **Market Data:** Additional sources like CoinGecko for up-to-date token prices and market caps.

**Workflow**

* Pull new data via each source’s API.
* Run basic validation (timestamp freshness, schema checks).
* Store valid records in a staging database for downstream processing.

***

### **2. Feed Builder**

**Pre-Curated Feeds**

* Continuously updated categories—no extra filters required.
* Items packaged into JSON with fields like signal, timestamp, and enrichment.

**Custom Feeds**

* On-demand generation based on user criteria (category and timespan).
* Manual setup today—reach out to support for bespoke filters.

***

### **3. Delivery Interface**

**REST API**

* **GET** `/news/{{feed_type}}?api_key={{api_key}}&from_date={{yyyy-mm-dd}}&to_date={{yyyy-mm-dd}}`
* Returns structured JSON array of feed items.

**WebSocket**

* **WSS** `/ws/{{feed_type}}?api_key={{api_key}}`
* Pushes new feed items in real time as they arrive.
* Payloads include `signal` and `timestamp`.

***
