This directory contains the backend code for the WhatsApp Wikipedia Bot.
GET /webhook - Verification endpoint for WhatsApp webhook setupPOST /webhook - Receives incoming WhatsApp messagesAll admin endpoints require an API key to be sent in the X-API-Key header.
GET /admin/topics - Get all available topicsPOST /admin/facts - Add a new fact
topic, contentsourcePOST /admin/audio - Add a new audio clip
title, url, topicdescription, durationPOST /admin/video - Add a new video clip
title, url, topicdescription, durationDELETE /admin/facts/:id - Delete a factDELETE /admin/audio/:id - Delete an audio clipDELETE /admin/video/:id - Delete a video clipGET /health - Check if the service is runningWHATSAPP_VERIFY_TOKEN - Token for WhatsApp webhook verificationWHATSAPP_TOKEN - WhatsApp Business API tokenWHATSAPP_PHONE_NUMBER_ID - WhatsApp phone number IDADMIN_API_KEY - API key for admin endpointsThe application uses SQLite for storage with the following tables:
whatsapp_wiki_users_v1 - User information and preferenceswhatsapp_wiki_facts_v1 - Fun factswhatsapp_wiki_audio_v1 - Audio clipswhatsapp_wiki_video_v1 - Video clips