Skip to content

Commit

Permalink
feat: add kafka consumer to Pokeshop (#19)
Browse files Browse the repository at this point in the history
* Adding kafka support for Pokeshop

* Adding trace-based tests to Pokeshop

* Updating tests

* Add kafka consumer to Pokeshop

* Updating tests
  • Loading branch information
danielbdias authored Aug 17, 2023
1 parent 5ab07c4 commit cd85a58
Show file tree
Hide file tree
Showing 30 changed files with 16,863 additions and 7,245 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.14.0-alpine as build-ui
FROM node:20.5.1-alpine as build-ui

WORKDIR /ui
ENV PATH /ui/node_modules/.bin:$PATH
Expand Down Expand Up @@ -27,7 +27,7 @@ FROM node:alpine as app

WORKDIR /app
COPY ./api/package.json ./api/package-lock.json ./
RUN npm ci
RUN npm clean-install

EXPOSE 80

Expand Down
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ OUTPUT_FORMAT = png
SRC = $(wildcard $(SRCDIR)/*.mdd)
OUT = ${SRC:.mdd=.$(OUTPUT_FORMAT)}

help: Makefile ## show list of commands
@echo "Choose a command run:"
@echo ""
@awk 'BEGIN {FS = ":.*?## "} /[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-40s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort

generate-diagrams: $(OUT)

$(SRCDIR)/%.$(OUTPUT_FORMAT): $(SRCDIR)/%.mdd
npm run generate-diagram -- --input $< --output $@

run:
docker compose -f docker-compose.yml -f ./tracetest/docker-compose.tracetest.yaml up
run: ## run Pokeshop API on docker compose
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml up

down: ## stop Pokeshop API running on docker compose
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml down

down:
docker compose -f docker-compose.yml -f ./tracetest/docker-compose.tracetest.yaml down
run/tracetests: ## run Trace-based tests on Pokeshop API with Tracetest
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml -f ./tracetest/docker-compose.yml run tracebased-tests
3 changes: 3 additions & 0 deletions api/.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ POKE_API_BASE_URL=https://pokeapi.co/api/v2
COLLECTOR_ENDPOINT=http://localhost:4317
APP_PORT=8081
RPC_PORT=8082
KAFKA_BROKER=localhost:29092
KAFKA_TOPIC=pokemon
KAFKA_CLIENT_ID=streaming-worker
Loading

0 comments on commit cd85a58

Please sign in to comment.