{"id":28088997,"url":"https://github.com/levintoo/mock-sms-server","last_synced_at":"2026-04-30T13:33:50.375Z","repository":{"id":292570935,"uuid":"980813750","full_name":"levintoo/mock-sms-server","owner":"levintoo","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-10T19:37:03.000Z","size":113,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-30T13:33:48.943Z","etag":null,"topics":["api","laravel","webhook-server"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/levintoo.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}},"created_at":"2025-05-09T19:01:34.000Z","updated_at":"2025-05-10T20:05:23.000Z","dependencies_parsed_at":"2025-05-10T20:36:58.086Z","dependency_job_id":null,"html_url":"https://github.com/levintoo/mock-sms-server","commit_stats":null,"previous_names":["levintoo/mock-sms-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/levintoo/mock-sms-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levintoo%2Fmock-sms-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levintoo%2Fmock-sms-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levintoo%2Fmock-sms-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levintoo%2Fmock-sms-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/levintoo","download_url":"https://codeload.github.com/levintoo/mock-sms-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levintoo%2Fmock-sms-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32466333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","laravel","webhook-server"],"created_at":"2025-05-13T12:53:11.297Z","updated_at":"2026-04-30T13:33:50.357Z","avatar_url":"https://github.com/levintoo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📡 Mock SMS Server\n\nA mock SMS gateway built with Laravel to simulates sending and delivering SMS messages with status updates and webhook notifications — for local and staging environments.\n\n## 🚀 Features\n\n- 📤 Simulate message sending (single or bulk)\n- 📦 Message statuses: `queued`, `sent`, `delivered`, `failed`\n- 🔁 Automatic status progression via jobs\n- 📡 Webhook dispatching for each status update\n- 🔐 Simple Bearer token authentication (`test-key`)\n- 🧪 Supports JSON and form-data requests\n- ⏳ Intelligent webhook polling (up to 24 hours)\n\n## 📦 Installation\n\nClone the repository\n\n```bash\ngit clone git@github.com:levintoo/mock-sms-server.git\ncd mock-sms-server\n````\n\nInstall PHP dependencies\n```bash\ncomposer install\n````\n\nCopy environment file and generate app key\n```bash\ncp .env.example .env\nphp artisan key:generate\n````\n\n(Required) Set your webhook endpoint in .env\n```bash\nSMS_WEBHOOK=\n````\n\nRun database migrations\n```bash\nphp artisan migrate\n````\n\nStart a queue worker\n```bash\nphp artisan queue:work --tries=3 --backoff=3\n````\n\n## 🔐 Authentication\n\nUse a fixed Bearer token for all requests:\n\n```\nAuthorization: Bearer test-key\n```\n\n## 📤 Sending Messages\n\n### Endpoint\n\n```\nPOST /api/message\n```\n\n### Request Formats\n\n#### ✅ JSON (application/json)\n\n```js\n{\n  \"to\": \"254700123123\", // or [\"254700123123\", \"254711456789\"] for queued bulk\n  \"message\": \"Hello world!\"\n}\n```\n\n#### ✅ Form-Data (multipart/form-data)\n\n```js\nto: \"254700123123\",\n// or for queued bulk\n// to[] = 254700123123\n// to[] = 254711456789\nmessage = \"Hello world!\"\n```\n\n### Validation Rules\n\n| Field     | Type            | Description                             |\n| --------- | --------------- | --------------------------------------- |\n| `to`      | string or array | International phone number(s), required |\n| `message` | string          | Message body, required                  |\n\n## 📬 Message Status Lifecycle\n\nMessages transition through the following statuses:\n\n```php\nenum MessageStatus: string {\n    case Queued = 'queued';\n    case Sent = 'sent';\n    case Delivered = 'delivered';\n    case Failed = 'failed';\n}\n```\n\n## 📡 Webhook Configuration\n\nSet your webhook URL in `.env`:\n\n```\nSMS_WEBHOOK=https://your-app.test/webhook\n```\n\n### Webhook Payload\n\n```js\n{\n    'event' =\u003e ...,\n    'data' =\u003e [\n        ...\n    ],\n}\n```\n\n## 🔁 Webhook Retry Strategy\n\n* ⏱ **Every 5 seconds** for 1 minute\n* ⏱ **Every 1 minute** for 5 minutes\n* ⏱ **Every 5 minutes** for 55 minutes\n* ⏱ **Every hour** until 24 hours total\n* ❌ **Stop retrying** after 24 hours\n\nPolling stops once a `200 OK` response is received.\n\n## 🧵 Job Classes\n\n| Job Class                | Description                                  |\n| ------------------------ | -------------------------------------------- |\n| `MockMessageSendJob`     | Simulates transition to `sent`               |\n| `MockMessageDeliveryJob` | Simulates transition to `delivered`/`failed` |\n| `PollDeliveryWebhookJob` | Polls the webhook URL                        |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevintoo%2Fmock-sms-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevintoo%2Fmock-sms-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevintoo%2Fmock-sms-server/lists"}