Memri / Pod / Pod-Backend

Pod-Backend

This is a live view of README at Pod-Backend repository

About

Pod is the open-source backend for Memri project.

It’s written in Rust and provides an HTTP interface for use by the clients.

See documentation on:

Run in docker

To run Pod inside docker:

docker-compose up --build

Local build/run

In order to build Pod locally, you need Rust and sqlcipher:

  • On MacOS: brew install rust sqlcipher
  • On ArchLinux: pacman -S --needed rust sqlcipher base-devel
  • On Ubuntu and Debian:
apt-get install sqlcipher build-essential
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • Submit merge requests for your other OS :)

After this, you can run Pod with:

cargo run -- --help
cargo run -- --owners=ANY

Or the easy-to-use development version:

./examples/run_development.sh

Pod development

If you develop Pod, you might want to have faster build turn-around.

Use this to incrementally compile the project (after installing cargo-watch):

cargo watch --ignore docs -s 'cargo check'

You can read about various components of the server:

HTTP API

Pod’s API is documented in detail here.

Database

Pod uses SQLite database as its storage mechanism.

When running Pod, a file named data/db/*.db will be created. You can use the following command to browse the database locally:

sqlcipher -cmd "PRAGMA key = \"x'yourDatabaseKey'\";" data/db/*.db

For example, .schema will display the current database schema.

If you want to fill the database with some example data, execute res/example_data.sql inside the database.