A real-time OSINT backend to detect, verify, and report civil unrest (protests, riots, strikes) using public data from Twitter, Reddit, Telegram, and News APIs.
- Multi-Source Data Collection: Twitter, Reddit, Telegram, and News APIs
- NLP Processing: Protest relevance classification, sentiment analysis, NER, geolocation
- Verification System: Multi-source verification with confidence scoring
- Real-time Alerts: Telegram bot and email notifications
- REST API: Complete API for frontend integration
- Moderation Tools: Admin controls for false positive management
Create a .env file with your API keys:
# Database (SQLite - no setup required)
DATABASE_URL=sqlite:///./noesis.db
# Twitter API v2
TWITTER_BEARER_TOKEN=your_twitter_bearer_token
# Reddit API
REDDIT_CLIENT_ID=your_reddit_client_id
REDDIT_CLIENT_SECRET=your_reddit_client_secret
REDDIT_USER_AGENT=NOESIS_Bot/1.0
# Telegram API (Optional - for Telegram bot alerts)
# Note: python-telegram-bot has compatibility issues with Python 3.13
# If you need Telegram alerts, consider using Python 3.11 or 3.12
TELEGRAM_API_ID=your_telegram_api_id
TELEGRAM_API_HASH=your_telegram_api_hash
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
# GNews API
GNEWS_API_KEY=your_gnews_api_key
# Geocoding: Uses OpenStreetMap Nominatim (free, no API key needed)
# Email Configuration
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=your_email@gmail.com
SMTP_PASSWORD=your_app_passwordpip install -r requirements.txtNo setup required! The system uses SQLite which creates a noesis.db file automatically.
uvicorn main:app --reloadThe API will be available at http://localhost:8000
GET /incidents/- Get incidents with filteringGET /incidents/latest- Get latest verified incidentsGET /incidents/{incident_id}- Get incident detailsGET /incidents/stats/summary- Get incident statistics
POST /collection/run-cycle- Manually trigger data collectionGET /collection/status- Get collection system status
POST /alerts/subscribe- Subscribe to alertsPOST /alerts/unsubscribe- Unsubscribe from alerts
POST /moderate/flag- Flag false positivePOST /moderate/confirm- Confirm incidentPOST /moderate/merge- Merge duplicate incidents
- Collection: Raw data collected from Twitter, Reddit, Telegram, and News APIs
- Processing: NLP pipeline processes posts for relevance, sentiment, entities, and geolocation
- Verification: Posts are clustered and verified based on multi-source confirmation
- Alerting: Verified incidents trigger Telegram and email alerts
- API: REST endpoints provide data access for frontend applications
app/
├── api/ # FastAPI endpoints
├── models/ # SQLAlchemy models
├── services/ # NLP, verification, orchestration
├── collectors/ # Data collection modules
├── alerts/ # Alert services
└── utils/ # Database and utilities
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License.