Skip to content

Geo-locator for tweets. Provided with a topic, tweets containing the topic in the form #topic will be displayed on the map.

Notifications You must be signed in to change notification settings

WilliamMcEnery/FinalYearProject

Repository files navigation

FinalYearProject

Getting the code

Clone Repository

$ git clone https://github.com/WilliamMcEnery/FinalYearProject.git
$ cd FinalYearProject

Running Locally

Prerequisites

Apply for a Twitter developer account Here to access Twitter APIs.

Sign up to Mapbox Here to access map and map styling.

Sign up to Mapquest Here to utilize geo-coding.

Install Latest Python and pip: Python

Install Java 8+: Java

Install Latest Apache Kafka: Kafka

Install Latest NodeJS and NPM: Node.js

Running each service

Start the Kafka environment

Start the ZooKeeper service:

$ bin/zookeeper-server-start.sh config/zookeeper.properties

Open another terminal session and start the Kafka broker service:

$ bin/kafka-server-start.sh config/server.properties

Open another terminal session and create the Kafka topics replacing the topic name tags:

$ bin/kafka-topics.sh --create --topic <first-topic-name> --bootstrap-server localhost:9092
$ bin/kafka-topics.sh --create --topic <second-topic-name> --bootstrap-server localhost:9092

Start the Twitter API service

See Twitter API service README to run Twitter API service.

Start the Geo-Locator UI service

See Geo-Locator UI service README to run Geo-Locator UI service.

Start the Geo-Locator Backend service

See Geo-Locator Backend service README to run Geo-Locator Backend service.

Running in Docker

Prerequisites

Install Docker: Docker

Install Docker-compose: Docker-compose

Build Docker Image

Build geo-locator service image

From the directory where you cloned the repository.

$ docker build -t geo-locator .

Build twitter api service image

In your twitterApiService directory, run:

$ docker build -t twitter-service .

Running Docker Images

From the directory where you cloned the repository.

$ docker-compose -f docker-compose.yml up -d

This command runs the Kafka microservice made up of two docker containers (zookeeper and kafka) run in detached mode.

$ docker run -d -p 8080:8080 --env-file geo-locator-backend/.env --network finalyearproject_default --name geo-locator geo-locator

This command runs the geo-locator microservice in a docker container in detached mode, on port 8080, on the same network as the kafka microservice.

$ docker run -d --env-file twitterApiService/.env --network finalyearproject_default --name twitter-service twitter-service

This command runs the geo-locator microservice in a docker container in detached mode, on the same network as the kafka microservice.

Check to make sure the images are running by running docker ps -a. Check the output of that command to make sure that geo-locator, twitter-service, zookeeper and kafka exists and is up and running.

$ sudo docker ps -a
CONTAINER ID        IMAGE                   COMMAND                 CREATED             STATUS              PORTS                                                   NAMES
8ee1258f2357        geo-locator             "docker-entrypoint.s…"  1 minutes ago       Up 1 minutes        0.0.0.0:8080->8080/tcp                                  geo-locator
a421bd6aa789        twitter-service         "python app.py"         3 minutes ago       Up 3 minutes                                                                twitter-service
bd4c7eb788f0        wurstmeister/kafka      "start-kafka.sh"        4 minutes ago       Up 4 minutes        0.0.0.0:9092->9092/tcp                                  kafka
462d6414acd0        wurstmeister/zookeeper  "/bin/sh -c '/usr/sb…"  4 minutes ago       Up 4 minutes        22/tcp, 2888/tcp, 3888/tcp, 0.0.0.0:2181->2181/tcp      zookeeper

The service will be hosted on http://localhost:8080

About

Geo-locator for tweets. Provided with a topic, tweets containing the topic in the form #topic will be displayed on the map.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published