{"id":20082488,"url":"https://github.com/paulgreg/semi-persistent-chat","last_synced_at":"2025-05-06T01:30:23.289Z","repository":{"id":42899956,"uuid":"216272909","full_name":"paulgreg/semi-persistent-chat","owner":"paulgreg","description":"A simple node semi-persistent chat without database (messages are in server’s memory and purged after few hours)","archived":false,"fork":false,"pushed_at":"2024-09-13T13:14:04.000Z","size":3614,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-14T03:56:20.713Z","etag":null,"topics":["node","pwa","react","socket-io"],"latest_commit_sha":null,"homepage":"https://semi-persistent-chat.fly.dev/","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/paulgreg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-10-19T21:31:01.000Z","updated_at":"2024-09-13T13:14:08.000Z","dependencies_parsed_at":"2023-02-12T17:30:19.205Z","dependency_job_id":"7aee1cf0-b2e8-4471-9e0b-05cf52789dec","html_url":"https://github.com/paulgreg/semi-persistent-chat","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/paulgreg%2Fsemi-persistent-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulgreg%2Fsemi-persistent-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulgreg%2Fsemi-persistent-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulgreg%2Fsemi-persistent-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulgreg","download_url":"https://codeload.github.com/paulgreg/semi-persistent-chat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224478399,"owners_count":17318077,"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":["node","pwa","react","socket-io"],"created_at":"2024-11-13T15:43:38.455Z","updated_at":"2024-11-13T15:43:39.175Z","avatar_url":"https://github.com/paulgreg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Semi Persistent Chat\n\nThat project is a simple semi-persistent PWA chat using web socket.\nMessages are kept in memory and purged after X hours on the server (configurable).\n\nURLs sent in chat will be transformed as links. For media (image, audio or video), a preview will be displayed.\n\nLogin scren:\n\n![Screenshot of login screen](./semi-persistent-chat-login.png 'Login screen')\n\nChat Screen :\n\n![Screenshot of a chat](./semi-persistent-chat.png 'Chat')\n\n\n## Features\n\n - multi-room chat\n - show media preview (image, video, audio)\n - display web page title\n - works on mobile\n - edit or delete sent messages\n - comment with emojis \n - messages are saved in `tmp-data/semi-persistent-chat-dump.json` when server is halted and restored on next startup (to keep messages duging system update)\n\n\n## Configuration\n\nLaunch `npm run config` to create `src/config.mjs` (from `src/config.mjs.dist`) and update it according your needs.\n\n\n## To dev\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\nrun `npm run dev:client` to launch client code (with watch) and `npm run dev:server` to launch server code\n\nWebapp is served on port 3000 by devtools while node is launched on port 6060 (explaining while websocket and api calls are made on that port on non production env).\n\n\n## To deploy on production using only node\n\nRun `npm run build` to generate static files into `build` directory, then run `npm run start` which will serve static files.\n\n\n## To deploy on production using nginx to serve static file (recommanded)\n\nRun `./build.sh` to generate static files into `build` directory (change `PUBLIC_URL` in that file if needed).\n\nServe static files via a web server like nginx.\nI’m using a symbolic link from `/var/www/semi-persistent-chat` to the `build` directory.\n\nLaunch src/server file (I suggest you to use pm2 to launch server via `./pm2.sh`).\n\nFinally, adapt nginx to let pass web socket and `/api` to node :\n\n```\nlocation /persistent-chat-ws/ {\n        proxy_pass http://127.0.0.1:6060;\n        proxy_http_version 1.1;\n        proxy_set_header Upgrade $http_upgrade;\n        proxy_set_header Connection \"Upgrade\";\n}\nlocation /persistent-chat/api/ {\n        proxy_pass http://127.0.0.1:6060/api/;\n        proxy_http_version 1.1;\n}\n```\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulgreg%2Fsemi-persistent-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulgreg%2Fsemi-persistent-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulgreg%2Fsemi-persistent-chat/lists"}