Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/viveksyngh/search-agg
Application written in go which aggregates search results from Google, DuckDuckGo and Wikipedia
https://github.com/viveksyngh/search-agg
angular docker docker-compose golang postgresql rabbitmq
Last synced: 16 days ago
JSON representation
Application written in go which aggregates search results from Google, DuckDuckGo and Wikipedia
- Host: GitHub
- URL: https://github.com/viveksyngh/search-agg
- Owner: viveksyngh
- Created: 2019-09-28T12:52:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-15T03:52:51.000Z (over 4 years ago)
- Last Synced: 2024-04-16T03:56:49.005Z (7 months ago)
- Topics: angular, docker, docker-compose, golang, postgresql, rabbitmq
- Language: Go
- Size: 417 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# search-Aggregator
Application written in golang which aggregates search results from Google, DuckDuckGo and Wikipedia## Steps to run
### Prerequisite
You need to have `docker` and `docker-compose` installed on your system1. [Installation on Mac](https://docs.docker.com/docker-for-mac/install/)
2. [Install Docker Compose ](https://docs.docker.com/compose/install/)### Get the code
Clone this repository and change to repository directory### Bring up all Services
Run below command to bring up all services
```
docker-compose build --parallel && docker-compose up
```### Setup Database
Once all services are up, open a terminal window and run below command to exec to database container
```
docker exec -it $(docker ps --filter=name=search-agg_db -q) bash
```Login to database inside the container using below command
```
psql "sslmode=disable host=localhost port=5432 user=searchdbuser dbname=searchdb password=12345"
```To create the required tables for the app, run below create tables commands which are also present in `db.sql` file
```sql
CREATE TABLE searchquery (
id SERIAL PRIMARY KEY,
status VARCHAR(100) NOT NULL,
query VARCHAR(255) NOT NULL,
created_on TIMESTAMP NOT NULL
);CREATE TABLE googlesearchresult (
id SERIAL PRIMARY KEY,
title VARCHAR (255) NOT NULL,
searchquery_id INTEGER REFERENCES searchquery(id),
url VARCHAR (255) NOT NULL
);CREATE TABLE duckduckgosearchresult (
id SERIAL PRIMARY KEY,
title VARCHAR (255) NOT NULL,
searchquery_id INTEGER REFERENCES searchquery(id),
url VARCHAR (255) NOT NULL
);CREATE TABLE wikipediasearchresult (
id SERIAL PRIMARY KEY,
result TEXT NOT NULL,
searchquery_id INTEGER REFERENCES searchquery(id)
);
```### Open the application
Go to browser and access the application at `http://127.0.0.1:8000`