{"id":19788898,"url":"https://github.com/niklaskorz/nkchat","last_synced_at":"2025-05-01T00:31:35.959Z","repository":{"id":38778990,"uuid":"125855287","full_name":"niklaskorz/nkchat","owner":"niklaskorz","description":"A web-based chat application using modern technologies such as React, GraphQL and styled-components","archived":false,"fork":false,"pushed_at":"2022-10-06T02:38:47.000Z","size":68867,"stargazers_count":22,"open_issues_count":40,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T06:34:33.107Z","etag":null,"topics":["apollographql","docker","graphql","react","styled-components","traefik","typescript"],"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/niklaskorz.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}},"created_at":"2018-03-19T12:38:37.000Z","updated_at":"2025-02-04T00:40:01.000Z","dependencies_parsed_at":"2022-09-19T18:02:09.161Z","dependency_job_id":null,"html_url":"https://github.com/niklaskorz/nkchat","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklaskorz%2Fnkchat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklaskorz%2Fnkchat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklaskorz%2Fnkchat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklaskorz%2Fnkchat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklaskorz","download_url":"https://codeload.github.com/niklaskorz/nkchat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251802746,"owners_count":21646268,"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":["apollographql","docker","graphql","react","styled-components","traefik","typescript"],"created_at":"2024-11-12T06:29:15.293Z","updated_at":"2025-05-01T00:31:32.307Z","avatar_url":"https://github.com/niklaskorz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nkchat\n\n[![Build status](https://img.shields.io/gitlab/pipeline/niklaskorz/nkchat.svg)](https://gitlab.com/niklaskorz/nkchat/pipelines)\n\n`nkchat` is a web-based chat application using modern technologies such as\nReact, GraphQL and [styled-components](https://www.styled-components.com/).\n\n## License\n\nLicensed under the [MIT license](LICENSE).\n\n## Setup requirements\n\n- Docker ([Windows](https://docs.docker.com/docker-for-windows/), [macOS](https://docs.docker.com/docker-for-mac/), [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/))\n- Docker Compose (usually pre-installed by Docker, if not [see here](https://docs.docker.com/compose/install/))\n\n## Setup\n\nClone the repository, enter the repository's directoy with a terminal.\n\nIf you are on Windows, execute\n```powershell\n$env:COMPOSE_CONVERT_WINDOWS_PATHS=1\n```\nif you are using Powershell or\n```\nset COMPOSE_CONVERT_WINDOWS_PATHS=1\n```\nif you are using cmd.\n\nThen execute the following commands:\n```sh\ndocker-compose -p nkchat build\ndocker-compose -p nkchat up -d\n```\n\n`nkchat` will then be available at [http://localhost:9000](http://localhost:9000).\n\n## Browser compatability\n\nThe following browsers are tested and supported:\n- Chrome 65+\n- Firefox 58+\n- Microsoft Edge with EdgeHTML 17+\n- Safari 10+\n\nIn general, these include the last two major versions of all mainstream\nbrowsers. Support for Internet Explorer is not planned. Opera and Vivaldi\nshould be working fine as they use the same browser engine as Chrome, but they\nare not actively tested.\n\nThe layout is currently optimized for desktop screens and therefore hard to\nuse on mobile devices like smartphones.\n\n## Features\n\n- Register, log in and log out\n- Create and join rooms\n- Send and receive messages\n- Switch between rooms\n- List of room members is automatically updated on all subscribed clients when a new user joins the room\n- Send messages that include links to YouTube or aluhga videos, or images\n- Links in messages are automatically turned into clickable links thanks to [Linkify](https://github.com/SoapBox/linkifyjs)\n- Multiline messages (line breaks are entered with Shift + Enter while Enter is used for sending a message)\n\n## Sending links to videos or images\n\nLinks following these patterns will be embedded as videos:\n- `https?://youtube.com/watch?v={videoId}`\n- `https?://youtu.be/{videoId}`\n- `https?://alugha.com/videos/{videoId}`\n\nLinks following these patterns will be embedded as images:\n- `*.png`\n- `*.jpe?g`\n- `*.webp`\n- `*.bmp`\n- `*.tga`\n\n## GraphQL API\n\nFor querying, mutating and subscribing to data, a\n[GraphQL](https://graphql.org/learn/) API is used. \nYou can inspect the GraphQL API by visiting\n[http://localhost:9000/graphiql](http://localhost:9000/graphiql) and clicking\non the \"Docs\" button on the upper right corner.\n\n## Scalability and load balancing\n\n[Traefik](https://docs.traefik.io/) is used for routing and load balancing the\nincluded microservices, i.e. the chat client and the GraphQL server.\n\nYou can start the server with e.g. four server instances by executing:\n```sh\ndocker-compose -p nkchat up -d --scale server=4\n```\n\nTraefik will balance incoming traffic among the running server instances by\nusing [Weighted round robin](https://en.wikipedia.org/wiki/Weighted_round_robin)\nby default.\n\nYou can inspect the running services and their health by accessing the\nTraefik dashboard at [http://localhost:8080/dashboard](http://localhost:8080/dashboard).\n\nWhen a chat message reaches a server instance, the other server instances\nand their subscribed WebSocket clients are notified using the high-performance\n[NATS messaging server](https://github.com/nats-io/gnatsd).\n\n## Possible features and optimizations for future versions\n\nThe following are optimizations and features I would implement if this was to\nturn into a real product:\n- Markdown support in messages\n- Pre-loading the size of sent images to cache the dimensions and size the messages accordingly even before the image is loaded by the browser\n- Serverside-checking of links for metadata like title or schema.org data to generate a link preview beneath the message\n- Password protection for rooms\n- Invite-only rooms with short-lived invite links generated by the room's owner\n- Notifications for new messages, even when a room is not open (push notifications)\n- Possibility to leave a room or to kick users out of a room as the owner\n- Possibility to delete or rename a room\n- Possibility to rename yourself as a user, maybe even with separate names per room\n- Lazy loading of older messages, right now the whole chat history is loaded when the user opens a room\n- Touch-friendly, responsive layout for an optimal mobile experience\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklaskorz%2Fnkchat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklaskorz%2Fnkchat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklaskorz%2Fnkchat/lists"}