Django REST API powering Amala Atlas — handles multi-channel candidate ingestion (WhatsApp, web, Google Maps, Twitter), source-channel-aware scoring, fuzzy deduplication, dynamic verification thresholds, and promotion to canonical map database. The system of record for every Amala spot.
# Amala Atlas — Backend API
The **system of record** for the Amala Atlas ecosystem. Manages the full lifecycle of an Amala spot — from raw submission through scoring, deduplication, verification, and promotion to the canonical map database.
## Architecture
The backend is a Django project with six apps, each handling a distinct domain:
```
amala_atlas/ # Django project config (settings, urls, wsgi)
├── places/ # Core: Spot, Candidate, Submission, PhotoURL
│ ├── models.py # Data models
│ ├── services.py # Scoring, geocoding integration, deduplication
│ ├── serializers.py # DRF serializers
│ ├── views.py # Spot API + candidate submission endpoint
│ ├── filters.py # Bbox, city, tag, query filters for spots
│ ├── nlp_utils.py # Nigerian food keywords + phone extraction
│ ├── geocoding.py # Nominatim + 14-city centroid fallback
│ └── dedupe.py # Name normalization, phone matching, fuzzy dedup
├── verification/ # Human review pipeline
│ ├── models.py # Verification model (approve/reject/merge)
│ └── views.py # Queue, action endpoint, dynamic thresholds
├── ingestion/ # Automated discovery intake
│ ├── views.py # POST /ingest/ and /ingest/batch/ (API key auth)
│ ├── extractors.py # HTML content extraction utilities
│ └── agents/ # Discovery agents
│ ├── google_maps.py # Google Places API scanner
│ └── twitter.py # Twitter/X venue mention extractor
├── whatsapp/ # WhatsApp bot via Twilio
│ ├── models.py # WhatsAppSession (conversation state)
│ ├── conversation.py # State machine: awaiting_spot → ... → complete
│ ├── parser.py # Nigerian spot name/location text parsing
│ └── views.py # Twilio webhook endpoint
├── users/ # Custom User with WhatsApp phone + contribution tracking
└── com …