How owasp-blt/blt works
Project type and purpose
• This is a full-stack, MVT (Model-View-Template) Django web application called “OWASP BLT” (Bug-Bounty & Leaderboard Tool).
• It offers a public web frontend, a REST/API layer, WebSocket-based real-time features (chat/video), scheduled background tasks, and integrations with external services (Bitcoin node, GitHub, Slack, SendGrid, etc.).
Top-level components
a. End-users & Clients
• Web browsers (HTTP/HTTPS)
• Mobile clients (HTTP/HTTPS + WebSockets for video/chat)
b. Edge layer
• CDN or Load Balancer (serves static assets: CSS/JS, routes traffic to web servers)
• SSL termination
c. Web Application Layer (Django)
• ASGI server (Daphne/Uvicorn) for HTTP & WebSocket
• WSGI server (Gunicorn) for traditional HTTP
• Django project (“blt/” – settings, middleware, routing)
• Django apps (“website/” main app, “comments/”, plus any others)
• REST/API endpoints (website/api/views.py + serializers)
• WebSocket consumers (website/consumers.py)
• Management commands & scheduler (cron or Celery beat ↔ Django management/commands)
d. Data layer
• Relational database (PostgreSQL/MySQL) – holds users, issues, comments, bounties, etc.
• Cache / Channel Layer (Redis) – caching, session store, Django Channels layer
e. External-Service Integrations
• Bitcoin node (bitcoind service under BACON) – RPC calls from website/bitcoin_utils.py
• ord-server microservice (ordinals)
• GitHub API (fetch_repos, issues, PR stats via management commands)
• Slack API (incoming/outgoing webhooks, slash commands)
• SendGrid webhook receiver
• Google Cloud Storage (for screenshots)
• Blue Sky service (website/services/blue_sky_service.py)
f. Background/Batch Processing
• Scheduler (cron jobs or Celery beat)
• Workers (Celery or direct Django management command runners)
Relationships & data flow
• Clients ↔ Load Balancer (HTTP/HTTPS) ↔ ASGI/Wsgi servers ↔ Django apps
• Django apps ↔ Relational DB (ORM queries)
• Django apps ↔ Redis (cache, channel layer)
• Django (RPC client) → Bitcoin Node
• Django (HTTP client) → ord-server, GitHub, Slack, SendGrid, Blue Sky
• Scheduler → Django management commands → DB / external APIs
Key architectural patterns & design principles
• MVT (Django Model-View-Template) layered separation
• Asynchronous event handling via Django Channels (WebSocket consumers)
• Background tasks pattern (management commands or Celery tasks)
• External integration abstraction (services/blue_sky_service.py, bitcoin_utils.py)
• Twelve-factor app principles (12-Factor config via .env, Docker, Procfile)
Relevant technologies, frameworks & libraries
• Python 3 & Django (MVT)
• Django Channels (ASGI, WebSockets)
• Gunicorn / Daphne / Uvicorn (WSGI/ASGI servers)
• Redis (cache layer & channel layer)
• PostgreSQL (or another relational DB)
• Docker & docker-compose, Vagrant (development & deployment)
• GitHub Actions (CI/CD), Dependabot, CodeQL (security)
• bitcoind & ord-server (blockchain integration)
• External APIs: GitHub, Slack, SendGrid, Google Cloud Storage, Blue Sky
Don’t overthink—capture every moving piece
• Split the Django deployment into web servers + workers + scheduler.
• Both SQL DB and Redis as separate data stores.
• Bitcoin node & ord-server as internal microservices.