.. highlight:: sh
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.
Getting Started
_ guide for help.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.
The frontend is shared by all apps and is written in JavaScript. This frontend
communicates with the backend over a REST API
.
The are several implementations of the backend REST API.
Erlang (Cowboy)
(using Erlang, craterl_)Go (Gin)
(using Go, Gin, pgx, pgxscan_)Java (Spark)
(using Spark, JDBC, CrateDB JDBC driver
)Java (Spring)
(using Spring Boot
, Spring Data JDBC
, CrateDB JDBC driver
)Node.js (Express)
(using Node.js
, Express, node-crate
)PHP (Slim)
(using PHP, Slim, PDO, crate-pdo
_)Python (Flask)
(using Python, Flask, DBAPI2, crate-python
_)This project is community-maintained, any contributions are welcome.
See the developer docs
, api specification
, and the contribution docs
_
documents for more information.
Looking for more help?
support channels
_.. _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/