Showing
2 changed files
with
85 additions
and
9 deletions
1 | -![node-16.14.2](https://img.shields.io/badge/Node-16.14.2-green?style=for-the-badge) | 1 | +![node-17.9.0](https://img.shields.io/badge/Node-17.9.0-green) |
2 | +![express-4.18.1](https://img.shields.io/badge/Express-4.18.1-green) | ||
3 | +![sequelize-6.20.0](https://img.shields.io/badge/Sequelize-6.20.0-green) | ||
4 | + | ||
5 | +![go-1.17.3](https://img.shields.io/badge/Go-1.17.3-blue) | ||
6 | +![goecho-4.7.2](https://img.shields.io/badge/Echo-4.7.2-blue) | ||
7 | +![python-latest](https://img.shields.io/badge/Python-latest-blue) | ||
8 | +![fastapi-0.77.1](https://img.shields.io/badge/Fastapi-0.77.1-blue) | ||
9 | + | ||
10 | +![mysql-5.7](https://img.shields.io/badge/Mysql-5.7-yellowgreen) | ||
2 | 11 | ||
3 | <div align="center"><img src="./readme_logo.png" width="20%" height="20%"></div> | 12 | <div align="center"><img src="./readme_logo.png" width="20%" height="20%"></div> |
4 | 13 | ||
5 | -## 매무리 봇 (Mamuri-bot) | 14 | +# 매무리 봇 (Mamuri-bot) |
6 | 15 | ||
7 | 사용자에게 입력받은 키워드를 통해 3곳의 중고매물 사이트(중고나라, 당근마켓, 번개장터)에 매물을 감지, 알림을 전송하는 봇입니다. | 16 | 사용자에게 입력받은 키워드를 통해 3곳의 중고매물 사이트(중고나라, 당근마켓, 번개장터)에 매물을 감지, 알림을 전송하는 봇입니다. |
8 | 17 | ||
... | @@ -19,27 +28,94 @@ | ... | @@ -19,27 +28,94 @@ |
19 | 28 | ||
20 | - [Node.js](https://nodejs.org/ko/) | 29 | - [Node.js](https://nodejs.org/ko/) |
21 | - [Express](https://expressjs.com/ko/) | 30 | - [Express](https://expressjs.com/ko/) |
31 | +- [Go](https://go.dev/) | ||
32 | +- [Echo](https://echo.labstack.com) | ||
33 | +- [Python](https://python.org) | ||
34 | +- [FastAPI](https://fastapi.tiangolo.com/) | ||
35 | +- [ngrok](https://ngrok.com) | ||
22 | 36 | ||
23 | ## Getting Started | 37 | ## Getting Started |
24 | 38 | ||
25 | ### Prerequisites | 39 | ### Prerequisites |
26 | 40 | ||
27 | -- Node.js | 41 | +Need to installation docker and docker-compose |
42 | +- [Docker](https://www.docker.com/get-started/) | ||
43 | +- [Docker-compose](https://docs.docker.com/compose/install/) | ||
44 | + | ||
45 | +Need to write secret | ||
46 | +- `mamuri-bot/database/mysql_init/.env` | ||
47 | + ```dotenv | ||
48 | + # Database Configuration | ||
49 | + TZ=Asia/Seoul | ||
50 | + MYSQL_HOST={YOUR_MYSQL_HOST} | ||
51 | + MYSQL_PORT={YOUR_MYSQL_PORT} | ||
52 | + MYSQL_ROOT_PASSWORD={YOUR_MYSQL_ROOT_PASSWORD} | ||
53 | + ``` | ||
54 | + | ||
55 | +- `mamuri-bot/joongna/config/.env` | ||
56 | + ```dotenv | ||
57 | + # Secret Configuration | ||
58 | + SECRET.CLIENTID={NAVER_API_CLIENT_ID} | ||
59 | + SECRET.CLIENTSECRET={NAVER_API_CLIENT_SECRET} | ||
60 | + | ||
61 | + # Header Configuration | ||
62 | + HEADER.COOKIE=NID_SES={YOUR_COOKIE} | ||
63 | + HEADER.USERAGENT={YOUR_SYSTEM_USER_AGENT} | ||
64 | + ``` | ||
65 | + | ||
66 | +- `mamuri-bot/ngrok/ngrok.yml` | ||
67 | + ```yaml | ||
68 | + authtoken: { YOUR_NGROK_AUTH_TOKEN } | ||
69 | + version: 2 | ||
70 | + tunnels: | ||
71 | + mamuri: | ||
72 | + proto: http | ||
73 | + addr: mamuri-server:8080 | ||
74 | + ``` | ||
75 | + | ||
76 | +- `mamuri-bot/server/config/.env` | ||
77 | + ```dotenv | ||
78 | + channelAccessToken: {YOUR_LINE_CHANNEL_ACCESS_TOKEN} | ||
79 | + channelId: {YOUR_LINE_CHANNEL_ID} | ||
80 | + channelSecret: {YOUR_LINE_CHANNEL_SECRET} | ||
81 | + ``` | ||
28 | 82 | ||
29 | ### Installation | 83 | ### Installation |
30 | 84 | ||
31 | 1. Clone the repository | 85 | 1. Clone the repository |
32 | ``` | 86 | ``` |
33 | - git clone http://khuhub.khu.ac.kr/2018102211/secondhand-noti-bot | 87 | + git clone http://khuhub.khu.ac.kr/2018102211/mamuri-bot |
34 | - ``` | ||
35 | -2. Install NPM packages | ||
36 | ``` | 88 | ``` |
37 | - npm install | 89 | +2. Put your secret files that you create in prerequisite to |
90 | + ```shell | ||
91 | + mamuri-bot/database/mysql_init/.env | ||
92 | + mamuri-bot/joongna/config/.env | ||
93 | + mamuri-bot/ngrok/ngrok.yml | ||
94 | + mamuri-bot/server/config/.env | ||
38 | ``` | 95 | ``` |
39 | -3. Start Project | 96 | +3. Executing `deploy.sh` for deployment with docker-compose |
97 | + | ||
98 | + This script will `build` all images automatically and `docker-compose up` on your system | ||
99 | + ```shell | ||
100 | + #!/usr/bin/env bash | ||
101 | + | ||
102 | + ./deploy.sh | ||
103 | + | ||
104 | + # docker build -t daangn-api-server ./daangn/ | ||
105 | + # docker build -t joongna-api-server ./joongna/ | ||
106 | + # docker build -t bunjang-api-server ./bunjang/ | ||
107 | + # docker build -t mamuri-db ./database/ | ||
108 | + # docker build -t mamuri-server ./server/ | ||
109 | + # docker build -t mamuri-ngrok ./ngrok/ | ||
110 | + # docker-compose up -d | ||
40 | ``` | 111 | ``` |
41 | - npm start | 112 | +4. Check your ngrok public URL |
113 | + ```shell | ||
114 | + docker logs mamuri-ngrok | ||
42 | ``` | 115 | ``` |
116 | + ![ngrok_deployment_1](http://khuhub.khu.ac.kr/2018102211/mamuri-bot/uploads/4ccdc73c9efc4c3dc58147f17b992cc6/그림1.png) | ||
117 | +5. Set your public URL to Line chatbot configuration for webhook | ||
118 | + ![ngrok_deployment_2](http://khuhub.khu.ac.kr/2018102211/mamuri-bot/uploads/5dd076f66629948dd1682fc4054ff459/그림2.png) | ||
43 | 119 | ||
44 | ## Contributing | 120 | ## Contributing |
45 | 121 | ... | ... |
-
Please register or login to post a comment