Crate sample apps.
Erlang Python Java PHP JavaScript HTML CSS

README.md

Crate Sample Apps

Overview

This repository contains implementations of a simple guestbook example app that uses Crate as its database backend. The frontend is written in Javascript and communicates with the backend over a REST API. The REST API that connects to Crate is written in various programming languages using different client libraries available for Crate.

Frontend

The frontend communicates via a REST API with the backend. The interface is the same across all implementations of the backend which allows for simple exchange of backends.

The code and usage instructions are in the frontend subfolder of this project.

Backends

The example application backends available are:

They are inside their respective subfolders and contain both usage instructions and commented application code.

Download and Install Crate

For all backends you will need to install and run Crate first. This sample app requires Crate 0.54.1 or higher. The Java sample app requires Crate 0.57.0 or higher. Several ways exist to get an instance of Crate running, visit our Getting Started section to find the one that works best for you.

Import Country Data

Once the Crate instance in running, create the schema and import country data. You need crash (Crate Shell) to connect to Crate.

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

Develop

Backend API Spec

See the API spec.

Running Integration Tests

cd tests
python3.4 tests.py --host SERVER_IP --port 4200