README.md 13.6 KB

node-17.9.0 express-4.18.1 sequelize-6.20.0

go-1.17.3 goecho-4.7.2 python-latest fastapi-0.77.1

mysql-5.7 ngrok-v3

매무리 봇 (Mamuri-bot)

사용자에게 입력받은 키워드를 통해 3곳의 중고매물 사이트(중고나라, 당근마켓, 번개장터)에 매물을 감지, 알림을 전송하는 봇입니다.

About The Project

  • 봇을 사용해 키워드를 입력 받습니다.
  • 주기적 크롤링을 통해 새로운 매물을 감지해 알림을 전송합니다.

Overview

mockup_1x

Project Architecture

project_structure

Built With

Getting Started

Prerequisites

Need to installation docker and docker-compose

Need to write secret

  • mamuri-bot/database/mysql_init/.env
  # Database Configuration
  TZ=Asia/Seoul
  MYSQL_HOST={YOUR_MYSQL_HOST}
  MYSQL_PORT={YOUR_MYSQL_PORT}
  MYSQL_ROOT_PASSWORD={YOUR_MYSQL_ROOT_PASSWORD}
  • mamuri-bot/joongna/config/.env
  # Secret Configuration
  SECRET.CLIENTID={NAVER_API_CLIENT_ID}
  SECRET.CLIENTSECRET={NAVER_API_CLIENT_SECRET}
  # Header Configuration
  HEADER.COOKIE=NID_SES={YOUR_COOKIE}
  HEADER.USERAGENT={YOUR_SYSTEM_USER_AGENT}
  • mamuri-bot/ngrok/ngrok.yml
  authtoken: { YOUR_NGROK_AUTH_TOKEN }
  version: 2
  tunnels:
    mamuri:
      proto: http
      addr: mamuri-server:8080
  • mamuri-bot/server/config/.env dotenv channelAccessToken: {YOUR_LINE_CHANNEL_ACCESS_TOKEN} channelId: {YOUR_LINE_CHANNEL_ID} channelSecret: {YOUR_LINE_CHANNEL_SECRET}

Installation

  1. Clone the repository
git clone http://khuhub.khu.ac.kr/2018102211/mamuri-bot
  1. Put your secret files that you create in prerequisite to
mamuri-bot/database/mysql_init/.env
mamuri-bot/joongna/config/.env
mamuri-bot/ngrok/ngrok.yml
mamuri-bot/server/config/.env
  1. Executing deploy.sh for deployment with docker-compose. This script will build all images automatically and docker-compose up on your system
#!/usr/bin/env bash
./deploy.sh
# docker build -t daangn-api-server ./daangn/
# docker build -t joongna-api-server ./joongna/
# docker build -t bunjang-api-server ./bunjang/
# docker build -t mamuri-db ./database/
# docker build -t mamuri-server ./server/
# docker build -t mamuri-ngrok ./ngrok/
# docker-compose up -d
  1. Check your ngrok public URL
docker logs mamuri-ngrok

ngrok_deployment_1
  1. Set your public URL to Line chatbot configuration for webhook
    ngrok_deployment_2

Contributing

프로젝트에 기여하고 싶으신 분들은 아래 절차를 따라주시기 바랍니다.

  1. 프로젝트 fork
  2. feature branch 생성 (git checkout -b feature/name)
  3. commit (git commit -m "Add feature)
  4. push (git push origin feature/name)
  5. pull request 생성

License

MIT 라이센스 아래 사용 가능합니다. LICENSE.txt를 통해 자세한 정보를 확인하세요.

Contact

  • 유명현: mhlew0106@khu.ac.kr
  • 윤준석: phobyjun@khu.ac.kr