{"id":31958658,"url":"https://github.com/lintshiwe/v-crisislink","last_synced_at":"2025-10-14T15:14:01.505Z","repository":{"id":318621525,"uuid":"1068116736","full_name":"Lintshiwe/V-CrisisLink","owner":"Lintshiwe","description":"CrisisLink is a mobile-first disaster rescue platform designed for South Africans facing extreme weather events. The system instantly sends users' live locations and triggers visual warnings when danger is imminent, helping them prepare and respond faster.","archived":false,"fork":false,"pushed_at":"2025-10-08T07:52:56.000Z","size":29,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-08T09:25:17.734Z","etag":null,"topics":["devops","disaster-relief","emergency-response","south-africa","vagrant","vagrantfile","virtualization"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/Lintshiwe.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":"SECURITY.md","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-01T22:04:13.000Z","updated_at":"2025-10-08T08:10:19.000Z","dependencies_parsed_at":"2025-10-08T09:25:20.417Z","dependency_job_id":null,"html_url":"https://github.com/Lintshiwe/V-CrisisLink","commit_stats":null,"previous_names":["lintshiwe/v-crisislink"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Lintshiwe/V-CrisisLink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lintshiwe%2FV-CrisisLink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lintshiwe%2FV-CrisisLink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lintshiwe%2FV-CrisisLink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lintshiwe%2FV-CrisisLink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lintshiwe","download_url":"https://codeload.github.com/Lintshiwe/V-CrisisLink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lintshiwe%2FV-CrisisLink/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019301,"owners_count":26086709,"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-14T02:00:06.444Z","response_time":60,"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":["devops","disaster-relief","emergency-response","south-africa","vagrant","vagrantfile","virtualization"],"created_at":"2025-10-14T15:13:56.915Z","updated_at":"2025-10-14T15:14:01.483Z","avatar_url":"https://github.com/Lintshiwe.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CrisisLink2.0 Vagrant Setup\n\nThis repository contains Vagrant configuration to automatically set up and run the CrisisLink2.0 application in a virtual machine.\n\n## 🚨 What is CrisisLink?\n\nCrisisLink is a mobile-first disaster rescue platform built for South Africans facing extreme weather emergencies. With one tap on a glowing SOS button, users instantly send their live location and alert status to 24/7 emergency agents. The system also monitors local weather conditions and triggers visual warnings when danger is imminent—helping users prepare and respond faster.\n\n## 🛠️ Prerequisites\n\nBefore you begin, ensure you have the following installed on your host machine:\n\n1. [Vagrant](https://www.vagrantup.com/downloads) (2.2.19 or newer)\n2. [VirtualBox](https://www.virtualbox.org/wiki/Downloads) (6.1 or newer)\n3. Git (to clone this repository)\n\n## 🚀 Getting Started\n\nFollow these steps to set up and run CrisisLink using Vagrant:\n\n### 1. Clone this Repository\n\n```bash\ngit clone https://github.com/Lintshiwe/V-CrisisLink.git\ncd V-CrisisLink\n```\n\n### 2. Start the Vagrant VM\n\n```bash\nvagrant up\n```\n\nThis command will:\n\n- Download the Debian Bullseye base box (if not already present)\n- Set up a virtual machine with 2GB RAM and 2 CPU cores\n- Install all required dependencies (Node.js, PostgreSQL with PostGIS, Redis)\n- Clone the CrisisLink2.0 repository from GitHub\n- Set up the database and required environment files\n- Install all project dependencies\n- Fix any potential native module issues (like bcrypt)\n- Start the application automatically\n\nThe entire setup is fully automated - no manual steps required!\n\n### 3. Access the Application\n\nOnce the VM is provisioned (this may take several minutes), you can access the application at:\n\n- Frontend: [http://localhost:3000](http://localhost:3000)\n- Backend API: [http://localhost:5000](http://localhost:5000)\n\n## 🔧 Managing the VM\n\n- **SSH into the VM**: `vagrant ssh`\n- **Stop the VM**: `vagrant halt`\n- **Restart the VM**: `vagrant reload`\n- **Destroy the VM**: `vagrant destroy`\n\n## ⚙️ Configuration\n\nThe Vagrant setup includes:\n\n- **Port Forwarding**:\n\n  - Frontend (port 3000)\n  - Backend API (port 5000)\n\n- **System Requirements**:\n  - 2GB RAM\n  - 2 CPU cores\n\nYou can modify these settings in the `Vagrantfile` if needed.\n\n## 🔑 API Keys Setup\n\nCrisisLink comes with pre-configured API keys for core functionality, but you can also use your own keys.\n\n### Quick Setup (Recommended)\n\n1. **Run the setup script**:\n\n   ```bash\n   ./setup-api-keys.sh\n   ```\n\n2. **Start Vagrant**:\n\n   ```bash\n   vagrant up\n   ```\n\n### Manual Setup\n\n1. **Copy the template**:\n\n   ```bash\n   cp api-keys.env.template api-keys.env\n   ```\n\n2. **Edit your API keys**:\n\n   ```bash\n   nano api-keys.env\n   ```\n\n3. **Start Vagrant**:\n\n   ```bash\n   vagrant up\n   ```\n\n### Pre-configured Services\n\nThe following services are **already configured** and working:\n\n✅ **OpenWeatherMap API** - Real-time weather data and alerts  \n✅ **Ambee Environmental API** - Natural disaster monitoring  \n✅ **Google Maps API** - Interactive maps and geolocation  \n✅ **Google Firebase API** - Real-time database and notifications\n\n### Optional Services (Require Your Own Credentials)\n\n❌ **Twilio SMS** - Emergency SMS alerts (optional)  \n❌ **Custom JWT Secret** - Enhanced security (recommended for production)\n\n### Security Features\n\n- 🔒 **API keys are never committed to Git** (protected by .gitignore)\n- 🔒 **Automatic environment variable injection** during VM setup\n- 🔒 **Template system** for easy key management\n- 🔒 **Fallback to working defaults** if no custom keys provided\n\n## 🧩 Project Structure\n\nInside the VM, the CrisisLink project is located at `/home/vagrant/CrisisLink` with the following structure:\n\n- `backend/` - Node.js backend API\n- `frontend/` - React frontend application\n- `database/` - Database schema and migrations\n\n## 📝 Troubleshooting\n\nIf you encounter any issues:\n\n### Check the service status\n\n```bash\nvagrant ssh -c \"sudo systemctl status crisislink\"\n```\n\n### View service logs\n\n```bash\nvagrant ssh -c \"sudo journalctl -u crisislink\"\n```\n\n### Restart the application\n\n```bash\nvagrant ssh -c \"sudo systemctl restart crisislink\"\n```\n\n### Fix bcrypt native module issues\n\nIf you see errors about the bcrypt module:\n\n```bash\nvagrant ssh\ncd ~/CrisisLink/backend\nnpm rebuild bcrypt --build-from-source\nsudo systemctl restart crisislink\n```\n\n### Check if ports are in use\n\n```bash\nvagrant ssh -c \"netstat -tulpn | grep -E '3000|5000'\"\n```\n\n### Database Health Check\n\nRun the comprehensive database health check:\n\n```bash\nvagrant ssh -c \"./db-health-check.sh\"\n```\n\n### Database troubleshooting\n\nCheck database connection:\n\n```bash\nvagrant ssh -c \"sudo -u postgres psql -d crisislink -c 'SELECT version();'\"\n```\n\nList databases and tables:\n\n```bash\nvagrant ssh\nsudo -u postgres psql -c '\\l' # List databases\nsudo -u postgres psql -d crisislink -c '\\dt' # List tables\n```\n\nRestart database service:\n\n```bash\nvagrant ssh -c \"sudo systemctl restart postgresql\"\n```\n\nTest application database connection:\n\n```bash\nvagrant ssh -c \"PGPASSWORD=crisislink_password psql -h localhost -U crisislink_user -d crisislink -c 'SELECT 1;'\"\n```\n\n## 📄 License\n\nCrisisLink is available under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flintshiwe%2Fv-crisislink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flintshiwe%2Fv-crisislink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flintshiwe%2Fv-crisislink/lists"}