Skip to content

ING3, architecture microservices projet TrackingGPS

Notifications You must be signed in to change notification settings

alanCrtl/archimicroprojet

Repository files navigation

Architecture microservices projet

Objectifs et contraintes du projet définit dans TrackingGPS.pdf

Table of Contents

Docker (ran with Docker version 25.0.0)

Do this on 3 different terminal on the same computer

Run kafka, zookeeper, front, api and postgres bdd

In project directory :

docker-compose up --build

Run consumer's docker-compose

cd consumer/
docker-compose -f consumer-docker-compose.yml up --build

You can find the map here : http://localhost:4200/

Run producer's docker-compose

Run it while consumer's is still "waiting for messages"

cd producer/
docker-compose -f producer-docker-compose.yml up --build

Working app

AltText

To delete everything

ctrl+c on every terminal 

docker-compose -f producer-docker-compose.yml down --rmi all -v

docker-compose -f consumer-docker-compose.yml down --rmi all -v

docker-compose -f docker-compose.yml down --rmi all -v

If the front doesn't work on first try

Try :

cd front/
npm install
ng serve

Stop the front (ctrl + c)

Retry to run the docker-composes

Useful docker commands for debug

Show containers

docker ps

Restart service

sudo service docker restart

Provides detailed information about the network

docker network inspect archimicroprojet_kafka_net

Stop a container (example)

docker compose -f bdd-docker-compose.yml down

Reset networks

docker network prune

List process that use port

sudo lsof -i :<PORT>

The following sections are old documentation for running things manually (no docker), kept as archive

Kafka

kafka quickstart guide

Data format sent to topic coordinates

The data is to the broker in the format: lat; long; Date; ip.
Example: "-48.744897; -78.637573; 2023-12-27 16:03:41; 172.17.9.135"

launch broker on 2 terminal (go into kafka folder first)

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

some command if it fails (go into kafka folder)

i needed to do this to install kafka i guess after cloning repo

./gradlew jar -PscalaVersion=2.13.11

test messages on 'test-topic'

write:

bin/kafka-console-producer.sh --topic test-topic --bootstrap-server localhost:9092

read:

bin/kafka-console-consumer.sh --topic test-topic --from-beginning --bootstrap-server localhost:9092

create topic coordinates (one time only):

bin/kafka-topics.sh --create --topic coordinates --bootstrap-server localhost:9092 --partitions 2 --replication-factor 1

delete topic

bin/kafka-topics.sh --bootstrap-server localhost:9092 --delete --topic coordinates

list topics

kafka-topics.sh --bootstrap-server localhost:9092 --list --command-config /path/to/client.properties

kafka server logs:

tail -f logs/server.log

broker config (in server.properties):

listeners=PLAINTEXT://localhost:9092

API

run api manually

uvicorn main:app --reload

run front server manually

  ng serve

AUTEURS

Aurelien CHAUVEHEID

Alan COURTEL

Ameilie LEANG

Marieme SALL

About

ING3, architecture microservices projet TrackingGPS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •