Skip to content

Multi-country survey chatbot system with WhatsApp integration

Notifications You must be signed in to change notification settings

FexKus/AI-Consultation-Tool

Repository files navigation

🌍 UN GIM Multi-Country Survey Platform

Multi-tenant WhatsApp survey system for conflict analysis and peacebuilding consultations

Status: βœ… Production Ready (Syria LIVE) Last Updated: October 20, 2025


πŸ“Š Overview

This platform runs 3 independent WhatsApp surveys simultaneously for UN GIM consultations in:

Survey Status Phone Number Language Heroku App
Syria βœ… LIVE (v46) +358454903164 Arabic un-gim-survey-bot
Armenia πŸ”œ Ready to deploy +358454901787 English un-gim-survey-bot-armenia
Guinea-Bissau πŸ”œ Ready to deploy (Purchase number) Portuguese un-gim-survey-bot-guinea

View Syria Data: https://un-gim-survey-bot-fe9d751698ce.herokuapp.com/list-survey-data?event_id=syria_survey_2025


πŸ“‚ Project Structure

AI Consultation Tool/
β”‚
β”œβ”€β”€ README.md                    ← YOU ARE HERE
β”‚
β”œβ”€β”€ documentation/               ← General setup guides & architecture
β”‚   β”œβ”€β”€ QUICK_START.md          ← Start here for orientation
β”‚   β”œβ”€β”€ NEW_SURVEY_SETUP_GUIDE.md ← How to add new surveys
β”‚   β”œβ”€β”€ FINAL_CONFIGURATION_OCT19_2025.md
β”‚   β”œβ”€β”€ DEPLOYMENT_READY_SUMMARY.md
β”‚   β”œβ”€β”€ MULTI_TENANT_IMPLEMENTATION_PLAN.md
β”‚   └── archive/                ← Historical docs
β”‚
β”œβ”€β”€ syria-survey/               ← Syria WhatsApp bot (LIVE)
β”‚   β”œβ”€β”€ app/main.py            ← Main webhook handler
β”‚   β”œβ”€β”€ core/config.py         ← Configuration
β”‚   β”œβ”€β”€ services/              ← Survey + export logic
β”‚   └── [Syria-specific docs]
β”‚
β”œβ”€β”€ armenia-survey/             ← Armenia WhatsApp bot (Ready to deploy)
β”‚   └── [To be created - duplicated from Syria]
β”‚
β”œβ”€β”€ guinea-bissau-survey/       ← Guinea-Bissau WhatsApp bot (Ready to deploy)
β”‚   └── [To be created - duplicated from Syria]
β”‚
β”œβ”€β”€ sensemaking-tool/           ← AI analysis tool (post-survey)
β”‚   └── [Data analysis codebase]
β”‚
└── delete_test_user.py         ← Shared testing utility

πŸš€ Quick Start

For New AI Assistants:

  1. Read: documentation/QUICK_START.md
  2. Understand: documentation/FINAL_CONFIGURATION_OCT19_2025.md
  3. Set up new survey: documentation/NEW_SURVEY_SETUP_GUIDE.md

For Developers:

Test Syria Survey:

python3 delete_test_user.py
# Send "Hello" to +358454903164 on WhatsApp
# View: https://un-gim-survey-bot-fe9d751698ce.herokuapp.com/list-survey-data?event_id=syria_survey_2025

Monitor Logs:

cd syria-survey
heroku logs --tail

Deploy Changes:

cd syria-survey
git add -A && git commit -m "message" && git push heroku main

🎯 Survey Architecture

Independent Deployments:

  • Each survey = Separate Heroku app
  • Each survey = Own codebase (duplicated, then customized)
  • Complete isolation (changes to one don't affect others)

Shared Infrastructure:

  • Firebase Project: yemeni-youth-engagement
  • Twilio Account: Same account, different phone numbers
  • AI Services: OpenAI (Whisper) + Anthropic (Claude)

Data Isolation:

Firebase Collections:
β”œβ”€β”€ syria_users β†’ syria-survey app only
β”œβ”€β”€ syria_responses β†’ syria-survey app only
β”œβ”€β”€ armenia_users β†’ armenia-survey app only
β”œβ”€β”€ armenia_responses β†’ armenia-survey app only
β”œβ”€β”€ guinea_bissau_users β†’ guinea-bissau-survey app only
└── guinea_bissau_responses β†’ guinea-bissau-survey app only

πŸ”§ Technical Stack

Platform: Heroku (3 separate apps) Framework: FastAPI + Python 3.12 Database: Firebase Firestore Storage: Firebase Storage (voice messages) Messaging: Twilio WhatsApp API AI Models:

  • OpenAI Whisper-1 (audio transcription + translation)
  • Anthropic Claude Sonnet 4.5 (text translation)

πŸ“± Current Deployments

Syria Survey (LIVE):

Armenia Survey (Pending):

  • App: To be created
  • Phone: +358454901787 (already purchased)
  • Status: πŸ”œ Ready to configure (~2-3 hours)

Guinea-Bissau Survey (Pending):

  • App: To be created
  • Phone: To be purchased
  • Status: πŸ”œ Ready to configure (~3-4 hours)

πŸŽ“ Key Learnings

Why 3 Separate Apps?

  1. Different survey structures:

    • Syria: 3 demographics + 6 questions
    • Armenia: 0 demographics + 5 questions
    • Guinea-Bissau: 10 demographics + 8 questions
  2. Zero risk:

    • Changes to Armenia won't break Syria
    • Each survey isolated and independent
  3. Simpler maintenance:

    • Clear which code controls which survey
    • Easier for future developers/AI agents
  4. Faster deployment:

    • No complex conditional logic
    • Straightforward customization

What's Shared:

  • Firebase project (different collections)
  • Twilio account (different numbers)
  • API keys (OpenAI, Anthropic)
  • Architecture patterns
  • Documentation

πŸ“– Documentation Guide

General Documentation (in documentation/):

  • System architecture
  • Setup guides
  • Troubleshooting
  • Multi-tenant design patterns

Survey-Specific Documentation (in each survey folder):

  • Deployment details
  • Template IDs
  • Event configuration
  • Version history

πŸ”— Essential Links


πŸ†˜ Support

For Setup Questions:

  1. Read documentation/QUICK_START.md
  2. Follow documentation/NEW_SURVEY_SETUP_GUIDE.md
  3. Check survey-specific README in each folder

For Issues:

  1. Check heroku logs --tail in relevant survey folder
  2. Review documentation/TROUBLESHOOTING.md
  3. Verify Firestore configuration

Created: October 20, 2025 Syria Survey: Fully operational βœ… Next Steps: Deploy Armenia & Guinea-Bissau surveys

About

Multi-country survey chatbot system with WhatsApp integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors