$ git clone https://github.com/WilliamMcEnery/FinalYearProject.git
$ cd FinalYearProject
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
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
See Twitter API service README to run Twitter API service.
See Geo-Locator UI service README to run Geo-Locator UI service.
See Geo-Locator Backend service README to run Geo-Locator Backend service.
Install Docker: Docker
Install Docker-compose: Docker-compose
From the directory where you cloned the repository.
$ docker build -t geo-locator .
In your twitterApiService directory, run:
$ docker build -t twitter-service .
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