Crate Sample Apps
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.
The example application backends available are:
- Python (using dbapi, crate-python)
- PHP (using PDO, crate-pdo)
- Java (using JDBC, pgjdbc)
- Erlang (using Erlang, craterl)
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'"
Backend API Spec
See the API spec.
Running Integration Tests
cd tests python3.4 tests.py --host SERVER_IP --port 4200