Skip to content

A JavaScript guestbook app with a number of different backend implementations, each using a different client library to communicate with CrateDB.

License

Notifications You must be signed in to change notification settings

crate/crate-sample-apps

Repository files navigation

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

  • You need install and run CrateDB before proceeding with the software found within this repository.
  • You will also need to install crash, the CrateDB CLI tool, to work with CrateDB on the command line.
  • See the CrateDB Getting Started guide for help.

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?

About

A JavaScript guestbook app with a number of different backend implementations, each using a different client library to communicate with CrateDB.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks