{"id":24087976,"url":"https://github.com/tinybirdco/demo-user-facing-analytics-confluent","last_synced_at":"2025-02-27T05:21:29.845Z","repository":{"id":233604874,"uuid":"787520741","full_name":"tinybirdco/demo-user-facing-analytics-confluent","owner":"tinybirdco","description":"Build user-facing analytics dashboards into a React app using Confluent and Tinybird","archived":false,"fork":false,"pushed_at":"2024-05-03T17:57:49.000Z","size":431,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-10T03:56:20.853Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/tinybirdco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2024-04-16T17:21:22.000Z","updated_at":"2024-05-03T17:58:32.000Z","dependencies_parsed_at":"2024-05-03T03:57:05.765Z","dependency_job_id":null,"html_url":"https://github.com/tinybirdco/demo-user-facing-analytics-confluent","commit_stats":null,"previous_names":["tinybirdco/demo-user-facing-analytics-color-picker","tinybirdco/demo-user-facing-analytics-confluent"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fdemo-user-facing-analytics-confluent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fdemo-user-facing-analytics-confluent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fdemo-user-facing-analytics-confluent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fdemo-user-facing-analytics-confluent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinybirdco","download_url":"https://codeload.github.com/tinybirdco/demo-user-facing-analytics-confluent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240982540,"owners_count":19888523,"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":"2025-01-10T03:56:44.318Z","updated_at":"2025-02-27T05:21:29.827Z","avatar_url":"https://github.com/tinybirdco.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Build user-facing analytics dashboards into your React app with Tinybird and Confluent\n\nLearn how to build a React app that emits data to a Confluent topic, uses Tinybird to query data and publish APIs, and integrate those APIs into a React app for user-facing analytics.\n\n![Gif of the final game](/img/game-gif.gif)\n\n### Prerequisites\n\n- Python 3.8 (only if you use the data generator)\n- Node.js\n\n## Instructions\n\nFollow these instructions to deploy the working version of this application.\n\n### 0. Create a free Tinybird Workspace\n\nFirst, create a [free Tinybird account](https://www.tinybird.co/signup). Then create a new Workspace when prompted. You can name it whatever you want.\n\n### 1. Clone the repository\n\n```sh\ngit clone https://github.com/tinybirdco/demo-user-facing-analytics-confluent.git\ncd demo-user-facing-analytics-confluent\n```\n\n### 2. Install app dependencies\n\n```sh\ncd app\nnpm install\n```\n\n### 3. Create a Confluent Cloud Cluster and Topic\n\nNote: You can use any Kafka technology, including Apache Kafka, Confluent Cloud, Redpanda, etc. with minimal changes.\n\nIf you haven't done so, [sign up](https://confluent.cloud/signup) for a Confluent Cloud account. Then create a cluster. Once you've created a cluster, create a topic called `game-events`. Once you've created a topic, create a key/secret pair to allow you to produce events to your new topic.\n\nIn addition, add the following to your `.env.local`:\n\n```sh\nCONFLUENT_CLIENT_ID='\u003cyour cluster id\u003e'\nCONFLUENT_BROKER_URL='\u003cyour boostrap server url\u003e'\nCONFLUENT_API_KEY='\u003cyour confluent key\u003e'\nCONFLUENT_API_SECRET='\u003cyour confluent secret\u003e'\n```\n\n### 4. Install the Tinybird CLI\n\n```sh\ncd tinybird\npython -m venv .venv\nsource .e/bin/activate\npip install tinybird-cli\n```\n\n### 5. Authenticate to Tinybird\n\nCopy your User Admin Token from the Tinybird UI. Your user admin token is the token with the format admin \u003cyour email address\u003e.\n\nFrom the `/tinybird` directory, run the following command:\n\n```sh\nexport TB_TOKEN=\u003cyour user admin token\u003e\ntb auth\n```\n\n\u003e :warning: Your token and workspace details will be stored in a .tinyb file. If you intend to push this to a public repository, add the `.tinyb` to your `.gitignore`.\n\n### 6. Connect Confluent to Tinybird\n\nRun the following command to connect your Tinybird Workspace to your Redpanda cluster.\n\n```sh\ncd tinybird\ntb connection create kafka --bootstrap-servers \u003cyour confluent boostrap server\u003e --key \u003cyour confluent key\u003e --secret \u003cyour confluent secret\u003e --connection-name confluent\n```\n\n\u003e Note: You can also do this from the Tinybird UI.\n\n### 7. Push the resources to Tinybird\n\nRun the following command to push Tinybird resources to the Tinybird server.\n\n```sh\ncd tinybird\ntb push --force\n```\n\n### 9. Add your Tinybird host and token to .env\n\nOpen your `env.local` and add the following:\n\n```\nTINYBIRD_HOST=\u003cyour tinybird host\u003e\u003e\nTINYBIRD_TOKEN=\u003cthe read_endpoints token from your Workspace\u003e\n```\n\nNote you can copy the `read_endpoints` token from the Tinybird CLI with `tb token copy read_endpoints`.\n\n### 10. Run the proxy server\n\nThis app uses a proxy to handle requests to Confluent and to store Tinybird tokens. Run the proxy server from the `/services` directory:\n\n```\nnode confluent-proxy.js\n```\n\nIf you visit `http://localhost:3001` you'll see a message that the microservice is running.\n\n### 11. Run the app!\n\nRun the application!\n\n```sh\nnpm run dev\n```\n\nOpen it at `http://localhost:3000` and play the game. Have fun!\n\n## Contributing\n\nIf you find any issues or have suggestions for improvements, please submit an issue or a [pull request](https://github.com/tinybirdco/demo-user-facing-analytics-color-picker/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc).\n\n## License\n\nThis code is available under the MIT license. See the [LICENSE](https://github.com/tinybirdco/demo-user-facing-analytics-color-picker/blob/main/LICENSE.txt) file for more details.\n\n## Need help?\n\n\u0026bull; [Community Slack](https://www.tinybird.co/community) \u0026bull; [Tinybird Docs](https://www.tinybird.co/docs) \u0026bull;\n\n## Authors\n\n- [Cameron Archer](https://github.com/tb-peregrine)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybirdco%2Fdemo-user-facing-analytics-confluent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinybirdco%2Fdemo-user-facing-analytics-confluent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybirdco%2Fdemo-user-facing-analytics-confluent/lists"}