Skip to content
MusfiqDehanPublic

About

An AI powered production-grade, distributed, multilingual (Bangla + English) news crawling and intelligence platform with Multilingual Semantic Search Functionality.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

NewsCrawl - News Scraping Intelligence Platform

Live demo: https://newscrawl.musfiqdehan.com/

Email admin@musfiqdehan.com
Password Nc!ETnoZJRy8GTfX56wuMxg9A

Public semantic search (no login): https://newscrawl.musfiqdehan.com/explore

A production-grade, distributed, multilingual (Bangla + English) news crawling and intelligence platform.

It crawls configured news sources (Prothom Alo, Kaler Kantho, Naya Diganta, BBC / BBC Bangla, Al Jazeera - extensible to more), stores raw content in S3-compatible object storage, processes articles through a queue-based pipeline (cleaning -> language detection -> deduplication -> LLM extraction -> embeddings), and serves everything through a FastAPI control/query plane and a Next.js operations dashboard with multilingual semantic search.

Architecture at a glance

Next.js dashboard ──► FastAPI (control + query plane)
                          │
        ┌─────────────────┼──────────────────┐
        ▼                 ▼                  ▼
   PostgreSQL 17     Redis 8           MinIO (S3)
   + pgvector        Streams/locks     raw HTML
   frontier,         heartbeats,
   articles, jobs    rate limits
        ▲                 ▲
        │                 │
  Scrapy workers ──► Playwright fallback ──► news websites
        │
        ▼
  Processing workers: clean → langdetect → dedup → LLM (Gemini) → BGE-M3 embeddings

Five separated planes: control (API), crawl (Scrapy + Playwright workers), processing (Redis Streams consumers), query (API + pgvector search), observability (Prometheus + Grafana + structured JSON logs).

Design decisions are documented in docs/architecture.md and the other documents under docs/.

Operations dashboard overview

Repository layout

apps/
  api/         FastAPI app, SQLAlchemy models, Alembic migrations, frontier services
  crawler/     Scrapy project: spiders, middlewares, pipelines, Playwright integration
  processor/   Queue consumers: cleaning, dedup, LLM extraction, embeddings
  web/         Next.js dashboard (App Router, Tailwind, shadcn/ui, TanStack)
packages/
  contracts/       Shared Pydantic contracts (queue messages, enums)
  crawler-utils/   URL normalization, content hashing, SimHash
  shared-types/    TypeScript types shared with the web app
infrastructure/  Docker, Postgres, Redis, Nginx, Prometheus, Grafana, systemd
docs/            Architecture, runbooks, ADRs

Python code is a single uv workspace — one lockfile, one virtualenv, distinct package names (newscrawl_api, newscrawl_crawler, newscrawl_processor, ...).

Quick start (local)

Prerequisites: Docker, uv, Node 22+, pnpm.

cp env.local.example env.local   # adjust if needed (Gemini API key for LLM extraction)
make install                     # Python workspace + web dependencies
make dev                         # postgres, redis, minio, prometheus, grafana
make migrate                     # apply database migrations
make seed                        # seed sources + admin user
make api                         # FastAPI on :8000
make web                         # dashboard on :3000
make crawl                       # crawl worker
make worker                      # processing workers

Quality gates:

make lint
make typecheck
make test               # unit tests
make test-integration   # testcontainers-based integration tests

Environments

Local Production
Compose file docker-compose.local.yml docker-compose.prod.yml
Env file env.local env.prod
Edge direct ports central Traefik → internal Nginx
Domains localhost:3000 / :8000 newscrawl.musfiqdehan.com / newscrawl-api.musfiqdehan.com
Monitoring bundled Prometheus + Grafana central monitoring stack (Prometheus, Grafana, Loki)

Production deployment details: docs/deployment.md.

Documentation

Legal & operational posture

The crawler respects robots.txt, applies per-domain rate limits, identifies itself with a descriptive User-Agent, and only crawls explicitly configured sources (SSRF-guarded). Designed for authorized data collection and research use.

About

An AI powered production-grade, distributed, multilingual (Bangla + English) news crawling and intelligence platform with Multilingual Semantic Search Functionality.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Sponsor this project

Contributors

Languages