# debbyg-001/naijatech-opps architecture

> Architecture diagram of the GitHub repository debbyg-001/naijatech-opps, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/debbyg-001/naijatech-opps
- Repository: https://github.com/debbyg-001/naijatech-opps

## Overview

NaijaTech Opps is a Flask dashboard for discovering technology opportunities relevant to Nigerians. Visitors browse, search, filter, and view listings; the backend retrieves and ranks stored opportunities, applying deadline and regional rules. Administrators can import or draft listings, review and publish them, prepare WhatsApp posts, and inspect anonymous reach statistics. The graph includes the documented source integrations and UI capabilities; some wiring is based on README statements because the relevant implementation excerpts are incomplete.

Main entry points: [`app.py`](https://github.com/debbyg-001/naijatech-opps/blob/main/app.py) (Flask routes), [`aggregator.py`](https://github.com/debbyg-001/naijatech-opps/blob/main/aggregator.py) (Listing retrieval), [`stats.py`](https://github.com/debbyg-001/naijatech-opps/blob/main/stats.py) (Reach metrics), [`db.py`](https://github.com/debbyg-001/naijatech-opps/blob/main/db.py) (Listings and events)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery and ranking"]
  node_dashboard["Dashboard UI<br/>[app.js]"]
  node_api["Flask routes<br/>[app.py]"]
  node_ranking["Listing retrieval<br/>[aggregator.py]"]
  node_deadlines["Deadline rules<br/>[deadlines.py]"]
  node_regions["Region ranking<br/>[regions.py]"]
  node_database[("Listings and events<br/>[db.py]")]
end

subgraph group_ingestion["Opportunity ingestion"]
  node_feeds{{"RSS and listing sources"}}
  node_aggregator["Feed and platform import<br/>[aggregator.py]"]
  node_apify{{"HorizonScholar"}}
end

subgraph group_admin["Admin and outreach"]
  node_admin_ui["Admin panel<br/>[admin.js]"]
  node_extractor["Listing extractor<br/>[extractor.py]"]
  node_whatsapp_ui["WhatsApp queue<br/>[whatsapp.js]"]
end

subgraph group_insights["Reach analytics"]
  node_stats_api["Reach metrics<br/>[stats.py]"]
  node_stats_ui["Stats panel<br/>[stats.js]"]
end

node_visitor(("Visitor"))
node_admin_user(("Administrator"))
node_whatsapp{{"WhatsApp"}}

node_visitor -->|"browses"| node_dashboard
node_dashboard -->|"requests listings"| node_api
node_api -->|"gets opportunities"| node_ranking
node_ranking -->|"reads listings"| node_database
node_ranking -->|"checks deadlines"| node_deadlines
node_ranking -->|"classifies listings"| node_regions
node_admin_user -->|"manages listings"| node_admin_ui
node_admin_ui -->|"calls admin APIs"| node_api
node_api -->|"drafts listing"| node_extractor
node_api -->|"updates listings"| node_database
node_api -->|"syncs sources"| node_aggregator
node_aggregator -->|"fetches listings"| node_feeds
node_aggregator -->|"imports results"| node_apify
node_aggregator -->|"stores imports"| node_database
node_admin_user -->|"prepares posts"| node_whatsapp_ui
node_whatsapp_ui -->|"loads queue"| node_api
node_whatsapp_ui -->|"opens message"| node_whatsapp
node_dashboard -->|"sends events"| node_api
node_api -->|"records events"| node_stats_api
node_stats_api -->|"reads and writes events"| node_database
node_stats_api -->|"gets reporting date"| node_deadlines
node_stats_api -->|"groups results"| node_regions
node_admin_user -->|"views reach"| node_stats_ui
node_stats_ui -->|"requests metrics"| node_api

click node_dashboard "https://github.com/debbyg-001/naijatech-opps/blob/main/static/js/app.js"
click node_api "https://github.com/debbyg-001/naijatech-opps/blob/main/app.py"
click node_ranking "https://github.com/debbyg-001/naijatech-opps/blob/main/aggregator.py"
click node_deadlines "https://github.com/debbyg-001/naijatech-opps/blob/main/deadlines.py"
click node_regions "https://github.com/debbyg-001/naijatech-opps/blob/main/regions.py"
click node_database "https://github.com/debbyg-001/naijatech-opps/blob/main/db.py"
click node_aggregator "https://github.com/debbyg-001/naijatech-opps/blob/main/aggregator.py"
click node_admin_ui "https://github.com/debbyg-001/naijatech-opps/blob/main/static/js/admin.js"
click node_extractor "https://github.com/debbyg-001/naijatech-opps/blob/main/extractor.py"
click node_whatsapp_ui "https://github.com/debbyg-001/naijatech-opps/blob/main/static/js/whatsapp.js"
click node_stats_api "https://github.com/debbyg-001/naijatech-opps/blob/main/stats.py"
click node_stats_ui "https://github.com/debbyg-001/naijatech-opps/blob/main/static/js/stats.js"

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_dashboard,node_api,node_ranking,node_deadlines,node_regions,node_database toneBlue
class node_feeds,node_aggregator,node_apify toneAmber
class node_admin_ui,node_extractor,node_whatsapp_ui toneMint
class node_stats_api,node_stats_ui toneRose
class node_visitor,node_admin_user,node_whatsapp toneIndigo
```

## Components

### Discovery and ranking

- [Dashboard UI](https://github.com/debbyg-001/naijatech-opps/blob/main/static/js/app.js): `static/js/app.js`
- [Flask routes](https://github.com/debbyg-001/naijatech-opps/blob/main/app.py): `app.py`
- [Listing retrieval](https://github.com/debbyg-001/naijatech-opps/blob/main/aggregator.py): `aggregator.py`
- [Deadline rules](https://github.com/debbyg-001/naijatech-opps/blob/main/deadlines.py): `deadlines.py`
- [Region ranking](https://github.com/debbyg-001/naijatech-opps/blob/main/regions.py): `regions.py`
- [Listings and events](https://github.com/debbyg-001/naijatech-opps/blob/main/db.py): `db.py`

### Opportunity ingestion

- **RSS and listing sources**
- [Feed and platform import](https://github.com/debbyg-001/naijatech-opps/blob/main/aggregator.py): `aggregator.py`
- **HorizonScholar**

### Admin and outreach

- [Admin panel](https://github.com/debbyg-001/naijatech-opps/blob/main/static/js/admin.js): `static/js/admin.js`
- [Listing extractor](https://github.com/debbyg-001/naijatech-opps/blob/main/extractor.py): `extractor.py`
- [WhatsApp queue](https://github.com/debbyg-001/naijatech-opps/blob/main/static/js/whatsapp.js): `static/js/whatsapp.js`

### Reach analytics

- [Reach metrics](https://github.com/debbyg-001/naijatech-opps/blob/main/stats.py): `stats.py`
- [Stats panel](https://github.com/debbyg-001/naijatech-opps/blob/main/static/js/stats.js): `static/js/stats.js`

### Other components

- **Visitor**
- **Administrator**
- **WhatsApp**

## Connections

- Visitor → Dashboard UI: browses (evidence: `README.md`)
- Dashboard UI → Flask routes: requests listings (evidence: `README.md`)
- Flask routes → Listing retrieval: gets opportunities (evidence: `app.py`)
- Listing retrieval → Listings and events: reads listings (evidence: `aggregator.py`)
- Listing retrieval → Deadline rules: checks deadlines (evidence: `aggregator.py`)
- Listing retrieval → Region ranking: classifies listings (evidence: `aggregator.py`)
- Administrator → Admin panel: manages listings (evidence: `README.md`)
- Admin panel → Flask routes: calls admin APIs (evidence: `README.md`)
- Flask routes → Listing extractor: drafts listing (evidence: `app.py`)
- Flask routes → Listings and events: updates listings (evidence: `app.py`)
- Flask routes → Feed and platform import: syncs sources (evidence: `README.md`)
- Feed and platform import → RSS and listing sources: fetches listings (evidence: `README.md`)
- Feed and platform import → HorizonScholar: imports results (evidence: `aggregator.py`)
- Feed and platform import → Listings and events: stores imports (evidence: `aggregator.py`)
- Administrator → WhatsApp queue: prepares posts (evidence: `README.md`)
- WhatsApp queue → Flask routes: loads queue (evidence: `README.md`)
- WhatsApp queue → WhatsApp: opens message (evidence: `static/js/whatsapp.js`)
- Dashboard UI → Flask routes: sends events (evidence: `static/js/app.js`)
- Flask routes → Reach metrics: records events (evidence: `app.py`)
- Reach metrics → Listings and events: reads and writes events (evidence: `stats.py`)
- Reach metrics → Deadline rules: gets reporting date (evidence: `stats.py`)
- Reach metrics → Region ranking: groups results (evidence: `stats.py`)
- Administrator → Stats panel: views reach (evidence: `README.md`)
- Stats panel → Flask routes: requests metrics (evidence: `README.md`)
