Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC] KLIP-15-based JavaScript client and example app #12

Open
wants to merge 11 commits into
base: api_client_proto
Choose a base branch
from
Open
3 changes: 3 additions & 0 deletions ksql-js-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/.cache/
**/dist/
**/lib/
4 changes: 4 additions & 0 deletions ksql-js-client/.mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
extension: ["ts"],
require: "ts-node/register"
};
33 changes: 33 additions & 0 deletions ksql-js-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ksqlDB-js-client

| :warning: Proof of concept |
| -------------------------- |
| This directory provides a sample ksqlDB JavaScript client and application, based on the [KLIP-15 proposal](https://github.com/confluentinc/ksql/pull/4069). |


### Running the example app

You'll need a recent version of Node.js. Use npm (or yarn) to grab dependencies and compile the client:
```sh
# within the ksqldb-js-client/ dir
$ npm run build
```

The sample application in `ksqldb-js-client/packages/shopping-cart-example` emulates the `ksqldb-real-app` example from KLIP-15. It reuses the server endpoint, so fire that up first:

> To run it, run the Starter class in your IDE: [...]/ksql-real-app/src/main/java/io/confluent/server/Starter.java

(From `# The Application` in [ksql-dev / Client, Protocol, and new API prototype](https://groups.google.com/d/msg/ksql-dev/5mLKvtZFs4Y/HUAtYNw4AgAJ).)

Then, start the JavaScript-client-based example:
```sh
# within the ksqldb-js-client/ dir
$ npm run start-example
```

You should see output like:
```
Server running at http://localhost:1234
```

Finally, navigate your browser to the respective url.
6 changes: 6 additions & 0 deletions ksql-js-client/lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": [
"packages/*"
],
"version": "0.0.0"
}
Loading