AI Media Monitoring Platform for Tosyali Algeria
# 📰 Media Monitor AI
**AI Media Monitoring & Intelligence Platform** powered by Gemini AI, Supabase PostgreSQL, Express.js, and React.
---
## 🏗️ Repository Architecture
```text
media-monitor-ai/
│
├── frontend/ (React + Vite - Located in src/ & components/)
├── backend/ (Express API & Crawlers - Located in server.ts & Backend/)
├── database/ (Supabase PostgreSQL SQL Schema & Migrations in database/ & supabase/)
├── ai/ (Gemini 3.6 Flash - Summarization, Sentiment & RAG Engine)
├── n8n/ (n8n Scraping & RSS Automation Workflows)
├── docs/ (Architecture & Vercel Deployment Documentation)
└── README.md
```
---
## 🔄 End-to-End Workflow & Pipeline
```text
Google AI Studio ──► VS Code ──► GitHub ──► Vercel (Automated Deployment)
```
1. **Google AI Studio**: Design and prototype features, test Gemini prompt engineering, and update app capabilities.
2. **VS Code**: Clone or export the repository locally, refine components, run unit/integration tests (`npm run lint`, `npm run dev`).
3. **GitHub**: Push changes to the `main` branch.
4. **Vercel**: Triggers an automatic build and deploys the production preview.
---
## 🚀 Key Modules & Capabilities
- **Dashboard**: Real-time media sentiment breakdown, article volume metrics, and critical alerts.
- **AI Assistant**: Conversational RAG assistant grounded on ingested press content with source citations.
- **Media Monitoring & Crawling**: Multi-source RSS and press scrapers with automatic deduplication.
- **Executive Reports**: Dynamic report builder with key topic highlights, sentiment distribution, and PDF export.
- **Supabase Integration**: PostgreSQL schema with Row Level Security (RLS) for users, articles, media mentions, and audit logs.
- **n8n Automation**: Scheduled RSS scraper and ingestion workflows (`n8n/workflow_template.json`).
---
## ⚙️ Quick Start
### 1. Install Dependencies
```bash
npm install
```
### 2. Configure Environment Variables
Crea …