{"id":17309568,"url":"https://github.com/jcubic/dialogue","last_synced_at":"2025-07-26T07:02:44.191Z","repository":{"id":239451437,"uuid":"796653789","full_name":"jcubic/dialogue","owner":"jcubic","description":"Web-based Chat Library","archived":false,"fork":false,"pushed_at":"2024-12-05T21:48:24.000Z","size":80,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T06:11:48.082Z","etag":null,"topics":["chat","chat-app","chat-app-using-firebase","chat-application"],"latest_commit_sha":null,"homepage":"https://jcubic.github.io/dialogue/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcubic.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":"2024-05-06T11:24:17.000Z","updated_at":"2024-12-05T21:48:27.000Z","dependencies_parsed_at":"2024-05-12T15:42:43.173Z","dependency_job_id":"d27280da-f0f2-4f48-9b91-8b9b4c6b361e","html_url":"https://github.com/jcubic/dialogue","commit_stats":null,"previous_names":["jcubic/dialogue"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcubic%2Fdialogue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcubic%2Fdialogue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcubic%2Fdialogue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcubic%2Fdialogue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcubic","download_url":"https://codeload.github.com/jcubic/dialogue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245756802,"owners_count":20667226,"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":["chat","chat-app","chat-app-using-firebase","chat-application"],"created_at":"2024-10-15T12:29:56.582Z","updated_at":"2025-03-27T00:23:21.104Z","avatar_url":"https://github.com/jcubic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dialogue\n\n[Chat JavaScript Open Source library](https://jcubic.github.io/dialogue/)\n\n## Usage\n\n### Terminal and Firebase\n\n```javascript\nimport { Dialogue, FirebaseAdapter, Terminal } from \"https://esm.sh/dialogue\";\n\nconst term = $('body').terminal($.noop, {\n    exceptionHandler(e) {\n        this.error(`Error: ${e.message}`);\n    },\n    greetings: false\n});\n\nconst firebase_config = {\n    /* your firebase config */\n};\n\nconst adapter = new FirebaseAdapter(firebase_config);\nconst renderer = new Terminal(term);\n\n// example of using Joke API with Programming jokes\nasync function random_joke() {\n    const res = await fetch('https://v2.jokeapi.dev/joke/Programming');\n    const data = await res.json();\n    if (data.type == 'twopart') {\n        return [\n            `Q: ${data.setup}`,\n            `A: ${data.delivery}`\n        ].join('\\n');\n    } else  if (data.type === 'single') {\n        return data.joke;\n    }\n}\n\nconst dialogue = new Dialogue({\n    adapter,\n    renderer,\n    commands(command, args) {\n        // custom system command\n        if (command === '/joke') {\n            const joke = await random_joke();\n            if (joke) {\n                adapter.send(adapter.get_user(), adapter.utc_now(), joke);\n            } else {\n                renderer.echo('\u003cred\u003eFailed to get joke\u003c/red\u003e');\n            }\n        }\n    }\n});\nawait dialogue.start();\nterm.exec('/join general');\n```\n\n## TODO\n- [x] Notifications\n- [x] \u003cdel\u003ePush Notifications\u003c/del\u003e\n- [x] \u003cdel\u003eSound Notifications\u003c/del\u003e\n- [ ] Online users per room\n- [ ] UI\n  - [ ] React\n  - [ ] Vanilla Javascript Minimalistic [CodePen](https://codepen.io/jcubic/pen/xxzjQRd)\n  - [x] Terminal\n    - [x] chat command\n- [ ] Adapters\n  - [x] Firebase\n  - [ ] Server-Sent Events / PHP [jcubic/chat](https://github.com/jcubic/chat)\n  - [ ] Web Sockets / Node.js\n  - [ ] WebRTC [CodePen](https://codepen.io/jcubic/pen/xxzjQRd)\n- [ ] /help command connected to UI\n  - [ ] Terminal using less\n  - [ ] Credits at the bottom of help\n  - [ ] Maybe written in Markdown\n- [ ] Setup CLA\n- [ ] Add a way to obtain a commerial License\n- [ ] website with React+Firebase Chat above the fold\n- [ ] js.org domain\n\n## License\nCopyright (c) 2024 [Jakub T. Jankiewicz](https://jakub.jankiewicz.org/)\u003cbr/\u003e\nReleased under [AGPL v3 license](https://github.com/jcubic/dialogue/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcubic%2Fdialogue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcubic%2Fdialogue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcubic%2Fdialogue/lists"}