Skip to content

Commit

Permalink
Merge pull request #105 from kookmin-sw/develop
Browse files Browse the repository at this point in the history
20230523 Master branch update
  • Loading branch information
young43 authored May 23, 2023
2 parents 6daca42 + a7ec944 commit 3d9fdc9
Show file tree
Hide file tree
Showing 70 changed files with 18,550 additions and 4,666 deletions.
137 changes: 125 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@


# 함께할래 ?
<img style="width: 120px; margin:auto; display:block" src="https://github.com/kookmin-sw/capstone-2023-14/assets/54922803/ddee6de4-efb1-4672-9b64-e8996857ce8b" alt="함께할래 로고">

- Capstone Design Project for Kookmin University, 2023
- [Check out the github-pages here](https://kookmin-sw.github.io/capstone-2023-14/)


### 1. 프로젝트 소개

팬데믹 당시 억눌려있었던 여행에 대한 갈망이 엔데믹 이후 증가하면서 많은 분들이 다시 여행을 가기 시작했습니다. 그러나 정작 본인이 가고픈 다음 여행지를 모를 때도 있을뿐더러, 나와 여행 기간, 예상 경비 등 조건이 맞는 지인을 찾기 힘들 때가 있습니다.
Expand All @@ -12,6 +15,10 @@

'함께할래?' 는 이전에 가봤던 여행지 선호도와 본인의 취향에 기반하여 비슷한 여행지를 추천하고, 자신의 여행 성향과 유사한 동행인을 쉽고 간편하게 추천해주는 서비스입니다.

<br/>

### Abstract

Many people started to travel again as their expectation for travel which was suppressed during pandemic increased with the pandemic coming to an end.
However, they are unsure about their destination and itinerary. It is very hard to find someone who meets travel conditions such as travel period and travel expenses.

Expand All @@ -20,24 +27,130 @@ Therefore, We would like to solve the inconvenience by recommending a companion

‘Do you want to join me?’ is a service that recommends similar destinations based on your preference for travel destinations and your taste, and conveniently recommends companions similar to your travel tendency.

---

### 2. 주요 기능

- 여행 리뷰 데이터를 전처리 작업을 통해 키워드를 추출 → 유저가 매긴 여행지 선호도 점수를 기반으로 다음 여행지 추천 모델을 구축
- 유저에게 입력받은 여행 성향 데이터를 기반하여 유사한 성격을 가진 다른 사용자를 추천하는 동행인 추천 모델을 구현
- 구현한 모델을 바탕으로 유저에게 추천 여행지 및 동행자를 메인페이지에서 노출시켜 확인
- 게시글을 통해 직접 동행자를 모집 할 수 있으며 댓글을 활용하여 소통 가능


---

### 3. 시스템 구성도

### 2. 소개 영상
![SW아키텍쳐](https://github.com/kookmin-sw/capstone-2023-14/assets/55116940/a8425ff4-7d88-4c1a-9a5c-40cd26f5fddd)

프로젝트 소개하는 영상을 추가하세요
---

### 3. 팀 소개
### 4. 소개 영상

| <span style="justify-content:center; align-items: center; display: flex;">윤서영</span> | <span style="justify-content:center; align-items: center; display: flex">김지홍</span> | <span style="justify-content:center; align-items: center; display: flex">남상림</span> |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <img width="200px" src="https://user-images.githubusercontent.com/54922803/227139823-d6c577b9-9206-4a2b-9e0c-427aecb39737.jpeg"> | <img width="200px" src="https://user-images.githubusercontent.com/54922803/227139864-32700bd9-a38b-4e00-ba2a-799e94912a46.jpeg"> | <img width="200px" src="https://user-images.githubusercontent.com/54922803/227139845-b502b414-5a07-4054-adb7-f466bd93594d.jpeg"> |
| 👩🏻‍💻 학번: xxxx1633 | 👩🏻‍💻 학번: xxxx1572 | 👩🏻‍💻 학번: xxxx1584 |
[![Video Label](http://img.youtube.com/vi/FoNKwS__j4M/0.jpg)](https://youtu.be/FoNKwS__j4M)

---

### 5. 팀 소개

| <span style="justify-content:center; align-items: center; display: flex;">윤서영</span> | <span style="justify-content:center; align-items: center; display: flex">김지홍</span> | <span style="justify-content:center; align-items: center; display: flex">남상림</span> |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img width="200px" src="https://user-images.githubusercontent.com/54922803/227139823-d6c577b9-9206-4a2b-9e0c-427aecb39737.jpeg"> | <img width="200px" src="https://github.com/kookmin-sw/capstone-2023-14/assets/54922803/ee000a30-d6d7-47f7-8acc-7aae6d8a37da"> | <img width="200px" src="https://user-images.githubusercontent.com/54922803/227139845-b502b414-5a07-4054-adb7-f466bd93594d.jpeg"> |
| 👩🏻‍💻 학번: xxxx1633 | 👩🏻‍💻 학번: xxxx1572 | 👩🏻‍💻 학번: xxxx1584 |
| Team Leader, Data Mining, Server | FrontEnd, BackEnd | FrontEnd, BackEnd, Design |
| <div style="display:flex; gap: 4px; align-items:center "><img width="20px" style="align: center;" src="https://raw.githubusercontent.com/tandpfun/skill-icons/59059d9d1a2c092696dc66e00931cc1181a4ce1f/icons/Github-Dark.svg"> [young43](https://github.com/young43) </div> | <div style="display:flex; gap: 4px; align-items:center "><img width="20px" style="align: center;" src="https://raw.githubusercontent.com/tandpfun/skill-icons/59059d9d1a2c092696dc66e00931cc1181a4ce1f/icons/Github-Dark.svg"> [Ziihong](https://github.com/Ziihong) </div> | <div style="display:flex; gap: 4px; align-items:center "><img width="20px" style="align: center;" src="https://raw.githubusercontent.com/tandpfun/skill-icons/59059d9d1a2c092696dc66e00931cc1181a4ce1f/icons/Github-Dark.svg"> [sanglim00](https://github.com/sanglim00) </div> |

### 4. 사용법
---

### 6. 사용법

#### 프론트엔드

(1) AWS EC2 서버 인스턴스를 실행 후, SSH 터미널로 접속한다.

(2) nginx 를 설치한다.

```shell
sudo apt-get install nginx
```

(3) /etc/nginx/ 폴더로 들어가서 해당 명령어를 실행하여 파일을 복사하고 링크를 생성한다

```shell
cd /etc/nginx/
sudo cp ~/capstone-2023-14/nginx/site-available/client ./site-available/
sudo ln -s ./site-available/client ./site-enabled/
```

(4) 해당 Git Repository를 Clone 한다.

```shell
git clone https://github.com/kookmin-sw/capstone-2023-14.git
```

(5) Node.js 16버전을 설치한다.

```shell
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
```

(6) npm 패키지 설치를 진행한다.

```shell
cd ~/capstone-2023-14/frontend
npm install
```

(7) 빌드 진행 후 nginx를 구동시킨다.

```shell
npm run build
sudo systemctl start nginx
```

<br/>

#### 백엔드

(1) forever 패키지를 다운로드한다.

```shell
cd ~/capstone-2023-14/backend/
npm -g install forever
```

(2) forever를 통해 Node.js express 모듈을 실행한다.

```shell
forever start -w app.js
```

<br/>

#### 추천모델 API

(1) DM폴더로 이동후, requirements.txt 를 통해 Python3 package를 설치한다.

```shell
cd ~/capstone-2023-14/DM/
pip3 install -r requirements.txt
```

(2) crawling.py 를 실행하여 네이버 블로그 글을 크롤링 해온다.

```shell
python3 crawling.py
```

(3) csv_to_db.py 를 실행하여 크롤링 한 데이터를 벡터화 시킨다.

소스코드제출시 설치법이나 사용법을 작성하세요.
```
python3 csv_to_db.py
```

### 5. 기타
(4) nohup 명령어를 사용하여 flask 서버를 백그라운드로 동작시킨다.

추가적인 내용은 자유롭게 작성하세요.
```shell
nohup app.py &
```
17 changes: 14 additions & 3 deletions backend/controllers/auth.ctrl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import bcrypt from 'bcrypt';
import jsonwebtoken from 'jsonwebtoken';
import db from '../config/db.js';
import formidable from 'formidable';

const secretKey = process.env.HASH_SECRET_KEY;

Expand Down Expand Up @@ -38,7 +37,19 @@ const login = (req, res) => {
};

const signUp = (req, res) => {
const { email, passwd, name, phone, gender, birth, mbti, profile } = req.body;
const { email, passwd, name, phone, gender, birthday, mbti, profile } =
req.body;

let newProfile = null; // profile string 타입
try {
if (profile !== '') {
const [, base64Data] = profile.split(',');
newProfile = Buffer.from(base64Data, 'base64');
}
} catch (e) {
console.log(e);
}

// 이메일 중복 검사
db.query('SELECT * FROM member WHERE email = ?', [email], (error, result) => {
if (error) throw error;
Expand All @@ -55,7 +66,7 @@ const signUp = (req, res) => {

db.query(
'INSERT INTO member (email, passwd, name, phone_number, gender, birth, mbti, profile) VALUES (?,?,?,?,?,?,?,?)',
[email, password_hash, name, phone, gender, birth, mbti, profile],
[email, password_hash, name, phone, gender, birthday, mbti, newProfile],
(error, result) => {
if (error) throw error;
res.status(201).json({ success: true });
Expand Down
47 changes: 41 additions & 6 deletions backend/controllers/board.ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,23 @@ const saveBoard = (req, res) => {
};

const getBoardList = (req, res) => {
const query = `SELECT b.*, m.gender, m.birth, m.mbti FROM board as b, member as m where b.writer=m.name;`;
const query = `SELECT b.*, m.gender, m.birth, m.mbti, m.profile FROM board as b, member as m where b.writer=m.name;`;

db.query(query, (error, result) => {
if (error) throw error;
res.send(result);

try {
const newBoardList = result.map((post) => {
if (post.profile != null) {
const buff = Buffer.from(post.profile);
post.profile = buff.toString('base64');
}
return post;
});
res.send(newBoardList);
} catch (e) {
console.log(e);
}
});
};

Expand All @@ -34,24 +46,47 @@ const saveReply = (req, res) => {
const getReplyList = (req, res) => {
const { board_id } = req.body;

const query = `SELECT * FROM reply WHERE board_id=?;`;
const query = `select r.*, m.profile, m.name from reply as r, member as m where board_id=? and r.replyer = m.email;`;
const values = [board_id];

db.query(query, values, (error, result) => {
if (error) throw error;
res.send(result);

try {
const newReplyList = result.map((reply) => {
if (reply.profile !== null) {
const buff = Buffer.from(reply.profile);
reply.profile = buff.toString('base64');
}
return reply;
});

res.send(newReplyList);
} catch (e) {
console.log(e);
}
});
};

const getUserInfo = (req, res) => {
const { email } = req.body;

const query = `SELECT name, gender, birth, mbti FROM member WHERE email=?;`;
const query = `SELECT name, gender, birth, mbti, profile FROM member WHERE email=?;`;
const values = [email];

db.query(query, values, (error, result) => {
if (error) throw error;
res.send(result);

try {
const info = result[0];
if (info.profile !== null) {
const buff = Buffer.from(info.profile, 'binary');
info.profile = buff.toString('base64');
}
return res.send([info]);
} catch (e) {
console.log(e);
}
});
};

Expand Down
49 changes: 28 additions & 21 deletions backend/controllers/recommend.ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ const getFirstImage = (req, res) => {
(error, result) => {
if (error) throw error;

const newRecommendList = result.map((city) => {
let buff = Buffer.from(city.picture1, 'binary');
return {
...city,
imgUrl: buff.toString('base64'),
};
});
res.send(newRecommendList);
try {
const newRecommendList = result.map((city) => {
let buff = Buffer.from(city.picture1, 'binary');
return {
...city,
imgUrl: buff.toString('base64'),
};
});
res.send(newRecommendList);
} catch (e) {
console.log(e);
}
}
);
};
Expand All @@ -34,19 +38,22 @@ const getInfo = (req, res) => {
(error, result) => {
if (error) throw error;

const info = result[0];
let buff1 = Buffer.from(info.picture1, 'binary');
let buff2 = Buffer.from(info.picture2, 'binary');
let buff3 = Buffer.from(info.picture3, 'binary');

const infoDetail = {
...info,
imgUrl1: buff1.toString('base64'),
imgUrl2: buff2.toString('base64'),
imgUrl3: buff3.toString('base64'),
};

res.send(infoDetail);
try {
const info = result[0];
let buff1 = Buffer.from(info.picture1, 'binary');
let buff2 = Buffer.from(info.picture2, 'binary');
let buff3 = Buffer.from(info.picture3, 'binary');

const infoDetail = {
...info,
imgUrl1: buff1.toString('base64'),
imgUrl2: buff2.toString('base64'),
imgUrl3: buff3.toString('base64'),
};
res.send(infoDetail);
} catch (e) {
console.log(e);
}
}
);
};
Expand Down
20 changes: 12 additions & 8 deletions backend/controllers/record.ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ const getItineraryList = async (req, res) => {
(error, result) => {
if (error) throw error;

const itineraryList = result.map((itinerary) => {
const buff = Buffer.from(itinerary.picture, 'binary');
return {
...itinerary,
imgUrl: buff.toString('base64'),
};
});
res.send(itineraryList);
try {
const itineraryList = result.map((itinerary) => {
const buff = Buffer.from(itinerary.picture, 'binary');
return {
...itinerary,
imgUrl: buff.toString('base64'),
};
});
res.send(itineraryList);
} catch (e) {
console.log(e);
}
}
);
};
Expand Down
Loading

0 comments on commit 3d9fdc9

Please sign in to comment.