crate / crate-sample-apps

A JavaScript guestbook app with a number of different backend implementations, each using a different client library to communicate with CrateDB.
Apache License 2.0
66 stars 36 forks source link
cratedb distributed-database distributed-sql-database

.. highlight:: sh

=================================== CrateDB guestbook demo applications

About

A gallery of applications, each implementing the same HTTP API for a guestbook backend, using SQL and CrateDB. Each implementation uses a different client library to communicate with CrateDB.

Accompanied with the applications, there is a dedicated test suite to verify the corresponding implementation automatically, and a guestbook frontend application for interactively communicating with the backend service.

Prerequisites

Setup

Once a CrateDB instance is running, create the required schema and import the country data::

crash < sql/schemas.sql
crash -c "COPY guestbook.countries FROM '$(pwd)/sql/countries.json' RETURN SUMMARY;"

Please note that the countries.json file needs to be accessible by CrateDB.

If your instance of CrateDB does not have access to your filesystem, or you are not working with the repository, you can use an alternative set of commands to access the schemas.sql and countries.json files directly from GitHub::

curl -s https://raw.githubusercontent.com/crate/crate-sample-apps/main/sql/schemas.sql | crash
crash -c "COPY guestbook.countries FROM 'https://raw.githubusercontent.com/crate/crate-sample-apps/main/sql/countries.json' RETURN SUMMARY;"

See the developer docs_ about how to run and provision CrateDB using Docker.

Components

Frontend

The frontend is shared by all apps and is written in JavaScript. This frontend communicates with the backend over a REST API.

Backends

The are several implementations of the backend REST API.

Contributing

This project is community-maintained, any contributions are welcome. See the developer docs, api specification, and the contribution docs_ documents for more information.

Help

Looking for more help?

.. _api specification: SPEC.md .. _client library: https://crate.io/docs/clients/ .. _contribution docs: CONTRIBUTING.rst .. _crash: https://github.com/crate/crash .. _crate-pdo: https://github.com/crate/crate-pdo .. _crate-python: https://github.com/crate/crate-python .. _Crate.io: https://crate.io/ .. _CrateDB: https://github.com/crate/crate .. _CrateDB JDBC driver: https://crate.io/docs/clients/jdbc/ .. _craterl: https://github.com/crate/craterl .. _DBAPI2: https://www.python.org/dev/peps/pep-0249/ .. _developer docs: DEVELOP.rst .. _Erlang: https://www.erlang.org/ .. _Erlang (Cowboy): erlang-cowboy .. _Express: https://expressjs.com/ .. _Flask: https://flask.palletsprojects.com/ .. _frontend: frontend .. _Getting Started: https://crate.io/docs/getting-started/ .. _Gin: https://github.com/gin-gonic/gin .. _Go: https://go.dev/ .. _Go (Gin): go-gin .. _HTTPie: https://httpie.io/ .. _Java (Spark): java-spark .. _Java (Spring): java-spring .. _JDBC: https://docs.oracle.com/javase/tutorial/jdbc/ .. _Node.js: https://nodejs.org/ .. _Node.js (Express): nodejs-express .. _node-crate: https://www.npmjs.com/package/node-crate .. _PDO: https://www.php.net/manual/en/book.pdo.php .. _pgjdbc: https://github.com/pgjdbc/pgjdbc .. _PHP: https://www.php.net/ .. _PHP (Slim): php-slim .. _pgx: https://github.com/jackc/pgx .. _pgxscan: https://github.com/georgysavva/scany .. _Python: https://www.python.org/ .. _Python (Flask): python-flask .. _REST API: https://en.wikipedia.org/wiki/Representational_state_transfer .. _Slim: https://www.slimframework.com/ .. _Spark: https://sparkjava.com/ .. _Spring Boot: https://spring.io/projects/spring-boot .. _Spring Data JDBC: https://spring.io/projects/spring-data-jdbc .. _support channels: https://crate.io/support/