/crate-sample-apps

Crate sample apps.

Primary LanguageErlangApache License 2.0Apache-2.0

Crate Sample Apps

Overview

This repository contains implementations of a simple guestbook example app that uses Crate.IO 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.IO 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.IO

For all backends you will need to install and run Crate.IO first. This sample app requires version 0.54.1 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