diff --git a/README.md b/README.md new file mode 100644 index 00000000..b86a67f9 --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +
+预览 + +

ChatGPT Admin Web

+ +免费部署你的商业 ChatGPT 网页应用。 + +[暂无 Demo] / [Issues](https://github.com/AprilNEA/ChatGPT-Admin-Web/issues) / [Discord](https://discord.gg/y4vxgqfUW) / [Telegram](https://github.com/AprilNEA/ChatGPT-Admin-Web) + +[GitHub Sponsor](https://github.com/sponsors/AprilNEA) / [爱发电](https://afdian.net/a/aprilnea) + +![主界面](./docs/cover.png) + +
+ +## 功能 + +- 面具 Mask 和提示词列表 +- 用户管理、订单管理和订阅管理 +- 支付接口 + - 第三方支付接口 + -[x]虎皮椒 +- 文本安全 + -[ ] 敏感词过滤 + -[x] 第三方过滤 +- 模型接入 + -[x] OpenAI + -[ ] Bing +- 收益模式 + -[ ] 广告 + -[ ] 分销 + +
思维导图 + +![System](./docs/system.svg) + +
+ +## Features + +- Mask and prompt list +- User management, order management and subscription management +- Payment interface +- Third party payment interface + -[x]Xunhu Pay +- Text Security +-[ ] Sensitive word filter +-[x] Third-party filtering +- Model Access +-[x] OpenAI +-[ ] Bing +- Revenue model +-[ ] Advertising +-[ ] Distribution + +## Start + +请查看[文档](https://caw.sku.moe) + +Please see [documentation](https://caw.sku.moe) + +## 捐赠 + +感谢您的激励,能让该项目持续发展。 + +[GitHub Sponsor](https://github.com/sponsors/AprilNEA) | [爱发电](https://afdian.net/a/aprilnea) diff --git a/apps/chat/.env.template b/apps/chat/.env.template index 5f3fc02d..96c311f9 100644 --- a/apps/chat/.env.template +++ b/apps/chat/.env.template @@ -1,29 +1,61 @@ +# 网站相关设置 -# Your openai api key. (required) -OPENAI_API_KEY=sk-xxxx +# 这是用来加密用户的令牌的密钥,我们建议您在此生成 +# https://1password.com/password-generator/ +JWT_SECRET= +# 标题 +NEXT_PUBLIC_TITLE= +# 公众号 +NEXT_PUBLIC_WECHAT_OA= -# Access passsword, separated by comma. (optional) -CODE=your-password +# Database +DATABASE_URL=postgres://:@/?pgbouncer=true&connect_timeout=10 +DIRECT_URL=postgres://:@/?pgbouncer=true&connect_timeout=10 +#SHADOW_DATABASE_URL= -# You can start service behind a proxy -PROXY_URL=http://localhost:7890 +# 如果你想使用 Redis 进行用户速率的限制,你可以在下方填入 U +REDIS_URL= +REDIS_TOKEN= -# Override openai api request base url. (optional) -# Default: https://api.openai.com -# Examples: http://your-openai-proxy.com -BASE_URL= +# 使用 OPENAI 模型的 BASE 和 Key +# 支持 api2d, closeAI 等第三方平台 +OPENAI_BASE=https://renailu.deno.dev +OPENAI_KEY=JqHFaJXdFRrU3rjqNqD2 -# Specify OpenAI organization ID.(optional) -# Default: Empty -# If you do not want users to input their own API key, set this value to 1. -OPENAI_ORG_ID= +# 支付信息 +DOMAIN=https://lmo.best +CALLBACK_DOMAIN=https://wxtest.deno.dev +# 虎皮椒的 appid 和 appsecret +XUNHU_PAY_APPID= +XUNHU_PAY_APPSECRET= -# (optional) -# Default: Empty -# If you do not want users to input their own API key, set this value to 1. -HIDE_USER_API_KEY= +# 若不启用邮箱注册,请将该部分留空 +NEXT_PUBLIC_EMAIL_SERVICE= -# (optional) -# Default: Empty -# If you do not want users to use GPT-4, set this value to 1. -DISABLE_GPT4= +MAILGUN_EMAIL_DOMAIN= +MAILGUN_EMAIL_API_KEY= + +ELASTICE_EMAIL_API_KEY= +ELASTICE_EMAIL_SENDER= + +# SMS 短信 +SMS_SERVICE=uni +# UniSMS 的 key +SMS_UNI_KEY_ID= +# 在 UniSMS 中申请的签名,发送+86的短信请保证签名中带有中文 +SMS_UNI_SIGNATURE= + +# 文本安全配置,当前支持 baidu 或 tencent +TEXT_SECURITY= + +TENCENT_SECRETID= +TENCENT_SECRETKEY= + +BAIDU_APIKEY= +BAIDU_SECRETKEY= + +# 微信登录配置,填入公众号的 appid 和 appsecret +# 公众号必须通过企业认证且为订阅号 +WECHAT_PROXY= +WECHAT_APP_ID= +WECHAT_APP_SECRET= diff --git a/apps/chat/app/components/auth/auth.tsx b/apps/chat/app/components/auth/auth.tsx index 81485875..aeae7459 100644 --- a/apps/chat/app/components/auth/auth.tsx +++ b/apps/chat/app/components/auth/auth.tsx @@ -1,17 +1,17 @@ import styles from "./auth.module.scss"; -import { IconButton } from "../button/button"; +import {IconButton} from "../button/button"; -import { NavigateFunction, useNavigate } from "react-router-dom"; -import { Path } from "../../constant"; +import {NavigateFunction, useNavigate} from "react-router-dom"; +import {Path} from "../../constant"; import Locale from "../../locales"; import BotIcon from "../../icons/bot.svg"; -import React, { FormEvent, useCallback, useState } from "react"; +import React, {FormEvent, useCallback, useState} from "react"; import usePreventFormSubmit from "@/app/hooks/use-prevent-form"; -import { useUserStore } from "@/app/store"; -import { Input, showToast } from "@/app/components/ui-lib/ui-lib"; +import {useUserStore} from "@/app/store"; +import {Input, showToast} from "@/app/components/ui-lib/ui-lib"; import Locales from "@/app/locales"; import { apiUserLoginGet, @@ -20,9 +20,9 @@ import { apiUserRegister, apiUserRegisterCode, } from "@/app/api"; -import { serverStatus } from "@caw/types"; +import {serverStatus} from "@caw/types"; import useIntervalAsync from "@/app/hooks/use-interval-async"; -import { Loading } from "@/app/components/loading"; +import {Loading} from "@/app/components/loading"; import Image from "next/image"; const emailService = process.env.NEXT_PUBLIC_EMAIL_SERVICE; @@ -64,7 +64,7 @@ const PhoneLogin: React.FC = () => { Locales.User.PleaseInput(`${Locales.User.Phone}, ${Locales.User.Code}`), ); - const res = await apiUserRegister({ phone: phone, verificationCode: code }); + const res = await apiUserRegister({phone: phone, verificationCode: code}); switch (res.status) { case serverStatus.success: { @@ -193,7 +193,7 @@ const EmailLogin: React.FC = () => {
- +
); @@ -202,6 +202,7 @@ const EmailLogin: React.FC = () => { const WeChatLogin: React.FC = () => { const navigate = useNavigate(); const [ticket, setTicket] = useState(""); + const updateSessionToken = useUserStore((state) => state.updateSessionToken); useIntervalAsync( useCallback(async () => { @@ -221,13 +222,12 @@ const WeChatLogin: React.FC = () => { return; } } - }, [ticket]), + }, [ticket, navigate, updateSessionToken]), 3000, ); - const updateSessionToken = useUserStore((state) => state.updateSessionToken); - if (!ticket) return ; + if (!ticket) return ; return (
@@ -249,7 +249,7 @@ export function AuthPage() { return (
- +
{Locale.Auth.Title}
@@ -257,7 +257,7 @@ export function AuthPage() {
- +
@@ -281,7 +281,7 @@ export function AuthPage() { )}
- {tab === "phone" ? : } + {tab === "phone" ? : }
diff --git a/docs/cover.png b/docs/cover.png new file mode 100644 index 00000000..38157305 Binary files /dev/null and b/docs/cover.png differ diff --git a/docs/roadmap.svg b/docs/roadmap.svg deleted file mode 100644 index 11e1ab48..00000000 --- a/docs/roadmap.svg +++ /dev/null @@ -1,125 +0,0 @@ - ]>‎ChatGPT-Admin-Web‎Roadmap‎UI 优化‎后台管理‎敏感词过滤‎支付接口‎订阅模式‎添加修改密码‎添加 OpenAI Key‎管理广告的链接‎添加**过滤‎添加微信官方接口‎添加支付宝官方接口‎添加自定义订阅模式,实现订阅插槽‎内容接口‎添加自定义接口插槽‎(Optional)实现插件系统‎分销逻辑‎自定义分销逻辑‎实现用户添加,编辑‎加入分析数据‎全局文本的编辑‎主体功能 diff --git a/docs/system.svg b/docs/system.svg index 53c81d61..4c427e4a 100644 --- a/docs/system.svg +++ b/docs/system.svg @@ -1,4 +1,4 @@ - ]>‎ChatGPT-Admin-Web‎付费系统‎敏感词过滤‎检测方式‎第三方过滤‎腾讯云天御/阿里云云盾/网易易盾‎百度云/京东云 内容安全‎七牛云/华为云/10086 内容审核‎微信/抖音/支付宝 小程序文本安全‎Cloudbase 内容审核‎数美 智能文本检测‎关键词过滤‎拦截方式‎敏感词换**‎阻止提交‎自由聊天‎ChatGPT‎New Bing‎收益模式‎付费充值‎充值次数‎订阅模式‎Free‎Pro‎Premium‎流量主广告‎开屏广告‎Banner广告‎欢迎页广告‎关键词弹窗‎支付接口‎微信‎支付宝‎虎皮椒‎Stripe‎用户系统‎分销‎二级分销‎查看收益‎申请体现‎内容接口‎内置接口‎OpenAI API‎New Bing‎......‎Key Pool‎自定义接口‎订阅‎验证‎邮箱验证‎短信验证‎Restful API‎SMTP‎Mailgun +]]>‎ChatGPT-Admin-Web‎敏感词过滤‎检测方式‎第三方过滤‎腾讯云天御/阿里云云盾/网易易盾‎百度云/京东云 内容安全‎关键词过滤‎拦截方式‎敏感词换**‎阻止提交‎收益模式‎付费充值‎充值次数‎订阅模式‎Free‎Pro‎Premium‎流量主广告‎开屏广告‎Banner广告‎欢迎页广告‎关键词弹窗‎支付接口‎微信‎支付宝‎虎皮椒‎Stripe‎分销‎二级分销‎查看收益‎申请体现‎用户系统‎订阅‎验证‎邮箱验证‎SMTP(需要中转)‎Restful API‎Mailgun‎短信验证‎UniSMS‎内容接口‎内置接口‎OpenAI API‎New Bing‎......‎Key Pool‎自定义接口‎ReSend‎Elastice \ No newline at end of file diff --git a/docs/tech-stack.svg b/docs/tech-stack.svg deleted file mode 100644 index 00f3bf8c..00000000 --- a/docs/tech-stack.svg +++ /dev/null @@ -1,125 +0,0 @@ - ]>‎ChatGPT-Admin-Web‎Tech Stack‎Storage‎Auth‎Framework‎Nextjs 13‎Anti DDoS‎@upstash/ratelimit‎Cloudflare WAF‎TypeScript‎Redis‎Upstah‎Vercel Edge Config‎Local Environment‎JWT‎Package‎Turborepo‎monorepo‎Analysis‎Vercel Analytics‎Cloudflare Analytics‎Upstash Analytics‎Styles‎Sass‎Schema Validation‎Zod‎Session