{"id":26760834,"url":"https://github.com/altendorfme/alo","last_synced_at":"2025-03-28T18:01:53.440Z","repository":{"id":280502879,"uuid":"939094303","full_name":"altendorfme/alo","owner":"altendorfme","description":"Alô is the open source alternative to OneSignal, PushNews, SendPulse, PushAlert, and others.","archived":false,"fork":false,"pushed_at":"2025-03-25T03:36:59.000Z","size":2133,"stargazers_count":25,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T04:27:03.427Z","etag":null,"topics":["firebase","onesignal","push","push-notifications","webpush","webpush-notifications"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/altendorfme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-02-26T01:28:15.000Z","updated_at":"2025-03-25T03:36:59.000Z","dependencies_parsed_at":"2025-03-03T20:22:15.915Z","dependency_job_id":"f93d5653-0786-4178-9247-924a84477182","html_url":"https://github.com/altendorfme/alo","commit_stats":null,"previous_names":["altendorfme/pushbase","altendorfme/alo"],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altendorfme%2Falo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altendorfme%2Falo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altendorfme%2Falo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altendorfme%2Falo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/altendorfme","download_url":"https://codeload.github.com/altendorfme/alo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246076840,"owners_count":20719892,"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","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":["firebase","onesignal","push","push-notifications","webpush","webpush-notifications"],"created_at":"2025-03-28T18:01:22.568Z","updated_at":"2025-03-28T18:01:53.396Z","avatar_url":"https://github.com/altendorfme.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Alô 🚀📬\n\n[![Forks](https://img.shields.io/github/forks/altendorfme/alo)](https://github.com/altendorfme/alo/network/members)\n[![Stars](https://img.shields.io/github/stars/altendorfme/alo)](https://github.com/altendorfme/alo/stargazers)\n[![Issues](https://img.shields.io/github/issues/altendorfme/alo)](https://github.comaltendorfme/aloa/issues)\n\n![alo](https://github.com/altendorfme/alo/blob/main/alo.gif?raw=true)\n\nAlô is a tool for managing and registering Web Push notifications. It also provides features for campaign management, analytics, and user segmentation.\n\nAlô is the open source alternative to OneSignal, PushNews, SendPulse, PushAlert, and others.\n\n## Installation with Docker 🐳\n\nInstall [Docker and Docker Compose](https://docs.docker.com/engine/install/)\n\n`curl -o ./docker-compose.yml https://raw.githubusercontent.com/altendorfme/alo/main/docker-compose.yml`\n\n`curl -o ./.env https://raw.githubusercontent.com/altendorfme/alo/main/docker.env.example`\n\nEdit environment:\n\n`nano .env`\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| TZ | UTC | Timezone for the application |\n| WORKERS | 1 | Each worker is a push service, each worker sends 5-6 pushes per second. Increasing the number of workers will directly impact database usage. |\n| AMQP_USER | Empty | Username for AMQP message broker authentication |\n| AMQP_PASS | Empty | Password for AMQP message broker authentication |\n| AMQP_VHOST | alo | Virtual host for AMQP to isolate applications |\n| MYSQL_DATABASE | alo | Name of the MySQL database for alo |\n| MYSQL_USER | alo | Username for MySQL database authentication |\n| MYSQL_PASSWORD | Empty | Password for MySQL database authentication |\n\n**AMQP**: RabbitMQ is used by default, but LavinMQ has also been tested and works correctly.\n\nNow just run `docker compose up -d`\n\n## First-Time Setup 🔧\n1. Access the installation at `https://site.xyz/install`\n2. Complete the initial configuration\n3. Log in to the admin panel at `https://site.xyz/login`\n\n## Who is using it?\n- [Manual do Usuário](https://manualdousuario.net)\n- [Catraca Livre](https://catracalivre.com.br)\n\n## Alô SDK 📱\n\nYou'll need the alo Client SDK on all your pages:\n\n```javascript\nimport aloClient from 'https://alo-server.xyz/clientSDK';\n```\n\nJust drop this in, and you're ready to roll! The SDK gets set up with different options depending on what you want to do with it.\n\n### Automatic Subscription ⚡\n\nThis option will show the permission prompt after a short delay - no user clicks needed!\n\n```javascript\nconst aloConfig = {\n    customSegments: {\n        tag: 'tag-teste-auto',\n        category: 'cat-teste-auto'\n    },\n    registrationMode: 'auto',  // ← Magic happens here!\n    registrationDelay: 3000,   // Just 3 seconds wait\n    enableLogging: true,\n    onRegistrationSuccess: () =\u003e {\n        alert('Push notification registration successful!');\n    },\n    onRegistrationError: (error) =\u003e {\n        alert('Registration failed: ' + error.message);\n    }\n};\nconst aloClient = new aloClient(aloConfig);\n```\n\nThe secret sauce here is `registrationMode: 'auto'` - this tells alo to automatically ask for permission. You can control how long to wait with the `registrationDelay` setting.\n\n### Manual Subscription 👆\n\nPrefer to let users decide when to subscribe? This approach requires a click before asking for permission.\n\n```javascript\nconst aloConfig = {\n    customSegments: {\n        tag: 'tag-test-manual',\n        category: 'cat-test-manual'\n    },\n    registrationMode: 'manual',  // ← User control!\n    enableLogging: true\n};\nconst aloClient = new aloClient(aloConfig);\n\nsubscribeBtn.addEventListener('click', async () =\u003e {\n    try {\n        await aloClient.subscribe();\n        alert('Push notification subscription successful!');\n        subscribeBtn.disabled = true;\n    } catch (error) {\n        alert('Subscription failed: ' + error.message);\n    }\n});\n```\n\nWith `registrationMode: 'manual'`, alo waits patiently until you call `subscribe()`. Perfect for adding to a \"Subscribe\" button!\n\n### Unsubscription 👋\n\nSometimes users want to say goodbye to notifications. Here's how to let them unsubscribe:\n\n```javascript\nconst aloConfig = {\n    customSegments: {\n        tag: 'tag-test-unsubscribe',\n        category: 'cat-test-unsubscribe'\n    },\n    enableLogging: true\n};\n\nconst aloClient = new aloClient(aloConfig);\n\nunsubscribeBtn.addEventListener('click', async () =\u003e {\n    try {\n        await aloClient.unsubscribe();\n        alert('Push notification unsubscription successful!');\n        unsubscribeBtn.disabled = true;\n    } catch (error) {\n        alert('Unsubscription failed:' + error.message);\n    }\n});\n```\n\nJust hook up an \"Unsubscribe\" button to the `unsubscribe()` method, and you're good to go!\n\n### 🤖 Service Worker\n\nYour notifications need a Service Worker to function even when users aren't on your site:\n\n```javascript\nimportScripts('https://alo-server.xyz/serviceWorker');\n```\n\nJust put this in your `aloSW.js` file, and alo handles all the background notification magic for you! ✨\n\n## API 📡\n\n### Create Campaign\n\nCreates a new campaign with `draft` status.\n\n**URL**: `/api/campaign/create` (POST)\n\n**Request Body**:\n```json\n{\n  \"name\": \"My Campaign\",\n  \"push_title\": \"Check out our new feature!\",\n  \"push_body\": \"We've just launched something amazing you'll love.\",\n  \"push_icon\": \"https://example.com/icon.png\",\n  \"push_url\": \"https://example.com/landing\",\n  \"push_requireInteraction\": true\n}\n```\n\n**cURL Example**:\n```bash\ncurl -X POST \\\n  https://alo-server.xyz/api/campaign/create \\\n  -H 'Authorization: Bearer YOUR_API_TOKEN' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"name\": \"My Campaign\",\n    \"push_title\": \"Check out our new feature!\",\n    \"push_body\": \"We have just launched something amazing you will love.\",\n    \"push_icon\": \"https://example.com/icon.png\",\n    \"push_url\": \"https://example.com/landing\"\n  }'\n```\n\n**Success Response**:\n```json\n{\n  \"success\": true,\n  \"message\": \"Campaign created successfully\",\n  \"campaign\": {\n    \"id\": 123,\n    \"uuid\": \"550e8400-e29b-41d4-a716-446655440000\",\n    \"name\": \"My Campaign\",\n    \"push_title\": \"Check out our new feature!\",\n    \"push_body\": \"We have just launched something amazing you will love.\",\n    \"push_icon\": \"https://example.com/icon.png\",\n    \"push_url\": \"https://example.com/landing\",\n    \"status\": \"draft\",\n    \"created_at\": \"2025-03-05 13:58:45\",\n    \"updated_at\": \"2025-03-05 13:58:45\"\n  }\n}\n```\n\n**Error Response**:\n```json\n{\n  \"error\": \"Field 'push_body' is required\"\n}\n```\n\n## Contributing 🤝\nMade with ❤️! If you have questions or suggestions, open an issue and we'll help!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltendorfme%2Falo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faltendorfme%2Falo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltendorfme%2Falo/lists"}