{"id":18879081,"url":"https://github.com/zhuima/chat","last_synced_at":"2026-02-19T23:30:16.021Z","repository":{"id":156007144,"uuid":"631814501","full_name":"zhuima/chat","owner":"zhuima","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-27T06:31:34.000Z","size":2421,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T02:43:13.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/zhuima.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-24T05:49:28.000Z","updated_at":"2023-04-24T05:50:00.000Z","dependencies_parsed_at":"2023-07-03T12:17:50.621Z","dependency_job_id":null,"html_url":"https://github.com/zhuima/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/zhuima%2Fchat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuima%2Fchat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuima%2Fchat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuima%2Fchat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhuima","download_url":"https://codeload.github.com/zhuima/chat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239841719,"owners_count":19705981,"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-11-08T06:33:08.683Z","updated_at":"2026-02-19T23:30:15.975Z","avatar_url":"https://github.com/zhuima.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Demo\n\n[video.webm](https://user-images.githubusercontent.com/666683/230305516-60154c5b-7170-4d2b-9670-a5ff4c851d25.webm)\n\n\u003cimg width=\"850\" alt=\"Screenshot 2023-04-12 at 12 43 31\" src=\"https://user-images.githubusercontent.com/666683/231352196-5a6101db-9f5b-4eae-9198-59afed5822a6.png\"\u003e\n\n\u003cimg width=\"1117\" alt=\"image\" src=\"https://user-images.githubusercontent.com/666683/233824879-5dc6b85a-9cc6-496d-be68-4b19b9f6dfa0.png\"\u003e\n\n\u003cimg width=\"850\" alt=\"image\" src=\"https://user-images.githubusercontent.com/666683/233824829-f6069e25-05b3-48ef-a165-bb854a009edd.png\"\u003e\n\n\n## 规则\n\n- 第一个消息是系统消息（prompt）\n- 上下文默认附带最新创建的10条消息\n- 第一个注册的用户是管理员\n- 默认限流 100 chatGPT call /10分钟 (OPENAI_RATELIMIT=100)\n- 根据对话生成可以分享的静态页面(like ShareGPT), 也可以继续会话.\n- 支持OPEN AI, Claude 模型 [免费申请链接](https://www.anthropic.com/earlyaccess)\n\n## 参与开发\n\n1. git clone\n2. golang dev\n\n```bash\ncd chat; cd api\ngo mod tidy\n# export env var, change base on your env\nexport PG_HOST=192.168.0.135\nexport PG_DB=hwu\nexport PG_USER=hwu\nexport PG_PASS=pass\nexport PG_PORT=5432\n# export DATABASE_URL= postgres://user:pass@192.168.0.1:5432/db?sslmode=disable\n\n# export OPENAI_API_KEY=sk-xxx, not required if you use `debug` model\n# export OPENAI_RATELIMIT=100\n#\nmake serve\n```\n\n3. node env\n\n```bash\ncd ..; cd web\nnpm install\nnpm run dev\n```\n\n4. e2e test\n\n```bash\ncd ..; cd e2e\n# export env var, change base on your env\nexport PG_HOST=192.168.0.135\nexport PG_DB=hwu\nexport PG_USER=hwu\nexport PG_PASS=pass\nexport PG_PORT=5432\nnpm install\nnpx playwright test # --ui \n```\n\nThe instruction might not be accuare, ask in issue or disscussion if unclear.\n\n## 如何部署\n\n参考 `docker-compose.yaml`\n\n[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/tk7jWU?referralCode=5DMfQv)\n\n然后配置环境变量就可以了.\n\n```\nPORT=8080\nOPENAI_RATELIMIT=0\n```\n\n别的两个 api key 有就填.\n\n\u003cimg width=\"750\" alt=\"image\" src=\"https://user-images.githubusercontent.com/666683/232234418-941c9336-783c-4430-857c-9e7b703bb1c1.png\"\u003e\n\n部署之后,  注册用户, 第一个用户是管理员, 然后到  \u003chttps://$hostname/static/#/admin/user\u003e,\n设置 ratelimit, 公网部署, 只对信任的email 增加 ratelimit, 这样即使有人注册, 也是不能用的.\n\n\u003cimg width=\"750\" alt=\"image\" src=\"https://user-images.githubusercontent.com/666683/232227529-284289a8-1336-49dd-b5c6-8e8226b9e862.png\"\u003e\n\n## 致谢\n\n- web: [ChatGPT-Web](https://github.com/Chanzhaoyu/chatgpt-web) 复制过来的 。\n- api : 参考 [Kerwin1202](https://github.com/Kerwin1202)'s [Chanzhaoyu/chatgpt-web#589](https://github.com/Chanzhaoyu/chatgpt-web/pull/589) 的node版本在chatgpt帮助下写的\n\n## LICENCE: MIT\n\n## How to Use\n\n- The first message is a system message (prompt)\n- by default, the latest 10 messages are context\n- First user is superuser.\n- 100 chatgpt api call / 10 mins (OPENAI_RATELIMIT=100)\n- Snapshot conversation and Share (like ShareGPT)\n- Support OPEN AI, Claude model [free application link](https://www.anthropic.com/earlyaccess)\n\n## How to Deploy\n\nRefer to `docker-compose.yaml`\n\n[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/tk7jWU?referralCode=5DMfQv)\n\nThen configure the environment variables.\n\n```\nPORT=8080\nOPENAI_RATELIMIT=0\n```\n\nFill in the other two keys if you have them.\n\n\u003cimg width=\"750\" alt=\"image\" src=\"https://user-images.githubusercontent.com/666683/232234418-941c9336-783c-4430-857c-9e7b703bb1c1.png\"\u003e\n\nAfter deployment, registering users, the first user is an administrator, then go to\n\u003chttps://$hostname/static/#/admin/user\u003e to set rate limiting. Public deployment,\nonly adds rate limiting to trusted emails, so even if someone registers, it will not be available.\n\n\u003cimg width=\"750\" alt=\"image\" src=\"https://user-images.githubusercontent.com/666683/232227529-284289a8-1336-49dd-b5c6-8e8226b9e862.png\"\u003e\n\nThis helps ensure only authorized users can access the deployed system by limiting registration to trusted emails and enabling rate limiting controls.\n\n## Acknowledgments\n\n- web: copied from chatgpt-web \u003chttps://github.com/Chanzhaoyu/chatgpt-web\u003e\n- api: based on the node version of [Kerwin1202](https://github.com/Kerwin1202)'s [Chanzhaoyu/chatgpt-web#589](https://github.com/Chanzhaoyu/chatgpt-web/pull/589)\nand written with the help of chatgpt.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhuima%2Fchat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhuima%2Fchat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhuima%2Fchat/lists"}