├── server ├── src │ ├── main.ts │ ├── app │ │ ├── context │ │ │ ├── index.ts │ │ │ └── ServicesContext.ts │ │ ├── routes │ │ │ ├── index.ts │ │ │ ├── api.routes.ts │ │ │ └── app.routes.ts │ │ ├── controllers │ │ │ ├── index.ts │ │ │ ├── register.controller.ts │ │ │ ├── login.controller.ts │ │ │ └── githubOAuth.controller.ts │ │ ├── services │ │ │ ├── index.ts │ │ │ ├── group.service.ts │ │ │ ├── chat.service.ts │ │ │ ├── groupChat.service.ts │ │ │ └── user.service.ts │ │ ├── middlewares │ │ │ ├── verify.ts │ │ │ └── requestFrequency.ts │ │ ├── utils │ │ │ ├── qiniu.ts │ │ │ ├── db.ts │ │ │ └── Logger.ts │ │ ├── index.ts │ │ ├── server.ts │ │ └── socket │ │ │ └── message.socket.ts │ └── configs │ │ ├── configs.prod.ts │ │ ├── configs.common.ts │ │ └── configs.dev.ts ├── .DS_Store ├── nodemon.json ├── .gitignore ├── init │ ├── util │ │ ├── getSQLMap.ts │ │ ├── walkFile.ts │ │ └── getSQLConentMap.ts │ ├── db.ts │ ├── index.ts │ └── sql │ │ └── ghchat.sql ├── tsconfig.json ├── tslint.json ├── webpack.config.js └── package.json ├── .DS_Store ├── src ├── components │ ├── Linkify │ │ ├── decorators │ │ │ ├── defaultHrefDecorator.js │ │ │ ├── defaultTextDecorator.js │ │ │ ├── defaultMatchDecorator.js │ │ │ └── defaultComponentDecorator.js │ │ └── index.js │ ├── MyInfo │ │ ├── styles.scss │ │ └── index.js │ ├── GroupChat │ │ └── styles.scss │ ├── Spinner │ │ ├── index.js │ │ └── index.scss │ ├── GroupAvatar │ │ ├── styles.scss │ │ └── index.js │ ├── ChatContentList │ │ ├── styles.scss │ │ └── index.js │ ├── Tabs │ │ ├── style.scss │ │ ├── help.js │ │ └── index.js │ ├── Button │ │ ├── styles.scss │ │ └── index.js │ ├── UserAvatar │ │ ├── style.scss │ │ └── index.js │ ├── Notification │ │ ├── style.scss │ │ └── index.js │ ├── PersonalInfo │ │ ├── styles.scss │ │ └── index.js │ ├── NotFound │ │ ├── index.js │ │ └── styles.scss │ ├── ModalBase │ │ ├── index.js │ │ └── styles.scss │ ├── ChatHeader │ │ ├── style.scss │ │ └── index.js │ ├── HomePageList │ │ └── index.scss │ ├── Header │ │ ├── style.scss │ │ └── index.js │ ├── SearchBox │ │ ├── styles.scss │ │ └── index.js │ ├── ShareModal │ │ ├── styles.scss │ │ └── index.js │ ├── ShareChatCard │ │ └── index.js │ ├── Setting │ │ ├── styles.scss │ │ └── index.js │ ├── CreateGroupModal │ │ ├── styles.scss │ │ └── index.js │ ├── Modal │ │ ├── index.js │ │ └── style.scss │ ├── GroupChatInfo │ │ ├── styles.scss │ │ └── index.js │ ├── InputArea │ │ └── style.scss │ ├── Robot │ │ └── index.js │ ├── ChatItem │ │ └── style.scss │ ├── ListItems │ │ ├── styles.scss │ │ └── index.js │ └── SignInSignUp │ │ ├── index.scss │ │ └── index.js ├── utils │ ├── sleep.js │ ├── setStateAsync.js │ ├── debounce.js │ ├── qiniu.js │ ├── request.js │ └── transformTime.js ├── redux │ ├── actions │ │ ├── shareAction.js │ │ └── initAppAction.js │ ├── reducers │ │ ├── shareReducer.js │ │ └── initAppReducer.js │ ├── store.js │ └── reducers.js ├── containers │ ├── WelcomePage │ │ ├── styles.scss │ │ └── index.js │ ├── SettingPage │ │ ├── settingAction.js │ │ ├── index.js │ │ └── settingReducer.js │ ├── RegisterPage │ │ ├── index.scss │ │ └── index.js │ ├── LogInPage │ │ ├── index.scss │ │ └── index.js │ ├── Tabs │ │ └── index.js │ ├── RobotPage │ │ ├── index.js │ │ ├── robotAction.js │ │ └── robotReducer.js │ ├── PrivateChatPage │ │ ├── privateChatReducer.js │ │ ├── index.js │ │ └── privateChatAction.js │ ├── GroupChatPage │ │ ├── groupChatReducer.js │ │ ├── index.js │ │ └── groupChatAction.js │ ├── Header │ │ └── index.js │ └── HomePageList │ │ ├── index.js │ │ ├── homePageListReducer.js │ │ └── homePageListAction.js ├── assets │ ├── base.scss │ └── chat.scss ├── manifest.json ├── index.js ├── service-worker.js ├── index.html ├── modules │ ├── BrowserNotification │ │ └── index.js │ └── Chat │ │ └── index.js ├── router │ └── index.js └── index.scss ├── .eslintignore ├── postcss.config.js ├── .prettierrc ├── .babelrc ├── .prettierignore ├── .vscode └── settings.json ├── .gitignore ├── webpack.common.config.js ├── LICENSE ├── webpack.dev.config.js ├── webpack.prod.config.js ├── .eslintrc.js └── package.json /server/src/main.ts: -------------------------------------------------------------------------------- 1 | export { App } from './app'; 2 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aermin/ghChat/HEAD/.DS_Store -------------------------------------------------------------------------------- /server/src/app/context/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ServicesContext'; 2 | -------------------------------------------------------------------------------- /server/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aermin/ghChat/HEAD/server/.DS_Store -------------------------------------------------------------------------------- /src/components/Linkify/decorators/defaultHrefDecorator.js: -------------------------------------------------------------------------------- 1 | export default href => href; 2 | -------------------------------------------------------------------------------- /src/components/Linkify/decorators/defaultTextDecorator.js: -------------------------------------------------------------------------------- 1 | export default text => text; 2 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | **/node_modules 3 | **/build 4 | *.min.js 5 | service-worker.js 6 | -------------------------------------------------------------------------------- /src/components/MyInfo/styles.scss: -------------------------------------------------------------------------------- 1 | .myInfo { 2 | display: none; 3 | cursor: pointer; 4 | } 5 | -------------------------------------------------------------------------------- /server/src/app/routes/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by cli, don't modify manually 3 | */ 4 | export * from './app.routes'; 5 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // eslint-disable-next-line global-require 3 | plugins: [require('autoprefixer')], 4 | }; 5 | -------------------------------------------------------------------------------- /src/utils/sleep.js: -------------------------------------------------------------------------------- 1 | export default function sleep(ms = 0) { 2 | return new Promise(resolve => { 3 | setTimeout(resolve, ms); 4 | }); 5 | } 6 | -------------------------------------------------------------------------------- /src/utils/setStateAsync.js: -------------------------------------------------------------------------------- 1 | export default function setStateAsync(state) { 2 | return new Promise(resolve => { 3 | this.setState(state, resolve); 4 | }); 5 | } 6 | -------------------------------------------------------------------------------- /server/nodemon.json: -------------------------------------------------------------------------------- 1 | { 2 | "watch": ["dist"], 3 | "ext": "js", 4 | "ignore": ["dist/**/*.spec.ts"], 5 | "exec": "node --inspect -r dotenv/config dist/index.js" 6 | } 7 | -------------------------------------------------------------------------------- /src/redux/actions/shareAction.js: -------------------------------------------------------------------------------- 1 | const SHARE = 'SHARE'; 2 | 3 | const shareAction = (data = null) => ({ 4 | type: SHARE, 5 | data, 6 | }); 7 | 8 | export { SHARE, shareAction }; 9 | -------------------------------------------------------------------------------- /src/redux/actions/initAppAction.js: -------------------------------------------------------------------------------- 1 | const INIT_APP = 'INIT_APP'; 2 | 3 | const initAppAction = (status = false) => ({ 4 | type: INIT_APP, 5 | data: status, 6 | }); 7 | 8 | export { INIT_APP, initAppAction }; 9 | -------------------------------------------------------------------------------- /server/src/app/controllers/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by cli, don't modify manually 3 | */ 4 | export * from './githubOAuth.controller'; 5 | export * from './login.controller'; 6 | export * from './register.controller'; 7 | -------------------------------------------------------------------------------- /src/containers/WelcomePage/styles.scss: -------------------------------------------------------------------------------- 1 | .welcomeWrapper { 2 | text-align: center; 3 | .title { 4 | font-size: 18px; 5 | padding-bottom: 40px; 6 | } 7 | .content { 8 | font-size: 14px; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /server/src/configs/configs.prod.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable global-require */ 2 | import commonConfigs from './configs.common'; 3 | 4 | export default { 5 | production: true, 6 | ...commonConfigs, 7 | ...require('../../secrets'), 8 | }; 9 | -------------------------------------------------------------------------------- /src/components/Linkify/decorators/defaultMatchDecorator.js: -------------------------------------------------------------------------------- 1 | import LinkifyIt from 'linkify-it'; 2 | import tlds from 'tlds'; 3 | 4 | const linkify = new LinkifyIt(); 5 | linkify.tlds(tlds); 6 | 7 | export default text => linkify.match(text); 8 | -------------------------------------------------------------------------------- /server/src/app/services/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by cli, don't modify manually 3 | */ 4 | export * from './chat.service'; 5 | export * from './group.service'; 6 | export * from './groupChat.service'; 7 | export * from './user.service'; 8 | -------------------------------------------------------------------------------- /src/components/GroupChat/styles.scss: -------------------------------------------------------------------------------- 1 | @import "../../assets/chat.scss"; 2 | 3 | .groupChatInfoMask { 4 | position: fixed; 5 | width: 100%; 6 | height: 100%; 7 | top: 0; 8 | left: 0; 9 | background-color: #fff; 10 | opacity: 0; 11 | z-index: 98; 12 | } -------------------------------------------------------------------------------- /src/components/Linkify/decorators/defaultComponentDecorator.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export default (decoratedHref, decoratedText, key, target = '_blank') => ( 4 | 5 | {decoratedText} 6 | 7 | ); 8 | -------------------------------------------------------------------------------- /src/components/Spinner/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './index.scss'; 3 | 4 | export default function Spinner() { 5 | return ( 6 |
欢迎ヾ(=・ω・=)o
14 |选个群组/用户开始聊天吧ε==(づ′▽`)づ
15 |你所访问的页面不存在
16 | 17 | 返回首页 18 | 19 |取消
12 |确定
13 |取消
} 20 | {hasConfirm &&确定
} 21 |您已登录成功
78 |您已注册成功
79 |推荐使用GitHub登录
116 | 117 | 120 | 121 |{data.name}
92 | {!showAsContacts && ( 93 | {!!data.time && toNormalTime(data.time)} 94 | )} 95 |{name}
} 34 | {intro &&{`介绍: ${intro}`}
} 35 | {location &&{`来自: ${location}`}
} 36 | {company &&{`公司: ${company}`}
} 37 | {/* {status &&{status}
} */} 38 | {website && ( 39 |_openUrl(website)}>{`网站: ${website}`}
40 | )} 41 | {github &&_openUrl(github)}>{`github: ${github}`}
} 42 | {showContactButton && ( 43 | 48 | )} 49 | {isContact && ( 50 | 55 | )} 56 | {showShareIcon && ( 57 | 60 | )} 61 |126 | 群公告 127 | {this._isCreator && ( 128 | 135 | )} 136 |
137 |{groupInfo.group_notice}
138 |139 | {`在线人数: ${onlineNumber}`} 140 | 141 | {`${justShowOnlineMember ? '查看所有' : '只看在线'}`} 142 | 143 |
144 |147 | 退出群聊 148 |
149 |