{"id":18331209,"url":"https://github.com/bankole2000/pocketbase-rabbitmq-extension","last_synced_at":"2025-04-09T18:13:25.032Z","repository":{"id":235727224,"uuid":"791105761","full_name":"Bankole2000/pocketbase-rabbitmq-extension","owner":"Bankole2000","description":"Pocketbase extended with golang to publish events to rabbitmq","archived":false,"fork":false,"pushed_at":"2024-05-01T15:29:09.000Z","size":764,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T18:13:22.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Bankole2000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["bankole2000"]}},"created_at":"2024-04-24T05:28:55.000Z","updated_at":"2024-04-24T05:30:33.000Z","dependencies_parsed_at":"2024-11-05T19:54:39.634Z","dependency_job_id":null,"html_url":"https://github.com/Bankole2000/pocketbase-rabbitmq-extension","commit_stats":null,"previous_names":["bankole2000/pocketbase-rabbitmq-extension"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bankole2000%2Fpocketbase-rabbitmq-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bankole2000%2Fpocketbase-rabbitmq-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bankole2000%2Fpocketbase-rabbitmq-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bankole2000%2Fpocketbase-rabbitmq-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bankole2000","download_url":"https://codeload.github.com/Bankole2000/pocketbase-rabbitmq-extension/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085326,"owners_count":21045139,"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":[],"created_at":"2024-11-05T19:28:42.669Z","updated_at":"2025-04-09T18:13:25.026Z","avatar_url":"https://github.com/Bankole2000.png","language":"Go","funding_links":["https://github.com/sponsors/bankole2000"],"categories":[],"sub_categories":[],"readme":"## Pocketbase Extended with Go + RabbitMQ\n\n\u003cbr /\u003e\n\u003cp float=\"left\" align=\"middle\"\u003e\n  \u003ca href=\"https://pocketbase.io\"\u003e\n    \u003cimg src=\"./media/pocketbaselogo.svg\" alt=\"Logo\" width=\"100\" height=\"100\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"./media/plus-icon.svg\" alt=\"Logo\" width=\"50\" style=\"margin: 20px\" height=\"50\"\u003e\n  \u003ca href=\"https://www.rabbitmq.com/\" target=\"_blank\"\u003e\n    \u003cimg src=\"./media/rabbitmq-logo.svg\" alt=\"Logo\" width=\"80\" height=\"90\"\u003e\n  \u003c/a\u003e\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n### A simple Pocketbase RabbitMQ publisher extension template\n\n![Publishing with Rabbit MQ][demo-gif]\n\n### What it does\n\n- Publish any and all events from pocketbase to rabbitmq exchange\n\n- Select and customize published events\n\n- Useful for multiple scenarios like data replication, horizontal scaling, single source of truth accross microservices, async data processing \u0026 event handling etc\n\n### Prerequisites\n\n- [Golang](https://go.dev/) \u003e= v1.19\n  \n- [RabbitMQ](https://www.rabbitmq.com/) (Running locally or in the cloud)\n- [NodeJS](https://nodejs.org) (Optional - for testing the listener)\n\n### Setup \u0026 installation\n\n1. Clone or fork this repository (or use this template)\n\n    ```sh\n    git clone https://github.com/bankole2000/pb-rmq-ext.git\n    ```\n\n2. init go dependencies in `/pocketbase-publisher` folder\n\n    ```bash\n    # in /pocketbase-publisher folder\n    go mod init \u003capp-name\u003e \u0026\u0026 go mod tidy\n    # Note: \u003capp-name\u003e can be whatever you want but\n    # will be name of the executable file created on build\n    ```\n\n3. install node dependences in `/listener-demo` folder (optional)\n\n    ```sh\n    # in /listener-demo folder\n    npm i\n    ```\n\n4. Following the example in `.env.example` Create `.env` file in the root folder and fill in environemental\n\n    ```SH\n    # in /.env file\n    RABBITMQ_URL=\"amqp://\u003cusername\u003e:\u003cpassword\u003e@\u003crabbitmq-host\u003e:\u003crabbitmg-port\u003e/\"\n    RABBITMQ_EXCHANGE=\"my-exchange\"\n    # replace with your rabbitmq url and any name you wish to give the exchange\n    ```\n\n#### No RabbitMQ? No problem\n\nThis step requires [docker](https://www.docker.com/) - To get a local instance of Rabbitmq running simply run\n\n```docker\ndocker run -d --hostname localhost -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:3-management\n```\n\nOr run `docker compose up` using [this docker compose yml file](./media/docker-compose.yml)\n\n### How To Use\n\n1. Start the pocketbase application\n\n   ```sh\n   # in /pocketbase-publisher folder\n   go run main.go serve\n   ```\n\n2. Start up the message/event listener\n\n   ```sh\n   # in /listener-demo\n   npm run dev\n   ```\n\n3. Use the pocketbase api or sdk or admin (running on `http://127.0.0.1:8090/_/`) as you normally would (creating collections, records etc) and watch the events logged by the listener.\n\n4. To build a statically linked single file application, you can run\n\n   ```sh\n   # create build file\n   CGO_ENABLED=0 go build\n   # run created executable\n   ./my-app serve\n   ```\n\n\u003e ⚠ Warning: If you run into any `gcc failed` errors running `go run main.go serve` , try setting  `CGO_ENABLED=0` environment variable according to the [pocketbase docs here](https://pocketbase.io/docs/go-overview/)\n\n\u003e 📝 Note: in the `/pocketbase-publisher/main.go` file, you can also change the values of `rmqUrl` and `exchange` variables on _lines 55_ and _56_ to the string values of your rabbitmq Url and the exchange name. This way the build won't rely on the `.env` file to run (be sure to delete or comment out the `goDotEnvVariable` function in _line 39_)\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nAny contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'feat: added some amazing feature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\n📧 Shoot me an email - \u003ctechybanky@gmail.com\u003e\n\n🌎 My Website - [The Neon Coder](https://bankole2000.github.io/webpieces)\n\n💼 Project Link: [https://github.com/bankole2000/pocketbase-rabbitmq-extension](https://github.com/bankole2000/pocketbase-rabbitmq-extension)\n\n\u003c!-- ACKNOWLEDGEMENTS\n## Acknowledgements\n\n- [GitHub Emoji Cheat Sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet)\n- [Img Shields](https://shields.io)\n- [Choose an Open Source License](https://choosealicense.com)\n- [GitHub Pages](https://pages.github.com)\n- [Animate.css](https://daneden.github.io/animate.css)\n- [Loaders.css](https://connoratherton.com/loaders)\n- [Slick Carousel](https://kenwheeler.github.io/slick)\n- [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)\n- [Sticky Kit](http://leafo.net/sticky-kit)\n- [JVectorMap](http://jvectormap.com)\n- [Font Awesome](https://fontawesome.com) --\u003e\n\n[demo-gif]: ./media/publisher.gif\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbankole2000%2Fpocketbase-rabbitmq-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbankole2000%2Fpocketbase-rabbitmq-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbankole2000%2Fpocketbase-rabbitmq-extension/lists"}