From 32d556d2283ee1881bc3cdfe53d2ae50e35bfabf Mon Sep 17 00:00:00 2001 From: Enda Phelan Date: Thu, 8 Oct 2020 16:33:03 +0100 Subject: [PATCH] feat(templates): add kafka template --- .../src/init/starterTemplates.ts | 4 ++-- .../README.md | 16 +++++----------- .../docker-compose.yml | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/packages/create-graphback/src/init/starterTemplates.ts b/packages/create-graphback/src/init/starterTemplates.ts index 3eb2a31f7d..6edd614b10 100644 --- a/packages/create-graphback/src/init/starterTemplates.ts +++ b/packages/create-graphback/src/init/starterTemplates.ts @@ -103,8 +103,8 @@ export const allTemplates: Template[] = [ }] }, { - name: 'apollo-mongo-apache-kafka-server-ts', - description: 'Apollo GraphQL server connecting to MongoDB database with Apache Kafka for subscriptions', + name: '[PREVIEW] apollo-mongo-apache-kafka-server-ts', + description: 'Apollo GraphQL server connecting to MongoDB database with Apache Kafka for subscriptions. This is a preview template - we are continuing to enhance it - we welcome your feedback.', repos: [{ uri: 'https://github.com/aerogear/graphback', branch: 'templates-1.0.0', diff --git a/templates/ts-apollo-mongo-apache-kafka-backend/README.md b/templates/ts-apollo-mongo-apache-kafka-backend/README.md index bc9de792cf..b7cc9e998f 100644 --- a/templates/ts-apollo-mongo-apache-kafka-backend/README.md +++ b/templates/ts-apollo-mongo-apache-kafka-backend/README.md @@ -1,23 +1,17 @@ ## Graphback MongoDB + Apollo Server with Apache Kafka Template -A template that provides you with an easy setup for your application's backend using MongoDB and Apollo server with TypeScript, and Apache Kafka for GraphQL subscriptions. +> NOTE: This is a preview template - we are continuing to enhance it - we welcome your feedback. + +A template that provides you with an easy setup for your application's backend using MongoDB and Apollo server with TypeScript, and Apache Kafka for GraphQL Subscriptions. ### Quickstart Guide The project has been created using Graphback. Run the project using the following steps: -- Start the database - -```shell -HOST_IP=your-host-ip-address && docker-compose up -d -``` - -> HOST_IP is the ipv4 address of your machine. - -You can use the helper script to set `HOST_IP`: +- Start the database, Apache Kafka and Zookeeper ```shell -./set-host-ip.sh && docker-compose up -d +docker-compose up -d ``` - Inspect your schema in the `model/datamodel.graphql` file. diff --git a/templates/ts-apollo-mongo-apache-kafka-backend/docker-compose.yml b/templates/ts-apollo-mongo-apache-kafka-backend/docker-compose.yml index 7a2bb05d77..758c89816f 100644 --- a/templates/ts-apollo-mongo-apache-kafka-backend/docker-compose.yml +++ b/templates/ts-apollo-mongo-apache-kafka-backend/docker-compose.yml @@ -14,7 +14,7 @@ services: - zookeeper environment: KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_ADVERTISED_HOST_NAME: ${HOST_IP} + KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1 volumes: - /var/run/docker.sock:/var/run/docker.sock