Toggle navigation
Toggle navigation
This project
Loading...
Sign in
서민정
/
SEARCH-AND-CHAT
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
2
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
서민정
2020-06-08 21:08:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
140e1d62cf6de73ee95b27dc9bb47e7dfd1b5731
140e1d62
1 parent
5a904e86
remove gcp files and update user
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
62 additions
and
93 deletions
.gcloudignore
.gitignore
README.md
app.yaml
client/app.yaml
client/package.json
client/src/chatbot/chatbot.js
client/src/setupProxy.js
client/src/views/loginpage.js
index.js
package.json
server/routes/users/login.js
server/routes/users/user.js
.gcloudignore
deleted
100644 → 0
View file @
5a904e8
# This file specifies files that are *not* uploaded to Google Cloud Platform
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore
# Node.js dependencies:
node_modules/
/node_modules
/build
/client/node_modules
.DS_Store
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.vscode
dev.js
./server/config/dev.js
.gitignore
View file @
140e1d6
...
...
@@ -11,4 +11,6 @@ yarn-error.log*
.vscode
dev.js
auth.js
./server/config/dev.js
./server/config/auth.js
...
...
README.md
View file @
140e1d6
...
...
@@ -4,6 +4,4 @@
-
뉴스 크롤링 후 이미지 사이즈 80
*
80 인 것을 원본으로 변환할 수 있는 방법은..?
-
구글
[
Cloud Authentication
](
https://cloud.google.com/docs/authentication/getting-started?hl=ko
)
으로 사용해서 로컬에서 실행시키는데,
만약 배포를 해야한다면 이 부분은 어떻게 해야할지 ..?
-
사용자 인증 기능 추가 -> 회원 등록 시 관심가수를 입력받아서 로그인 할 때마다 최신 & 정확 & 소식 을 전달해줌 / 비회원으로도 이용가능_지금과 같이
--> React Router 사용해서 /
<
> 에 따라서 login/register/chatpage 가 되도록 구현해야함.
-> 로그인,회원가입 페이지는 Boiler-plate 사용하기.............................도전
\ No newline at end of file
-
회원으로 로그인 했을 때, 주어진 키워드로 챗봇이 "먼저 검색"해줄 수 있도록 설정하는 방법은?!
...
...
app.yaml
deleted
100644 → 0
View file @
5a904e8
# Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# [START gae_flex_quickstart_yaml]
runtime
:
nodejs10
# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml
# [END gae_flex_quickstart_yaml]
client/app.yaml
deleted
100644 → 0
View file @
5a904e8
# Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# [START gae_flex_quickstart_yaml]
runtime
:
nodejs10
# [END gae_flex_quickstart_yaml]
client/package.json
View file @
140e1d6
...
...
@@ -4,7 +4,8 @@
"private"
:
true
,
"engines"
:
{
"node"
:
"10.x.x"
,
"npm"
:
"6.13.4"
"npm"
:
"6.x"
,
"yarn"
:
">=1.0.0 <2.0.0"
},
"dependencies"
:
{
"antd"
:
"^3.26.5"
,
...
...
client/src/chatbot/chatbot.js
View file @
140e1d6
...
...
@@ -6,24 +6,54 @@ import Message from './Sections/Message';
import
{
List
,
Icon
,
Avatar
}
from
'antd'
;
import
Card
from
"./Sections/Card"
;
import
CheckString
from
'./Check'
;
const
username
=
"유저"
;
function
get
Keyword
(){
function
get
UserInfo
(){
let
url
=
window
.
location
.
href
;
let
keyword
=
""
;
let
name
=
""
;
let
from
=
0
;
let
to
=
0
;
let
flag
=
false
;
if
(
!
url
)
return
keyword
;
for
(
var
i
=
0
;
i
<=
url
.
length
;
i
++
){
if
(
flag
&&
url
[
i
]
===
'&'
){
to
=
i
;
break
;
}
if
(
url
[
i
]
===
'='
){
keyword
=
url
.
substr
(
i
+
1
);
keyword
=
decodeURI
(
keyword
);
return
keyword
;
from
=
i
+
1
;
flag
=
true
;
}
}
keyword
=
url
.
substr
(
from
,
to
-
from
);
keyword
=
decodeURI
(
keyword
);
name
=
url
.
substr
(
to
+
6
);
name
=
decodeURI
(
name
);
var
user
=
{
keyword
,
name
};
return
user
;
}
const
user
=
getUserInfo
();
let
username
=
"유저"
;
let
userKeyword
=
""
;
if
(
user
.
keyword
){
userKeyword
=
user
.
keyword
;
username
=
user
.
name
;
}
let
userKeyword
=
getKeyword
();
function
Chatbot
()
{
console
.
log
(
"이름"
,
username
);
console
.
log
(
"키워드"
,
userKeyword
);
var
isUser
=
false
;
if
(
userKeyword
)
isUser
=
true
;
const
dispatch
=
useDispatch
();
const
messagesFromRedux
=
useSelector
(
state
=>
state
.
message
.
messages
)
...
...
@@ -32,11 +62,10 @@ function Chatbot() {
eventQuery
(
'001_Welcome'
)
.
then
(
eventQuery
(
'002_Intro'
))
},
[])
},
[])
const
textQuery
=
async
(
text
)
=>
{
// First Need to take care of the message I sent
let
conversation
=
{
who
:
username
,
...
...
client/src/setupProxy.js
View file @
140e1d6
...
...
@@ -4,3 +4,4 @@ module.exports = function(app) {
app
.
use
(
proxy
(
"/api"
,
{
target
:
"http://localhost:5000/"
}));
};
//http://localhost:5000/
\ No newline at end of file
...
...
client/src/views/loginpage.js
View file @
140e1d6
...
...
@@ -17,10 +17,12 @@ const userInfo = async (info) => {
}
const
response
=
await
Axios
.
post
(
'/api/login/userInfo'
,
userVariables
);
if
(
response
.
data
){
if
(
response
.
data
!=
'FAIL'
){
// loginForm.action = `/chat?${response.data}`;
// loginForm.submit();
window
.
location
.
href
=
`/chat?keyword=
${
response
.
data
}
`
;
var
keyword
=
response
.
data
.
keyword
;
var
name
=
response
.
data
.
name
;
window
.
location
.
href
=
`/chat?keyword=
${
keyword
}
&name=
${
name
}
`
;
}
else
{
alert
(
"입력하신 정보와 일치하는 회원이 존재하지 않습니다 😥"
);
}
...
...
index.js
View file @
140e1d6
...
...
@@ -2,9 +2,9 @@ const express = require("express");
const
path
=
require
(
"path"
);
const
bodyParser
=
require
(
"body-parser"
);
const
app
=
express
();
const
config
=
require
(
"./server/config/keys"
);
app
.
set
(
'trust proxy'
,
true
);
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
true
}));
app
.
use
(
bodyParser
.
json
());
...
...
@@ -32,3 +32,6 @@ const port = process.env.PORT || 5000;
app
.
listen
(
port
,
()
=>
{
console
.
log
(
`Server Running at
${
port
}
`
)
});
// res.sendFile(path.resolve(__dirname, "client", "build", "index.html"));
\ No newline at end of file
...
...
package.json
View file @
140e1d6
...
...
@@ -4,8 +4,8 @@
"description"
:
"chatbot-app"
,
"main"
:
"index.js"
,
"engines"
:
{
"node"
:
"10.x
.x
"
,
"npm"
:
"6.
13.4
"
"node"
:
"10.x"
,
"npm"
:
"6.
x
"
},
"scripts"
:
{
"start"
:
"node index.js"
,
...
...
@@ -19,7 +19,6 @@
],
"license"
:
"ISC"
,
"dependencies"
:
{
"@google-cloud/bigquery"
:
"^4.7.0"
,
"actions-on-google"
:
"^2.12.0"
,
"axios"
:
"^0.19.2"
,
"body-parser"
:
"^1.18.3"
,
...
...
server/routes/users/login.js
View file @
140e1d6
...
...
@@ -20,6 +20,10 @@ router.post('/userInfo', async(req,res)=>{
};
result
=
getUser
(
simpleUserInfo
);
if
(
typeof
(
result
)
===
'undefined'
){
result
=
'FAIL'
}
console
.
log
(
"RESULT"
,
result
)
res
.
send
(
result
);
})
...
...
server/routes/users/user.js
View file @
140e1d6
...
...
@@ -24,10 +24,13 @@ function addUser(userInfo){
function
getUser
(
simpleUserInfo
){
let
userEmail
=
simpleUserInfo
.
email
;
let
userPw
=
simpleUserInfo
.
pw
;
let
result
=
""
;
let
result
;
for
(
var
i
=
0
;
i
<
users
.
length
;
i
++
){
if
(
userEmail
===
users
[
i
].
email
&&
userPw
===
users
[
i
].
pw
){
result
=
users
[
i
].
keyword
;
result
=
{
"name"
:
users
[
i
].
name
,
"keyword"
:
users
[
i
].
keyword
}
}
}
...
...
Please
register
or
login
to post a comment