{"id":15109674,"url":"https://github.com/clivern/beaver","last_synced_at":"2025-05-14T14:08:44.114Z","repository":{"id":37382240,"uuid":"153948655","full_name":"Clivern/Beaver","owner":"Clivern","description":"💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.","archived":false,"fork":false,"pushed_at":"2025-05-07T10:23:57.000Z","size":3241,"stargazers_count":1568,"open_issues_count":9,"forks_count":84,"subscribers_count":30,"default_branch":"main","last_synced_at":"2025-05-07T11:29:48.566Z","etag":null,"topics":["beaver","hacktoberfest","messaging","messaging-service","pubsub","pusher","realtime","socket-io","socketjs","websocket"],"latest_commit_sha":null,"homepage":"https://clivern.github.io/Beaver/","language":"Go","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/Clivern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"custom":"clivern.com/sponsor/"}},"created_at":"2018-10-20T21:10:43.000Z","updated_at":"2025-04-30T12:00:53.000Z","dependencies_parsed_at":"2023-02-12T10:15:59.828Z","dependency_job_id":"1d6fa986-3075-43ca-b75d-3c3b2aef3b21","html_url":"https://github.com/Clivern/Beaver","commit_stats":{"total_commits":216,"total_committers":8,"mean_commits":27.0,"dds":0.2314814814814815,"last_synced_commit":"bd68afd9d44386b789e46d303f7f4a865ac4cc68"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clivern%2FBeaver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clivern%2FBeaver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clivern%2FBeaver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clivern%2FBeaver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Clivern","download_url":"https://codeload.github.com/Clivern/Beaver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254160450,"owners_count":22024569,"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":["beaver","hacktoberfest","messaging","messaging-service","pubsub","pusher","realtime","socket-io","socketjs","websocket"],"created_at":"2024-09-25T23:20:58.844Z","updated_at":"2025-05-14T14:08:44.061Z","avatar_url":"https://github.com/Clivern.png","language":"Go","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/Clivern/Beaver/main/assets/img/gopher.png\" width=\"200\" /\u003e\n    \u003ch3 align=\"center\"\u003eBeaver\u003c/h3\u003e\n    \u003cp align=\"center\"\u003eA Real Time Messaging Server.\u003c/p\u003e\n    \u003cp align=\"center\"\u003e\n        \u003ca href=\"https://github.com/Clivern/Beaver/actions/workflows/build.yml\"\u003e\n            \u003cimg src=\"https://github.com/Clivern/Beaver/actions/workflows/build.yml/badge.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/Clivern/Beaver/actions\"\u003e\n            \u003cimg src=\"https://github.com/Clivern/Beaver/workflows/Release/badge.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/Clivern/Beaver/releases\"\u003e\n            \u003cimg src=\"https://img.shields.io/badge/Version-1.5.0-red.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://goreportcard.com/report/github.com/Clivern/Beaver\"\u003e\n            \u003cimg src=\"https://goreportcard.com/badge/github.com/Clivern/Beaver?v=1.5.0\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://godoc.org/github.com/clivern/beaver\"\u003e\n            \u003cimg src=\"https://godoc.org/github.com/clivern/beaver?status.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/Clivern/Beaver/blob/master/LICENSE\"\u003e\n            \u003cimg src=\"https://img.shields.io/badge/LICENSE-MIT-orange.svg\"\u003e\n        \u003c/a\u003e\n    \u003c/p\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/Clivern/Beaver/main/assets/charts/chart.png?v=1.5.0\" width=\"60%\" /\u003e\n\u003c/p\u003e\n\nBeaver is a real-time messaging server. With beaver you can easily build scalable in-app notifications, realtime graphs, multiplayer games, chat applications, geotracking and more in web applications and mobile apps.\n\n\n## Documentation\n\n#### Run Beaver on Ubuntu\n\nDownload [the latest beaver binary](https://github.com/Clivern/Beaver/releases). Make it executable from everywhere.\n\n```zsh\n$ export BEAVER_LATEST_VERSION=$(curl --silent \"https://api.github.com/repos/Clivern/Beaver/releases/latest\" | jq '.tag_name' | sed -E 's/.*\"([^\"]+)\".*/\\1/' | tr -d v)\n\n$ curl -sL https://github.com/Clivern/Beaver/releases/download/v{$BEAVER_LATEST_VERSION}/beaver_{$BEAVER_LATEST_VERSION}_Linux_x86_64.tar.gz | tar xz\n```\n\nThen install `redis` cluster or a single node. Update the following config file with redis configs.\n\n\nCreate the configs file `config.yml` from `config.dist.yml`. Something like the following:\n\n```yaml\n# App configs\napp:\n    # Env mode (dev or prod)\n    mode: ${BEAVER_APP_MODE:-prod}\n    # HTTP port\n    port: ${BEAVER_API_PORT:-8080}\n    # Hostname\n    hostname: ${BEAVER_API_HOSTNAME:-127.0.0.1}\n    # TLS configs\n    tls:\n        status: ${BEAVER_API_TLS_STATUS:-off}\n        pemPath: ${BEAVER_API_TLS_PEMPATH:-cert/server.pem}\n        keyPath: ${BEAVER_API_TLS_KEYPATH:-cert/server.key}\n\n    # API Configs\n    api:\n        key: ${BEAVER_API_KEY:-6c68b836-6f8e-465e-b59f-89c1db53afca}\n\n    # Beaver Secret\n    secret: ${BEAVER_SECRET:-sWUhHRcs4Aqa0MEnYwbuQln3EW8CZ0oD}\n\n    # Runtime, Requests/Response and Beaver Metrics\n    metrics:\n        prometheus:\n            # Route for the metrics endpoint\n            endpoint: ${BEAVER_METRICS_PROM_ENDPOINT:-/metrics}\n\n    # Application Database\n    database:\n        # Database driver\n        driver: ${BEAVER_DB_DRIVER:-redis}\n\n        # Redis Configs\n        redis:\n            # Redis address\n            address: ${BEAVER_DB_REDIS_ADDR:-localhost:6379}\n            # Redis password\n            password: ${BEAVER_DB_REDIS_PASSWORD:- }\n            # Redis database\n            db: ${BEAVER_DB_REDIS_DB:-0}\n\n    # Log configs\n    log:\n        # Log level, it can be debug, info, warn, error, panic, fatal\n        level: ${BEAVER_LOG_LEVEL:-info}\n        # Output can be stdout or abs path to log file /var/logs/beaver.log\n        output: ${BEAVER_LOG_OUTPUT:-stdout}\n        # Format can be json\n        format: ${BEAVER_LOG_FORMAT:-json}\n```\n\nThe run the `beaver` with `systemd`\n\n```zsh\n$ beaver api -c /path/to/config.yml\n```\n\n### API Endpoints\n\nCreate a Config `app_name`:\n\n```bash\n$ curl -X POST \\\n    -H \"Content-Type: application/json\" \\\n    -H \"X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca\" \\\n    -d '{\"key\":\"app_name\",\"value\":\"Beaver\"}' \\\n    \"http://localhost:8080/api/config\"\n```\n\nGet a Config `app_name`:\n\n```bash\n$ curl -X GET \\\n    -H \"Content-Type: application/json\" \\\n    -H \"X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca\" \\\n    \"http://localhost:8080/api/config/app_name\"\n\n{\"key\":\"app_name\",\"value\":\"Beaver\"}\n```\n\nUpdate a Config `app_name`:\n\n```bash\n$ curl -X PUT \\\n    -H \"Content-Type: application/json\" \\\n    -H \"X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca\" \\\n    -d '{\"value\":\"Beaver\"}' \\\n    \"http://localhost:8080/api/config/app_name\"\n```\n\nDelete a Config `app_name`:\n\n```bash\n$ curl -X DELETE \\\n    -H \"Content-Type: application/json\" \\\n    -H \"X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca\" \\\n    \"http://localhost:8080/api/config/app_name\"\n```\n\nCreate a Channel:\n\n```bash\n# Private Channel\n$ curl -X POST \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '{\"name\": \"app_x_chatroom_1\", \"type\": \"private\"}' \\\n    'http://localhost:8080/api/channel'\n\n# Public Channel\n$ curl -X POST \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '{\"name\": \"app_y_chatroom_1\", \"type\": \"public\"}' \\\n    'http://localhost:8080/api/channel'\n\n# Presence Channel\n$ curl -X POST \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '{\"name\": \"app_z_chatroom_5\", \"type\": \"presence\"}' \\\n    'http://localhost:8080/api/channel'\n```\n\nGet a Channel:\n\n```bash\n$ curl -X GET \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '' \\\n    'http://localhost:8080/api/channel/app_x_chatroom_1'\n{\n    \"created_at\":1545573214,\n    \"listeners_count\":0,\n    \"name\":\"app_x_chatroom_1\",\n    \"subscribers_count\":0,\n    \"type\":\"private\",\n    \"updated_at\":1545573214\n}\n\n$ curl -X GET \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '' \\\n    'http://localhost:8080/api/channel/app_y_chatroom_1'\n{\n    \"created_at\":1545573219,\n    \"listeners_count\":0,\n    \"name\":\"app_y_chatroom_1\",\n    \"subscribers_count\":0,\n    \"type\":\"public\",\n    \"updated_at\":1545573219\n}\n\n$ curl -X GET \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '' \\\n    'http://localhost:8080/api/channel/app_z_chatroom_5'\n{\n    \"created_at\": 1545573225,\n    \"listeners\": null,\n    \"listeners_count\": 0,\n    \"name\": \"app_z_chatroom_5\",\n    \"subscribers\": null,\n    \"subscribers_count\": 0,\n    \"type\": \"presence\",\n    \"updated_at\": 1545573225\n}\n```\n\nUpdate a Channel `app_y_chatroom_1`:\n\n```bash\n$ curl -X PUT \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '{\"type\": \"private\"}' \\\n    'http://localhost:8080/api/channel/app_y_chatroom_1'\n```\n\nDelete a Channel `app_y_chatroom_1`:\n\n```bash\n$ curl -X DELETE \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '' \\\n    'http://localhost:8080/api/channel/app_y_chatroom_1'\n```\n\nCreate a Client and add to `app_x_chatroom_1` Channel:\n\n```bash\n$ curl -X POST \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '{\"channels\": [\"app_x_chatroom_1\"]}' \\\n    'http://localhost:8080/api/client'\n{\n    \"channels\": [\n        \"app_x_chatroom_1\"\n    ],\n    \"created_at\": 1545575142,\n    \"id\": \"69775af3-5f68-4725-8162-09cab63e8427\",\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiNjk3NzVhZjMtNWY2OC00NzI1LTgxNjItMDljYWI2M2U4NDI3QDE1NDU1NzUxNDIiLCJ0aW1lc3RhbXAiOjE1NDU1NzUxNDJ9.EqL-nWwu5p7hJXWrKdZN3Ds2cxWVjNYmeP1mbl562nU\",\n    \"updated_at\": 1545575142\n}\n```\n\nGet a Client `69775af3-5f68-4725-8162-09cab63e8427`:\n\n```bash\n$ curl -X GET \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '' \\\n    'http://localhost:8080/api/client/69775af3-5f68-4725-8162-09cab63e8427'\n{\n    \"channels\": [\n        \"app_x_chatroom_1\"\n    ],\n    \"created_at\": 1545575142,\n    \"id\": \"69775af3-5f68-4725-8162-09cab63e8427\",\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiNjk3NzVhZjMtNWY2OC00NzI1LTgxNjItMDljYWI2M2U4NDI3QDE1NDU1NzUxNDIiLCJ0aW1lc3RhbXAiOjE1NDU1NzUxNDJ9.EqL-nWwu5p7hJXWrKdZN3Ds2cxWVjNYmeP1mbl562nU\",\n    \"updated_at\": 1545575142\n}\n```\n\nSubscribe a Client `69775af3-5f68-4725-8162-09cab63e8427` to a Channel `app_z_chatroom_5`:\n\n```bash\n$ curl -X PUT \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '{\"channels\": [\"app_z_chatroom_5\"]}' \\\n    'http://localhost:8080/api/client/69775af3-5f68-4725-8162-09cab63e8427/subscribe'\n```\n\nUnsubscribe a Client `69775af3-5f68-4725-8162-09cab63e8427` from a Channel `app_z_chatroom_5`:\n\n```bash\n$ curl -X PUT \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '{\"channels\": [\"app_z_chatroom_5\"]}' \\\n    'http://localhost:8080/api/client/69775af3-5f68-4725-8162-09cab63e8427/unsubscribe'\n```\n\nDelete a Client:\n\n```bash\n$ curl -X DELETE \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '' \\\n    'http://localhost:8080/api/client/69775af3-5f68-4725-8162-09cab63e8427'\n```\n\nPublish to a Channel `app_x_chatroom_1`:\n\n```bash\n$ curl -X POST \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '{\"channel\": \"app_x_chatroom_1\", \"data\": \"{\\\"message\\\": \\\"Hello World\\\"}\"}' \\\n    'http://localhost:8080/api/publish'\n```\n\nBroadcast to Channels `[\"app_x_chatroom_1\"]`:\n\n```bash\n$ curl -X POST \\\n    -H 'Content-Type: application/json' \\\n    -H 'X-API-Key: 6c68b836-6f8e-465e-b59f-89c1db53afca' \\\n    -d '{\"channels\": [\"app_x_chatroom_1\"], \"data\": \"{\\\"message\\\": \\\"Hello World\\\"}\"}' \\\n    'http://localhost:8080/api/broadcast'\n```\n\nSample Frontend Client\n\n```js\nfunction Socket(url){\n    ws = new WebSocket(url);\n    ws.onmessage = function(e) { console.log(e); };\n    ws.onclose = function(){\n        // Try to reconnect in 5 seconds\n        setTimeout(function(){Socket(url)}, 5000);\n    };\n}\n\nSocket(\"ws://localhost:8080/ws/$ID/$TOKEN\");\n```\n\n\n## Client:\n\n- [Go Client](https://github.com/domgolonka/beavergo) Thanks [@domgolonka](https://github.com/domgolonka)\n\n\n## Versioning\n\nFor transparency into our release cycle and in striving to maintain backward compatibility, Beaver is maintained under the [Semantic Versioning guidelines](https://semver.org/) and release process is predictable and business-friendly.\n\nSee the [Releases section of our GitHub project](https://github.com/clivern/beaver/releases) for changelogs for each release version of Beaver. It contains summaries of the most noteworthy changes made in each release.\n\n\n## Bug tracker\n\nIf you have any suggestions, bug reports, or annoyances please report them to our issue tracker at https://github.com/clivern/beaver/issues\n\n\n## Security Issues\n\nIf you discover a security vulnerability within Beaver, please send an email to [hello@clivern.com](mailto:hello@clivern.com)\n\n\n## Contributing\n\nWe are an open source, community-driven project so please feel free to join us. see the [contributing guidelines](CONTRIBUTING.md) for more details.\n\n\n## License\n\n© 2018, Clivern. Released under [MIT License](https://opensource.org/licenses/mit-license.php).\n\n**Beaver** is authored and maintained by [@Clivern](http://github.com/clivern).\n","funding_links":["clivern.com/sponsor/"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclivern%2Fbeaver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclivern%2Fbeaver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclivern%2Fbeaver/lists"}