모듈 식 서비스 아키텍처는 CouchDB+Lucene을 SearchEngine으로 사용하여 컨텐츠를 통해 URL을 색인 및 검색하는 것입니다.
참고 :이 프로젝트는 여전히 개발 중입니다. WIP를 기대하십시오!
참고 : (Docker 및 Docker-Compose 필수)
// Build docker containers (1st time)
docker-compose build
// Launch all required services
# [PRODUCTION]
docker-compose up
# [DEVELOPMENT]
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
// Open UI
open http://localhost:8080
참고 : 전체 CouchDB 데이터 재설정 실행 (경고, 모든 데이터가 지워집니다).
docker-compose rm && rm DatabaseInit/dbinitstatus/.dbinitdone
참고 : (Docker 및 Docker-Compose 필수)
// Test GetImageFromURL
open http://localhost:3000/?url=www.botdream.com&width=1024&height=900
// Test GetContentFromURL
curl http://localhost:6000/?url=www.botdream.com
// Open CouchDB UI
open http://localhost:5984/_utils/database.html?searchengine/_all_docs
// Test CouchDB+Lucene search
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_content?q=brilliant&include_docs=true | jq .
//DBProxy service
[POST] curl -d 'url=http://www.botdream.com' http://localhost:8000/url
[DELETE] curl -X DELETE http://localhost:8000/remove/http-botdream-com-botdream-com-botdream-com%2F2017-04-21T23%3A11%3A04.910Z | jq .
[GET] curl http://localhost:8000/search/botdream | jq .
// shutdown services
docker-compose stop
OR
CTRL+C in the original terminal
// clean services data (reset containers)
docker-compose rm
// when changing source code you should rebuild docker images, use this generic command to build all and ignore cache (will take some time, forces to rebuild all images from scratch)
docker-compose build --no-cache
TODO :
CouchDB 데이터베이스 이니셜 라이저.
빠른 서비스 테스트를 위해서는이 명령을 실행합니다.
cd DatabaseInit
./docker_build.sh
./docker_run.sh
WebApp UI에 반응합니다.
빠른 서비스 테스트를 위해서는이 명령을 실행합니다.
cd UI
./docker_build.sh
./docker_run.sh
open http://localhost:8080
Express and Phantomjs로 구동되는 간단한 스크린 샷 웹 서비스. Screenshot-App에서 포크.
여기에서는 원본 문서입니다
빠른 서비스 테스트를 위해서는이 명령을 실행합니다.
cd GetImageFromURL
./docker_build.sh
./docker_run.sh
open http://localhost:3000/?url=www.botdream.com&width=1024&height=900
// or with clipping params
open http://localhost:3000/?url=www.botdream.com&width=1024&height=900&clipRect=%7B%22top%22%3A0%2C%22left%22%3A0%2C%22width%22%3A1024%2C%22height%22%3A800%7D
curl http://localhost:3000/?url=www.botdream.com&width=1024&height=900 > botdream.png
curl --silent http://localhost:3000/?url=www.botdream.com&width=1024&height=900 | imgcat
Express and Cheerio.js로 구동되는 간단한 콘텐츠 스크래핑 웹 서비스
빠른 서비스 테스트를 위해서는이 명령을 실행합니다.
cd GetContentFromURL
./docker_build.sh
./docker_run.sh
curl http://localhost:6000/?url=www.botdream.com
데이터베이스와 일부 문서를 작성 한 다음 CouchDB-Lucene readme에 설명 된대로 인덱스를 설정하고 쿼리 할 수 있습니다.
빠른 서비스 테스트를 위해서는이 명령을 실행합니다.
cd CouchDBLucene
docker-compose up
./database_init.sh
open http://localhost:5984/_utils/
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_content?q=nirvana&include_docs=true | jq .
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_content?q=einstein&include_docs=true | jq .
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_content?q=brilliant&include_docs=true | jq .
// Clear CouchDB data
docker-compose rm
Couchdb-Lucene FullText 검색에 대한 자세한 정보 : Couchdblucene-Fulltext Search
Go Goog Google에서 Google 크롬 북마크를 Couchdb-Lucene으로 내보내는 간단한 도구.
빠른 서비스 테스트를 위해서는이 명령을 실행합니다.
cd SendFavoritesToCouchDB
# export Chrome Bookmark file to ./bookmarks_sample.html
# ./build.sh # in case you need to change the sourcecode and compile the tool
# Launch CouchDB-Lucene service and initialize database
# Launch GetContentFromURL service
./SendFavoritesToCouchDB ./bookmarks_sample.html
Vue.js, 기본 Webpack-Dev-Server HTTP 서버를 사용하는 실험 UI, 백엔드가 아직 구현되지 않았으며 Docker 컨테이너가 없습니다!
빠른 서비스 테스트를 위해서는이 명령을 실행합니다.
cd UI
npm install
npm start
open http://localhost:8080
간단한 URL-to-Index 서비스. 고기를 보내고 Sauge를 얻으십시오.
이것은 주어진 URL을 가져 가서 getContentFromUrl을 통해 전달한 다음 CouchDB-Lucene이 문서를 색인화하는 searchengine CouchDB 데이터베이스로 전달합니다.
curl -d 'url = http : //www.botdream.com'http : // localhost : 8000/url
그런 다음 완료되면 :
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_content?q=botdream&include_docs=true | jq .
참고 : 서비스 엔진은 이제 제목 별로 인덱싱됩니다.
curl -X GET --silent http://localhost:5984/_fti/local/searchengine/_design/search/by_title?q=botdream&include_docs=true | jq .
또한 : DBPROXY는 이제 검색 엔드 포인트를 구현하고 있습니다 (이것은 UI가 CouchDB에 직접 데이터를 요구하는 것을 피하고 향후 다른 DB 엔진을 사용 하여이 서비스를 사용하여 추상화 할 수 있습니다.
curl -X GET --silent http://localhost:8000/search/botdream | jq .