/blockCrawl

๐Ÿฌ๊ต์œก์šฉ ๋ธ”๋ก์ฝ”๋”ฉ์„ ํ™œ์šฉํ•œ ์›น์ž๋™ํ™” ์ œ์ž‘ ํ”Œ๋ ›ํผ

Primary LanguageJavaScript

๊ต์œก์šฉ ๋ธ”๋ก์ฝ”๋”ฉ์„ ํ™œ์šฉํ•œ ์›น์ž๋™ํ™” ์ œ์ž‘ ํ”Œ๋ ›ํผ

๊ฐœ๋ฐœ๋™๊ธฐ

์‚ฌ๋ฌด์ง ์—…๋ฌด๋ฅผ ํ•˜๋Š”๋ฐ ์žˆ์–ด ๋งค๋ฒˆ ๋ฐ˜๋ณต์ ์ธ ์—…๋ฌด๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฐ”๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜๊ณ  ์ฒ˜๋ฆฌํ•˜๋Š” ์ผ์ž…๋‹ˆ๋‹ค.
๋งค๋ฒˆ ์ด๋Ÿฐ ๋‹จ์ˆœํ•˜๊ณ  ๋™์ผํ•œ ๊ณผ์ •์˜ ์—…๋ฌด์„ ์ฒ˜๋ฆฌํ•˜๊ธฐ์œ„ํ•ด ์—…๋ฌด ์ž๋™ํ™”์˜ ๋‹ˆ์ฆˆ๊ฐ€ ์ฆ๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
ํ•˜์ง€๋งŒ ์›น ์ž๋™ํ™” ๊ธฐ์ˆ ์€ ์ผ๋ฐ˜ ์‚ฌ๋ฌด์ง ๊ทผ๋กœ์ž๋“ค์ด ๋ฐฐ์šฐ๋ ค๋ฉด ์ƒ๋‹นํ•œ ๋Ÿฌ๋‹ ์ปค๋ธŒ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
์–ธ์–ด์˜ ์ž์ฒด ๊ธฐ์ดˆ๋ฌธ๋ฒ•์„ ๋ฐฐ์šฐ๊ณ  ๋กœ์ง ๊ตฌํ˜„์„ ์œ„ํ•ด์„œ๋Š” ์ตœ์†Œ 24์‹œ๊ฐ„์˜ ํ•™์Šต ์‹œ๊ฐ„์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
๊ทธ๋ ‡๋‹ค๊ณ  ๋‹จ์ˆœํžˆ ์ž๋ฃŒ ์กฐ์‚ฌ๋ฅผ ์œ„ํ•ด ์™ธ์ฃผ ์ž‘์—…์„ ๋งก๊ธฐ๊ธฐ์—๋Š” ๋ฌด๋ฆฌ๊ฐ€ ์žˆ์–ด ๊ฒฐ๊ตญ ๋ฐ˜๋ณต์ ์ธ ์—…๋ฌด๋ฅผ ์ง์ ‘ ํ•˜๊ฒŒ๋ฉ๋‹ˆ๋‹ค.


๋”ฐ๋ผ์„œ ๋ˆ„๊ตฌ๋‚˜ ์‰ฝ๊ฒŒ GUIํ™˜๊ฒฝ์—์„œ ์ž๋™ํ™” ๋กœ์ง์„ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐœ๋ฐœ ํ”Œ๋žซํผ์„ ๋งŒ๋“ค๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
์Šคํฌ๋ฆฝํŠธ ์ฝ”๋“œ ์ž‘์„ฑ์—†์ด ๋ˆ„๊ตฌ๋‚˜ ์†์‰ฝ๊ฒŒ ๊ต์œก์šฉ ๋ธ”๋ก์ฝ”๋”ฉ์œผ๋กœ
์ž๋™ํ™” ์†Œํ”„ํŠธ์›จ์–ด๋ฅผ ๋งŒ๋“ค์–ด ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๊ทธ๋ฆฌ๊ณ  ์ž˜ ๋งŒ๋“  ๋ธ”๋ก ๋กœ์ง์„ ๋‹ค๋ฅธ ์‚ฌ๋žŒ๊ณผ ๊ณต์œ ํ•˜๊ณ  ๋ฐ์ดํ„ฐ ๋ถ„์„์ด ๊ฐ€๋Šฅํ•œ ํด๋ผ์šฐ๋“œ ํ”Œ๋žซํผ์ด ์ตœ์ข… ๋ชฉํ‘œ์ž…๋‹ˆ๋‹ค.

๊ฐœ๋ฐœ ๋ชฉํ‘œ

1. ๋ธ”๋ก์ฝ”๋”ฉ ์‹œ์Šคํ…œ์„ ์™„์„ฑํ•˜์—ฌ ์›น๋ฌธ์„œ์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜๊ณ , ์ด๋ฏธ์ง€ ๋ฐ PDF ์ •๋ณด๋„ ์ˆ˜์ง‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
2. ๋น…๋ฐ์ดํ„ฐ ์ˆ˜์ง‘์„ ์œ„ํ•œ ์‹œ์Šคํ…œ์„ ๋งŒ๋“ค๊ณ  ์ˆ˜์ง‘๋œ ์ •๋ณด๋ฅผ ์—‘์…€๋กœ ๋‹ค์šด๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ฃผ์š” ๊ธฐ๋Šฅ

๋ธ”๋ก์ฝ”๋”ฉ์œผ๋กœ
์›น์ž๋™ํ™” ๋กœ์ง๊ตฌํ˜„ ๊ฐ€๋Šฅ

GoToPage
ํŠน์ • URLํŽ˜์ด์ง€ ์ด๋™

Get Selector
HTML ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘

Get PDF/IMG
ํ˜„์žฌ ํŽ˜์ด์ง€๋ฅผ PDF,IMG๋กœ ๋ณ€ํ™˜

๋‹ค์ˆ˜์˜ ULR ๊ณผ ํŽ˜์ด์ง€๋‹น ํ…Œ๊ทธ ์ž…๋ ฅํ•˜์—ฌ ์—‘์…€๋ฐ์ดํ„ฐ ์ถ”์ถœ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ์‹œ
๊ธˆ์œต๋ฐ์ดํ„ฐ ์ˆ˜์ง‘
์ปค๋ฎค๋‹ˆํ‹ฐ์‚ฌ์ดํŠธ ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘

๊ตฌ์กฐ

./Docs/blockcrawl_arch.png

WebUI & demo

demo1.gif demo2.gif demo3.gif demo4.gif

์„ค์น˜ ๋ฐ ์‹คํ–‰

  1. front-end, back-end ๊นƒํ—ˆ๋ธŒ ํด๋ก 

  2. npm install or yarn install

  • example
C:\Users\Dos\Desktop\Projects\blockcrawl_frontend>yarn install
C:\Users\Dos\Desktop\Projects\blockcrawl_backend>yarn install
  1. .env ์…‹ํŒ…
NAME = "DOYOUNG"
PORT = 4000
SERVER_URL = "http://localhost:4000/"

# DB_URI = "mongodb://dosimpact:589742@133.186.241.220:27017/admin"
DB_URI = "mongodb://dosimpact:589742@127.0.0.1:27017/admin"

REMOVE_FILE_TIME = 300000

HEAD_LESS = "false"
BRS_WIDTH = 1660
BRS_HEIGHT = 900
  1. ์‹คํ–‰ํ•˜๊ธฐ - yarn start | dev
  • example
C:\Users\Dos\Desktop\Projects\blockcrawl_frontend>yarn start
yarn run v1.21.1
$ react-scripts start


C:\Users\Dos\Desktop\Projects\blockCrawl_backend>yarn dev
yarn run v1.21.1
$ nodemon --exec babel-node src/server.js
โœ” Server is running on http://localhost:4000
โœ” MongoDB connected...
โœ” puppeteer is running

๋ฒ ํฌ ํ•˜๊ธฐ

FrontSide Docker Devops - DevServer Container

  • STEP1 .dockerignore
node_modules
build
.dockerignore
Dockerfile
Dockerfile.prod
  • STEP2 DockerFile
FROM node:carbon

RUN mkdir -p /app
WORKDIR /app
ADD ./ /app

ENV NODE_ENV=production
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json /app/package.json

RUN npm install --silent
RUN npm install react-scripts@3.4.1 -g


EXPOSE 3000

CMD npm start
  • STEP3 build docker file
docker build -t ehdudtkatka/bc_front:0.0.4 .
  • STEP4 execution docker image
docker run --name bc_front -itd -p 80:3000 ehdudtkatka/bc_front:0.4

  • STEP5 check container and monit
docker run --name bc_front -itd -p 80:3000 ehdudtkatka/bc_front:0.4
docker logs bc_front
docker exec -it bc_front /bin/bash

ServerSide Docker Devops - DevServer Container

  • STEP1 .dockerignore
node_modules
build
.dockerignore
Dockerfile
Dockerfile.prod
  • STEP2 DockerFile
FROM node:10.20.1-slim@sha256:05d1d270480b6e99753076b6656bb5a37edb7ca31af20c008568a556bc82d2a8

RUN  apt-get update

RUN  apt-get install -y wget gnupg ca-certificates \
     && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
     && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'

RUN  apt-get update \
     && apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \
     --no-install-recommends \
     && rm -rf /var/lib/apt/lists/* \
     && wget --quiet https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -O /usr/sbin/wait-for-it.sh \
     && chmod +x /usr/sbin/wait-for-it.sh


RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
ENV PATH=/usr/src/app/node_modules/.bin:$PATH

COPY package.json /usr/src/app/package.json
RUN npm install --silent

COPY . /usr/src/app

EXPOSE 4000

CMD npm run start
  • STEP3 build docker file
docker build -t ehdudtkatka/bc_back:0.4 .
  • STEP4 execution docker image
docker run --name bc_back -itd -p 4000:4000 ehdudtkatka/bc_back:0.4

  • STEP5 check container and monit
docker run --name bc_back -itd -p 4000:4000 ehdudtkatka/bc_back:0.4
docker exec -it bc_back /bin/bash
pm2 monit

ํ™œ์šฉ ๊ธฐ์ˆ 

PC ๋นŒ๋“œ
Chrome ์›น ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜
Node.js Win32/64 ๋ฐ์Šคํฌํ†ฑ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜

๊ธฐ์ˆ  ๋ฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ
Front	 React JS, Hook , Apollo Client, Blockly, Redux
Back 	 Node.js, Express, Graphql-yoga, multer/s3, puppeteer, Prisma
Devops   NCP,Docker, Netlify, AWS S3,

๋ž˜ํผ๋Ÿฐ์Šค

๊นƒํ—ˆ๋ธŒ ์ฃผ์†Œ
https://github.com/DosImpact/blockCrawl_frontend
https://github.com/DosImpact/blockCrawl_backend

์‚ฌ์ดํŠธ ์ฃผ์†Œ
์›น์‚ฌ์ดํŠธ LiveDemo :  http://133.186.241.220

์‚ฌ์šฉ์ž ๊ฐœ๋ฐœ์ž ํ…Œ์ŠคํŠธ ๊ฐ€์ด๋“œ
https://drive.google.com/file/d/1PRBB5QHYw0ZnwUi3E5V3t8-hyRpMkq1E/view?usp=sharing

์ด์ „ ๋ฒ„์ „ Docs

./Docs/deprecated.md