{"id":31721560,"url":"https://github.com/codetun/voice-call","last_synced_at":"2025-10-29T12:44:05.184Z","repository":{"id":318067563,"uuid":"1069878430","full_name":"codeTun/voice-call","owner":"codeTun","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-04T20:15:41.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-04T22:15:37.883Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeTun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-04T19:56:34.000Z","updated_at":"2025-10-04T20:15:43.000Z","dependencies_parsed_at":"2025-10-04T22:15:46.174Z","dependency_job_id":"faa46e82-1dee-4995-9fff-a3de2b073bab","html_url":"https://github.com/codeTun/voice-call","commit_stats":null,"previous_names":["codetun/voice-call"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/codeTun/voice-call","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeTun%2Fvoice-call","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeTun%2Fvoice-call/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeTun%2Fvoice-call/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeTun%2Fvoice-call/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeTun","download_url":"https://codeload.github.com/codeTun/voice-call/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeTun%2Fvoice-call/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000696,"owners_count":26082911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-09T04:00:06.436Z","updated_at":"2025-10-09T04:00:11.435Z","avatar_url":"https://github.com/codeTun.png","language":"JavaScript","readme":"# 🌱 Agri-Health Voice Alert System\n\nA proactive voice alert system that automatically calls women farmers when a health risk or agricultural issue is detected. Built with Twilio API for reliable voice communication.\n\n## 📋 Features\n\n- **🔊 Automated Voice Calls**: Send voice alerts without requiring internet or smartphone\n- **🌍 Multi-Language Support**: English, French, Arabic, Spanish, Hindi, Swahili\n- **📱 Multiple Alert Types**: Health, Agricultural, Weather, and Emergency alerts\n- **🎯 Smart Targeting**: Personalized messages with farmer names and locations\n- **⚡ Urgency Levels**: Normal, Urgent, and Emergency message formatting\n- **📊 Call Tracking**: Monitor call status and history\n- **🌐 Web Interface**: Easy-to-use web dashboard for testing and management\n- **🔧 API Integration**: RESTful API for integration with other systems\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n1. **Node.js** (v14 or higher)\n2. **Twilio Account** with:\n   - Account SID\n   - Auth Token\n   - Twilio Phone Number\n\n### Installation\n\n1. **Clone or download** this project to your computer\n\n2. **Install dependencies**:\n   ```bash\n   npm install\n   ```\n\n3. **Set up environment variables**:\n   ```bash\n   # Copy the example file\n   copy .env.example .env\n   \n   # Edit .env file with your actual Twilio credentials\n   ```\n\n4. **Configure your .env file**:\n   ```env\n   TWILIO_ACCOUNT_SID=your_account_sid_here\n   TWILIO_AUTH_TOKEN=your_auth_token_here\n   TWILIO_PHONE_NUMBER=your_twilio_phone_number_here\n   PORT=3000\n   ```\n\n5. **Start the application**:\n   ```bash\n   npm start\n   ```\n\n6. **Open your browser** and go to: `http://localhost:3000`\n\n## 🧪 Testing\n\n### Test with the Web Interface\n\n1. Start the server: `npm start`\n2. Open `http://localhost:3000` in your browser\n3. Fill in the form with:\n   - Your phone number (in E.164 format: +1234567890)\n   - Select alert type and subtype\n   - Choose language and voice\n   - Click \"Send Voice Alert\"\n\n### Test with the Command Line\n\n```bash\n# Set your test phone number in .env\nTEST_PHONE_NUMBER=+1234567890\n\n# Run the test script\nnpm test\n```\n\n## 📞 How to Get Twilio Credentials\n\n1. **Sign up** for a free Twilio account at [twilio.com](https://www.twilio.com)\n\n2. **Get your credentials** from the Twilio Console:\n   - Account SID\n   - Auth Token\n\n3. **Get a phone number**:\n   - Go to Phone Numbers → Manage → Buy a number\n   - Choose a number from your country\n   - Configure it for Voice calls\n\n4. **Verify your personal phone** (required for free accounts):\n   - Go to Phone Numbers → Manage → Verified Caller IDs\n   - Add and verify your phone number\n\n## 📱 Alert Types \u0026 Messages\n\n### Health Alerts\n- **Fever**: High temperature detection\n- **Blood Pressure**: Abnormal readings\n- **Medication**: Reminder notifications\n- **Checkup**: Scheduled appointment reminders\n\n### Agricultural Alerts\n- **Irrigation**: Soil moisture warnings\n- **Pesticide**: Pest activity detection\n- **Harvest**: Crop readiness notifications\n- **Weather**: Farming weather advisories\n- **Fertilizer**: Application reminders\n\n### Weather Alerts\n- **Storm**: Severe weather warnings\n- **Drought**: Water conservation alerts\n- **Flood**: Heavy rainfall warnings\n- **Frost**: Freezing temperature alerts\n\n## 🌍 Supported Languages\n\n| Language | Code | Voice Options |\n|----------|------|---------------|\n| English | `en` | alice, man, woman |\n| French | `fr` | alice, man, woman |\n| Arabic | `ar` | man, woman |\n| Spanish | `es` | alice, man, woman |\n| Hindi | `hi` | man, woman |\n| Swahili | `sw` | man, woman |\n| German | `de` | alice, man, woman |\n| Italian | `it` | alice, man, woman |\n| Portuguese | `pt` | alice, man, woman |\n\n## 🔌 API Endpoints\n\n### Send Predefined Alert\n```bash\nPOST /api/send-alert\nContent-Type: application/json\n\n{\n  \"phoneNumber\": \"+1234567890\",\n  \"alertType\": \"health\",\n  \"alertSubtype\": \"fever\",\n  \"language\": \"en\",\n  \"voice\": \"alice\",\n  \"farmerName\": \"Sarah\",\n  \"urgencyLevel\": \"urgent\"\n}\n```\n\n### Send Custom Alert\n```bash\nPOST /api/send-custom-alert\nContent-Type: application/json\n\n{\n  \"phoneNumber\": \"+1234567890\",\n  \"message\": \"Your crops need immediate attention due to pest detection.\",\n  \"language\": \"en\",\n  \"voice\": \"woman\"\n}\n```\n\n### Get Call History\n```bash\nGET /api/call-history\n```\n\n### Check Call Status\n```bash\nGET /api/call-status/{callSid}\n```\n\n### Get Available Alert Types\n```bash\nGET /api/alert-types\n```\n\n### Get Supported Languages\n```bash\nGET /api/languages\n```\n\n## 🔧 Configuration Options\n\n### Environment Variables\n- `TWILIO_ACCOUNT_SID`: Your Twilio Account SID\n- `TWILIO_AUTH_TOKEN`: Your Twilio Auth Token  \n- `TWILIO_PHONE_NUMBER`: Your Twilio phone number\n- `PORT`: Server port (default: 3000)\n- `NODE_ENV`: Environment (development/production)\n- `DEFAULT_LANGUAGE`: Default language code (default: en)\n- `DEFAULT_VOICE`: Default voice type (default: alice)\n- `TEST_PHONE_NUMBER`: Phone number for testing\n\n### Voice Options\n- **alice**: Clear, friendly voice (English default)\n- **man**: Male voice (available in most languages)\n- **woman**: Female voice (available in most languages)\n\n### Urgency Levels\n- **normal**: Standard message formatting\n- **urgent**: Prefixed with urgency indicator\n- **emergency**: Strong emergency language and repetition\n\n## 🚀 Production Deployment\n\n### Heroku Deployment\n```bash\n# Install Heroku CLI and login\nheroku create your-app-name\n\n# Set environment variables\nheroku config:set TWILIO_ACCOUNT_SID=your_sid\nheroku config:set TWILIO_AUTH_TOKEN=your_token\nheroku config:set TWILIO_PHONE_NUMBER=your_number\n\n# Deploy\ngit push heroku main\n```\n\n### Docker Deployment\n```dockerfile\n# Use the included Dockerfile (create if needed)\ndocker build -t agri-health-alerts .\ndocker run -p 3000:3000 --env-file .env agri-health-alerts\n```\n\n## 🛠️ Development\n\n### Project Structure\n```\nagri-hope/\n├── src/\n│   ├── services/\n│   │   ├── twilioVoiceService.js    # Twilio integration\n│   │   ├── alertManager.js          # Alert templates \u0026 logic\n│   │   └── languageManager.js       # Multi-language support\n│   ├── app.js                       # Main application server\n│   └── test-call.js                 # Testing utilities\n├── package.json                     # Dependencies \u0026 scripts\n├── .env.example                     # Environment template\n└── README.md                        # This file\n```\n\n### Adding New Languages\n1. Update `languageManager.js` with new language config\n2. Add message templates in `alertManager.js`\n3. Test with Twilio's supported voices\n\n### Adding New Alert Types\n1. Define new templates in `alertManager.js`\n2. Update the web interface forms\n3. Add API documentation\n\n## 📊 Monitoring \u0026 Analytics\n\n### Call Tracking\n- All calls are logged with timestamps\n- Call status monitoring (pending, ringing, in-progress, completed, failed)\n- Error tracking and debugging information\n\n### Performance Monitoring\n- Response time tracking\n- Success/failure rates\n- Language usage statistics\n\n## 🔒 Security Considerations\n\n### Production Security\n- Use HTTPS in production\n- Secure your Twilio credentials\n- Implement rate limiting\n- Add authentication for admin functions\n- Validate phone numbers\n- Sanitize user inputs\n\n### Privacy\n- Don't log sensitive health information\n- Implement data retention policies\n- Follow GDPR/privacy regulations\n- Encrypt stored data\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Test thoroughly\n5. Submit a pull request\n\n## 📞 Support\n\n### Common Issues\n\n**\"Missing Twilio credentials\"**\n- Make sure your `.env` file has all required variables\n- Check that your Twilio credentials are correct\n\n**\"Call failed\"**\n- Verify the phone number is in E.164 format (+1234567890)\n- Ensure the number is verified in Twilio (for free accounts)\n- Check your Twilio account balance\n\n**\"Language not supported\"**\n- Check the supported languages list\n- Use fallback to English if needed\n\n### Getting Help\n- Check Twilio's documentation: [twilio.com/docs](https://www.twilio.com/docs)\n- Review the test script output for debugging information\n- Check the browser console for web interface issues\n\n## 📈 Future Enhancements\n\n- **Database Integration**: Store farmer profiles and call history\n- **Scheduling**: Automated calls based on time/conditions\n- **Voice Recognition**: Interactive voice responses\n- **SMS Fallback**: Text messages when calls fail\n- **Mobile App**: Companion app for farmers\n- **Analytics Dashboard**: Comprehensive reporting\n- **Integration APIs**: Connect with IoT sensors and health devices\n- **Voice Recording**: Custom pre-recorded messages\n- **Batch Calling**: Multiple farmers at once\n\n## 📄 License\n\nMIT License - feel free to use this project for your agricultural and health initiatives.\n\n---\n\n**Built with ❤️ for women farmers and rural health initiatives**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodetun%2Fvoice-call","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodetun%2Fvoice-call","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodetun%2Fvoice-call/lists"}