Giter Club home page Giter Club logo

grafka's Introduction

Grafka: GraphQL interface for Apache Kafka

Grafka provides a GraphQL interface for Apache Kafka administration and a simple UI for interacting the information.

The UI will remain simple, as the main value of this project is providing the GraphQL interface so you can integrate with your own projects.

Getting Started

The easiest way to get up and running is to simply start up the provided docker-compose file. This will start up the site at http://localhost:3000:

docker-compose up -d

User interfaces

Grafka comes with a couple different ways to access your information.

Grafka UI Open up the site on http://localhost:3000, you can find links to "Query UI" and sample queries there. (Also on github)

Altair Open up http://localhost:9000/altair to use the Altair UI for GraphQL.

GraphiQL Open up http://localhost:9000/graphiql to use the GraphiQL for GraphQL.

GraphQL API

The user interfaces give you some insight into your cluster, but ultimately the true value of Grafka is making it easier for you to integrate Kafka administration tasks into your own solutions.

The graphql endpoint runs at http://localhost:9000/graphql by default.

Priorities:

  • Querying
    • Clusters
    • Topics
    • Consumer Groups
    • Schema
    • Messages
    • Connect
  • Mutating
    • Cluster Config
    • Topics
    • Connectors
    • Consumer Group Resetting
    • Schema
  • UI (~5% done)
    • Near real-time updates
    • Security
    • Easy export/search topics
    • Action logging, auditing
  • Miscellaenous 0%
    • KSQL

Major components

  • Kafka (only tested with 2.3)
  • Spring Boot
  • GraphQL
  • GraphQL UI (GraphiQL or Altair)
  • Postgres
  • Schema Registry, Kafka Connect, KSQL (planned)

Working locally:

If you're trying to work on the site, then I recommend starting up docker-compose like above, but then stopping the services you want to work on. For example, this will shut down the website and the spring component so you can run them locally instead.

docker-compose up -d
docker-compose stop www
docker-compose stop api

Now you can run the UI independently:

cd www
npm install
npm start

And you can open up the "grafka" subfolder in an editor like IntelliJ or run something like...

cd grafka
gradle build

Running docker-compose up will start up a test Kafka environment for you as well. Here is a sample configuration that will work with it. Warning: This config only works if you are running the java app in something like your IDE. If you are running the graphql endpoing in docker, then you will need to change the bootstrap.servers to kafka1:9092

application.id=grafka
group.id=grafka
bootstrap.servers=localhost:29092

schema.registry.url=http://localhost:8081

key.serializer=org.apache.kafka.common.serialization.StringSerializer
value.serializer=io.confluent.kafka.serializers.KafkaAvroSerializer

key.deserializer=org.apache.kafka.common.serialization.StringDeserializer
value.deserializer=io.confluent.kafka.serializers.KafkaAvroDeserializer

avro.specific.reader=true

Note: The schema registry configuration is currently lumped in with the cluster configuration (there's a ticket for that), however you can ditch it with a config like:

application.id=grafka
group.id=grafka
bootstrap.servers=localhost:29092

key.serializer=org.apache.kafka.common.serialization.StringSerializer
value.serializer=org.apache.kafka.common.serialization.StringSerializer

key.deserializer=org.apache.kafka.common.serialization.StringDeserializer
value.deserializer=org.apache.kafka.common.serialization.StringDeserializer

Testing

There is a docker-compose file setup for running integration tests. You can run it like...

docker-compose -f docker-compose-tests.yml up --build --abort-on-container-exit -V

Troubleshooting:

Q: Getting an error about the port in use?

A: Make sure that everything is stopped before re-running!

Q: Web app stuck in a bad spot?

A: Try running this: localStorage.clear()

Q: Unable to connect to bootstrap servers?

A: Are you running the graphql endpoint in docker? Then the bootstrap.servers should be kafka1:9092

grafka's People

Contributors

thejoezack avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.