# siddhanthkjain2005/wildlife-news architecture

> Architecture diagram of the GitHub repository siddhanthkjain2005/wildlife-news, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/siddhanthkjain2005/wildlife-news
- Repository: https://github.com/siddhanthkjain2005/wildlife-news

## Overview

Wildguard is a wildlife-crime intelligence workspace for conservation teams. Its principal workflow gathers news signals, deduplicates and analyzes incidents, stores them for review, and exposes the results through a React command center. Analysts can inspect maps, alerts, actor networks and forecasts, search incidents or ask citation-backed questions, and export reports. The README documents these capabilities; sampled source supports the search/RAG path and selected sync, alert and frontend behavior. Other subsystem connections below follow documented architecture and are not confirmed from sampled implementations.

Main entry points: [`app/api`](https://github.com/siddhanthkjain2005/wildlife-news/tree/main/app/api) (FastAPI endpoints), [`app/main.py`](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/main.py) (Sync orchestration), [`app/services/search_engine.py`](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/search_engine.py) (Semantic retrieval), [`app/services/rag_engine.py`](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/rag_engine.py) (Cited Q&A)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Collection and intelligence"]
  node_sync["Sync orchestration<br/>[main.py]"]
  node_collector["News collection<br/>[collector.py]"]
  node_dedupe["Incident deduplication<br/>[dedupe.py]"]
  node_intelligence["Incident analysis<br/>[intelligence.py]"]
end

subgraph group_analysis["Investigation and outputs"]
  node_alerts["Alert dispatch<br/>[alert_engine.py]"]
  node_predictor["Threat prediction<br/>[predictor.py]"]
  node_graph["Network analysis<br/>[graph_engine.py]"]
  node_search["Semantic retrieval<br/>[search_engine.py]"]
  node_rag["Cited Q&amp;A<br/>[rag_engine.py]"]
  node_reports["Reports and exports<br/>[report_export.py]"]
end

subgraph group_interface["Workspace and APIs"]
  node_api["FastAPI endpoints"]
  node_main["Application entry<br/>[main.py]"]
  node_frontend["Command center<br/>[App.jsx]"]
  node_searchui["Search interface<br/>[SemanticSearch.jsx]"]
  node_apiclient["Frontend API client<br/>[api.js]"]
end

subgraph group_platform["Persistence and operations"]
  node_database[("Incident store<br/>[database.py]")]
  node_repo["Incident queries<br/>[incident_repo.py]"]
  node_syncstate["Sync status<br/>[sync_manager.py]"]
end

node_sources(("News sources"))
node_analyst(("Conservation analyst"))
node_modelservice["Optional model service"]

node_sources -->|"provide signals"| node_collector
node_sync -->|"runs collection"| node_collector
node_collector -->|"submits items"| node_dedupe
node_sync -->|"runs analysis"| node_intelligence
node_sync -->|"persists results"| node_database
node_sync -->|"dispatches pending"| node_alerts
node_sync -->|"updates status"| node_syncstate
node_intelligence -->|"stores findings"| node_database
node_api -->|"queries incidents"| node_repo
node_repo -->|"reads records"| node_database
node_api -->|"requests networks"| node_graph
node_api -->|"requests forecasts"| node_predictor
node_api -->|"requests retrieval"| node_search
node_api -->|"answers questions"| node_rag
node_rag -->|"retrieves citations"| node_search
node_search -->|"loads candidates"| node_repo
node_api -->|"creates exports"| node_reports
node_main -->|"serves endpoints"| node_api
node_main -->|"serves dashboard"| node_frontend
node_frontend -->|"requests data"| node_apiclient
node_searchui -->|"submits query"| node_apiclient
node_apiclient -->|"calls endpoints"| node_api
node_analyst -->|"investigates incidents"| node_frontend
node_search -.->|"uses embeddings"| node_modelservice
node_rag -.->|"generates answers"| node_modelservice

click node_sync "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/main.py"
click node_collector "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/collector.py"
click node_dedupe "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/dedupe.py"
click node_intelligence "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/intelligence.py"
click node_database "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/core/database.py"
click node_repo "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/repositories/incident_repo.py"
click node_alerts "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/alert_engine.py"
click node_predictor "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/predictor.py"
click node_graph "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/graph_engine.py"
click node_search "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/search_engine.py"
click node_rag "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/rag_engine.py"
click node_reports "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/report_export.py"
click node_api "https://github.com/siddhanthkjain2005/wildlife-news/tree/main/app/api"
click node_main "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/main.py"
click node_frontend "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/frontend/src/App.jsx"
click node_searchui "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/frontend/src/components/SemanticSearch.jsx"
click node_apiclient "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/frontend/src/lib/api.js"
click node_syncstate "https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/workers/sync_manager.py"

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_sync,node_collector,node_dedupe,node_intelligence toneBlue
class node_alerts,node_predictor,node_graph,node_search,node_rag,node_reports toneAmber
class node_api,node_main,node_frontend,node_searchui,node_apiclient toneMint
class node_database,node_repo,node_syncstate toneRose
class node_sources,node_analyst,node_modelservice toneIndigo
```

## Components

### Collection and intelligence

- [Sync orchestration](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/main.py): `app/main.py`
- [News collection](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/collector.py): `app/services/collector.py`
- [Incident deduplication](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/dedupe.py): `app/services/dedupe.py`
- [Incident analysis](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/intelligence.py): `app/services/intelligence.py`

### Investigation and outputs

- [Alert dispatch](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/alert_engine.py): `app/services/alert_engine.py`
- [Threat prediction](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/predictor.py): `app/services/predictor.py`
- [Network analysis](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/graph_engine.py): `app/services/graph_engine.py`
- [Semantic retrieval](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/search_engine.py): `app/services/search_engine.py`
- [Cited Q&A](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/rag_engine.py): `app/services/rag_engine.py`
- [Reports and exports](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/services/report_export.py): `app/services/report_export.py`

### Workspace and APIs

- [FastAPI endpoints](https://github.com/siddhanthkjain2005/wildlife-news/tree/main/app/api): `app/api`
- [Application entry](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/main.py): `app/main.py`
- [Command center](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Search interface](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/frontend/src/components/SemanticSearch.jsx): `frontend/src/components/SemanticSearch.jsx`
- [Frontend API client](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/frontend/src/lib/api.js): `frontend/src/lib/api.js`

### Persistence and operations

- [Incident store](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/core/database.py): `app/core/database.py`
- [Incident queries](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/repositories/incident_repo.py): `app/repositories/incident_repo.py`
- [Sync status](https://github.com/siddhanthkjain2005/wildlife-news/blob/main/app/workers/sync_manager.py): `app/workers/sync_manager.py`

### Other components

- **News sources**
- **Conservation analyst**
- **Optional model service**

## Connections

- News sources → News collection: provide signals
- Sync orchestration → News collection: runs collection
- News collection → Incident deduplication: submits items
- Sync orchestration → Incident analysis: runs analysis
- Sync orchestration → Incident store: persists results
- Sync orchestration → Alert dispatch: dispatches pending
- Sync orchestration → Sync status: updates status
- Incident analysis → Incident store: stores findings
- FastAPI endpoints → Incident queries: queries incidents
- Incident queries → Incident store: reads records
- FastAPI endpoints → Network analysis: requests networks
- FastAPI endpoints → Threat prediction: requests forecasts
- FastAPI endpoints → Semantic retrieval: requests retrieval
- FastAPI endpoints → Cited Q&A: answers questions
- Cited Q&A → Semantic retrieval: retrieves citations
- Semantic retrieval → Incident queries: loads candidates
- FastAPI endpoints → Reports and exports: creates exports
- Application entry → FastAPI endpoints: serves endpoints
- Application entry → Command center: serves dashboard
- Command center → Frontend API client: requests data
- Search interface → Frontend API client: submits query
- Frontend API client → FastAPI endpoints: calls endpoints
- Conservation analyst → Command center: investigates incidents
- Semantic retrieval → Optional model service: uses embeddings
- Cited Q&A → Optional model service: generates answers
