{"id":23139084,"url":"https://github.com/circuit/circuit-chat-app","last_synced_at":"2025-04-04T10:11:43.445Z","repository":{"id":38975710,"uuid":"108340819","full_name":"circuit/circuit-chat-app","owner":"circuit","description":"Chat with your favorite users quickly via this native tray application","archived":false,"fork":false,"pushed_at":"2023-01-06T01:31:30.000Z","size":1334,"stargazers_count":1,"open_issues_count":15,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-02-09T20:33:45.328Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/circuit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-26T00:19:00.000Z","updated_at":"2020-10-02T14:20:23.000Z","dependencies_parsed_at":"2023-02-05T01:32:45.485Z","dependency_job_id":null,"html_url":"https://github.com/circuit/circuit-chat-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/circuit%2Fcircuit-chat-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/circuit%2Fcircuit-chat-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/circuit%2Fcircuit-chat-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/circuit%2Fcircuit-chat-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/circuit","download_url":"https://codeload.github.com/circuit/circuit-chat-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247157283,"owners_count":20893220,"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-12-17T13:13:13.799Z","updated_at":"2025-04-04T10:11:43.418Z","avatar_url":"https://github.com/circuit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Circuit Chat app\n\nChat with your favorite users quickly via this native (Windows \u0026 Mac) tray application built with electron and the Circuit JS SDK. Trays for up to five users are created which allow chat and calls via Circuit.\n\n## Features\n\n* Configure up to 5 direct conversations to show as tray. If none configured the first 5 favorites are used.\n* Chat and direct calls\n* Show presence status in tray avatar and detailed presence in chat window.\n* Show unread indicator on tray avatar\n* Quick link to Circuit conversation. Click on name or avatar in chat window.\n* Cross platform: Mac and Windows (Linux should work too, but not tested)\n\n## Goals\n* Usage of [Circuit JS SDK](https://github.com/circuit/circuit-sdk) in a desktop app based on [electron](https://electron.atom.io/)\n* Specifically how to use the SDK in a renderer process so that the Circuit WebRTC APIs can be used\n* Demonstrate simple cross-platform implementation using electron\n\n\n## Screenshots\n\u003cdiv style=\"display:inline\"\u003e\n\u003cimg height=\"400px\" src=\"./mac.png\"/\u003e\n\u003c/div\u003e\n\n\u003e On Windows the tray is probably not the best solution for this. Taskbar might be better.\n\n## Architecture\n\nThe Circuit WebRTC APIs are not available in the Cirucit Node.JS SDK due to the fact that Node.js does not contain a WebRTC stack. Electron is made up of Node.js and Chromium and therefore within a Chromium renderer process the Circuit WebRTC APIs can be used.\n\nThis chat app opens individual chat windows for each user which means either every chat window needs it own JS SDK \u0026 login etc, or a common renderer process is used as single SDK access. The later is chosen as this only requires a single websocket connection to the Circuit servers (/renderer/circuit/index.js).\n\nThe suggested OAuth authentication method for desktop application is Authorization Code, and since the browser JS SDK does not support the authentication part is done in the main process (/main/oauth.js). Once authenticated and the access token is available, the token is handed over to a proxy class that acts as intermediate between main process APIs calls and the Circuit SDK renderer.\n\nFor the two-way binding and rendering of the chat window [hyperHTML](https://github.com/WebReflection/hyperHTML) is used.\n\n[electron-builder](https://github.com/electron-userland/electron-builder) is used to build and package the app as Mac and Windows installers.\n\n### Components\n\n#### Main process components\n* index.js: Entry point of app. Manages lifecycle events.\n* oauth.js: Handles OAuth 2.0 Authorization Code flow and returns access token\n* sdkProxy.js: Proxy Circuit SDK API calls and events for main process modules and to renderer windows\n* trayManager.js: Manages the main Circuit tray item and maintains a list individual user trays (trayItems)\n* trayCircuit.js: The main Circuit tray with its context menu\n* trayItem.js: Manages the chat window for this tray\n\n#### Renderer process components/windows\n* /circuit: Circuit SDK adapter\n* /preferences: Preferences window\n* /about: About window\n\n\n## Build and run\n\n```bash\n    git clone https://github.com/circuit/circuit-chat-app.git\n    cd circuit-chat-app\n    cp config.json.template config.json\n    // Add your client_id and client_secret to config.json\n    npm install\n    npm start\n```\n\n\n### Package app\n```bash\n    npm dist\n```\n\n\n## Packaged installer downloads\n* [Mac](https://goo.gl/t2Aw9y)\n* [Windows](https://goo.gl/5S94pT) (only Windows 10 tested)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcircuit%2Fcircuit-chat-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcircuit%2Fcircuit-chat-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcircuit%2Fcircuit-chat-app/lists"}