# madiha-maha/omniscience architecture

> Architecture diagram of the GitHub repository madiha-maha/omniscience, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/madiha-maha/omniscience
- Repository: https://github.com/madiha-maha/omniscience

## Overview

Omniscience Enterprise is a social-media intelligence and campaign-planning dashboard. Users enter the dashboard, choose a platform, review analytics and audience/market signals, generate AI-assisted content, and model campaign strategy; they can also save posts and manage a profile. The app is largely a client-side interface with some Firestore persistence and Gemini-backed features. Several major views are present in the source index but their internal data flows were not sampled, so those connections are shown only where the app’s routing or explicit calls provide evidence.

Main entry points: [`src/App.tsx`](https://github.com/madiha-maha/omniscience/blob/main/src/App.tsx) (Dashboard Shell), [`src/lib/firebase.ts`](https://github.com/madiha-maha/omniscience/blob/main/src/lib/firebase.ts) (Firebase Client), [`src/components/ProfileView.tsx`](https://github.com/madiha-maha/omniscience/blob/main/src/components/ProfileView.tsx) (Agency Profile), [`src/services/ai.ts`](https://github.com/madiha-maha/omniscience/blob/main/src/services/ai.ts) (AI Services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_app["Dashboard Shell<br/>[App.tsx]"]
end

subgraph group_analytics["Intelligence Views"]
  node_dashboard["Social Dashboard<br/>[DashboardView.tsx]"]
  node_audience["Audience Analysis<br/>[AudienceView.tsx]"]
  node_sentiment["Sentiment Analysis<br/>[SentimentView.tsx]"]
  node_forecast["Forecasting"]
  node_competitor["Competitor Analysis"]
  node_trends["Trend Mapping<br/>[TrendMapView.tsx]"]
  node_reports["Executive Reports"]
end

subgraph group_creation["Content and Strategy"]
  node_generator["Post Generator<br/>[PostGenerator.tsx]"]
  node_simulator["Strategy Simulator"]
  node_saved["Saved Intelligence<br/>[SavedIntelView.tsx]"]
end

subgraph group_identity["Identity and Persistence"]
  node_profile["Agency Profile<br/>[ProfileView.tsx]"]
  node_authpage["Authentication Page<br/>[AuthPage.tsx]"]
  node_auth["Auth Context<br/>[AuthContext.tsx]"]
end

subgraph group_services["AI and Data Services"]
  node_firestore[("Firestore")]
  node_firebase["Firebase Client<br/>[firebase.ts]"]
  node_ai["AI Services<br/>[ai.ts]"]
  node_firestoreutils["Firestore Error Handler<br/>[firestoreUtils.ts]"]
end

node_user(("Executive User"))
node_genai["Google Gemini"]

node_user -->|"uses"| node_app
node_app -->|"reads session"| node_auth
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_audience
node_app -->|"routes to"| node_sentiment
node_app -->|"routes to"| node_forecast
node_app -->|"routes to"| node_competitor
node_app -->|"routes to"| node_trends
node_app -->|"routes to"| node_simulator
node_app -->|"routes to"| node_saved
node_dashboard -->|"renders"| node_generator
node_dashboard -->|"requests insights"| node_ai
node_simulator -->|"requests insights"| node_ai
node_generator -->|"generates content"| node_ai
node_ai -->|"calls model"| node_genai
node_generator -->|"saves posts"| node_firebase
node_firebase -->|"connects"| node_firestore
node_profile -->|"reads user"| node_auth
node_profile -->|"writes profile"| node_firebase
node_saved -->|"uses persistence"| node_firebase
node_profile -->|"reports errors"| node_firestoreutils
node_firestoreutils -->|"reads auth"| node_firebase
node_app -.->|"opens report"| node_reports
node_app -.->|"routes to"| node_profile
node_app -.->|"routes to"| node_authpage

click node_app "https://github.com/madiha-maha/omniscience/blob/main/src/App.tsx"
click node_dashboard "https://github.com/madiha-maha/omniscience/blob/main/src/components/DashboardView.tsx"
click node_audience "https://github.com/madiha-maha/omniscience/blob/main/src/components/AudienceView.tsx"
click node_sentiment "https://github.com/madiha-maha/omniscience/blob/main/src/components/SentimentView.tsx"
click node_forecast "https://github.com/madiha-maha/omniscience/blob/main/src/components/ForecastingView.tsx"
click node_competitor "https://github.com/madiha-maha/omniscience/blob/main/src/components/CompetitorAnalysisView.tsx"
click node_trends "https://github.com/madiha-maha/omniscience/blob/main/src/components/TrendMapView.tsx"
click node_reports "https://github.com/madiha-maha/omniscience/blob/main/src/components/ExecutiveReportModal.tsx"
click node_generator "https://github.com/madiha-maha/omniscience/blob/main/src/components/PostGenerator.tsx"
click node_simulator "https://github.com/madiha-maha/omniscience/blob/main/src/components/StrategySimulatorView.tsx"
click node_saved "https://github.com/madiha-maha/omniscience/blob/main/src/components/SavedIntelView.tsx"
click node_profile "https://github.com/madiha-maha/omniscience/blob/main/src/components/ProfileView.tsx"
click node_authpage "https://github.com/madiha-maha/omniscience/blob/main/src/components/AuthPage.tsx"
click node_auth "https://github.com/madiha-maha/omniscience/blob/main/src/lib/AuthContext.tsx"
click node_firebase "https://github.com/madiha-maha/omniscience/blob/main/src/lib/firebase.ts"
click node_ai "https://github.com/madiha-maha/omniscience/blob/main/src/services/ai.ts"
click node_firestoreutils "https://github.com/madiha-maha/omniscience/blob/main/src/lib/firestoreUtils.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_user toneBlue
class node_dashboard,node_audience,node_sentiment,node_forecast,node_competitor,node_trends,node_reports toneAmber
class node_generator,node_simulator,node_saved toneMint
class node_profile,node_authpage,node_auth toneRose
class node_firestore,node_firebase,node_ai,node_firestoreutils,node_genai toneIndigo
```

## Components

### Application Shell

- [Dashboard Shell](https://github.com/madiha-maha/omniscience/blob/main/src/App.tsx): `src/App.tsx`

### Intelligence Views

- [Social Dashboard](https://github.com/madiha-maha/omniscience/blob/main/src/components/DashboardView.tsx): `src/components/DashboardView.tsx`
- [Audience Analysis](https://github.com/madiha-maha/omniscience/blob/main/src/components/AudienceView.tsx): `src/components/AudienceView.tsx`
- [Sentiment Analysis](https://github.com/madiha-maha/omniscience/blob/main/src/components/SentimentView.tsx): `src/components/SentimentView.tsx`
- [Forecasting](https://github.com/madiha-maha/omniscience/blob/main/src/components/ForecastingView.tsx): `src/components/ForecastingView.tsx`
- [Competitor Analysis](https://github.com/madiha-maha/omniscience/blob/main/src/components/CompetitorAnalysisView.tsx): `src/components/CompetitorAnalysisView.tsx`
- [Trend Mapping](https://github.com/madiha-maha/omniscience/blob/main/src/components/TrendMapView.tsx): `src/components/TrendMapView.tsx`
- [Executive Reports](https://github.com/madiha-maha/omniscience/blob/main/src/components/ExecutiveReportModal.tsx): `src/components/ExecutiveReportModal.tsx`

### Content and Strategy

- [Post Generator](https://github.com/madiha-maha/omniscience/blob/main/src/components/PostGenerator.tsx): `src/components/PostGenerator.tsx`
- [Strategy Simulator](https://github.com/madiha-maha/omniscience/blob/main/src/components/StrategySimulatorView.tsx): `src/components/StrategySimulatorView.tsx`
- [Saved Intelligence](https://github.com/madiha-maha/omniscience/blob/main/src/components/SavedIntelView.tsx): `src/components/SavedIntelView.tsx`

### Identity and Persistence

- [Agency Profile](https://github.com/madiha-maha/omniscience/blob/main/src/components/ProfileView.tsx): `src/components/ProfileView.tsx`
- [Authentication Page](https://github.com/madiha-maha/omniscience/blob/main/src/components/AuthPage.tsx): `src/components/AuthPage.tsx`
- [Auth Context](https://github.com/madiha-maha/omniscience/blob/main/src/lib/AuthContext.tsx): `src/lib/AuthContext.tsx`

### AI and Data Services

- **Firestore**
- [Firebase Client](https://github.com/madiha-maha/omniscience/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- [AI Services](https://github.com/madiha-maha/omniscience/blob/main/src/services/ai.ts): `src/services/ai.ts`
- [Firestore Error Handler](https://github.com/madiha-maha/omniscience/blob/main/src/lib/firestoreUtils.ts): `src/lib/firestoreUtils.ts`

### Other components

- **Executive User**
- **Google Gemini**

## Connections

- Executive User → Dashboard Shell: uses (evidence: `src/App.tsx`)
- Dashboard Shell → Auth Context: reads session (evidence: `src/App.tsx`)
- Dashboard Shell → Social Dashboard: routes to (evidence: `src/App.tsx`)
- Dashboard Shell → Audience Analysis: routes to (evidence: `src/App.tsx`)
- Dashboard Shell → Sentiment Analysis: routes to (evidence: `src/App.tsx`)
- Dashboard Shell → Forecasting: routes to (evidence: `src/App.tsx`)
- Dashboard Shell → Competitor Analysis: routes to (evidence: `src/App.tsx`)
- Dashboard Shell → Trend Mapping: routes to (evidence: `src/App.tsx`)
- Dashboard Shell → Strategy Simulator: routes to (evidence: `src/App.tsx`)
- Dashboard Shell → Saved Intelligence: routes to (evidence: `src/App.tsx`)
- Social Dashboard → Post Generator: renders (evidence: `src/components/DashboardView.tsx`)
- Social Dashboard → AI Services: requests insights (evidence: `src/components/DashboardView.tsx`)
- Strategy Simulator → AI Services: requests insights (evidence: `src/components/StrategySimulatorView.tsx`)
- Post Generator → AI Services: generates content (evidence: `src/components/PostGenerator.tsx`)
- AI Services → Google Gemini: calls model (evidence: `src/services/ai.ts`)
- Post Generator → Firebase Client: saves posts (evidence: `src/components/PostGenerator.tsx`)
- Firebase Client → Firestore: connects (evidence: `src/lib/firebase.ts`)
- Agency Profile → Auth Context: reads user (evidence: `src/components/ProfileView.tsx`)
- Agency Profile → Firebase Client: writes profile (evidence: `src/components/ProfileView.tsx`)
- Saved Intelligence → Firebase Client: uses persistence (evidence: `src/components/SavedIntelView.tsx`)
- Agency Profile → Firestore Error Handler: reports errors (evidence: `src/components/ProfileView.tsx`)
- Firestore Error Handler → Firebase Client: reads auth (evidence: `src/lib/firestoreUtils.ts`)
- Dashboard Shell → Executive Reports: opens report (evidence: `src/App.tsx`)
- Dashboard Shell → Agency Profile: routes to (evidence: `src/App.tsx`)
- Dashboard Shell → Authentication Page: routes to
