Sandstone Edition

Sandstone requires PHP 5.6+, ZMQ and php-zmq extension.

But the edition also has a Docker installation, so you don’t need to install PHP, ZMQ, php-zmq, mysql… but Docker.

Normal installation

This requires PHP 5.6+, ZMQ, php-zmq extension, composer, and a database.

You may need to install ZMQ and php-zmq on Linux.

composer create-project eole/sandstone-edition
cd sandstone-edition/
  • Create a database for your project.
  • Configure your environment in config/environment-dev.php.
  • Run php bin/console orm:schema-tool:create to initialize the database schema.

Then go to the diagnostic page, something like: http://localhost/sandstone-edition/www/hello/world.html

The installation is done.

Usage

You should also access to:

I will assume here that your webserver point to your application root with:

http://localhost/sandstone-edition/www/

  • http://localhost/sandstone-edition/www/hello/world.html Diagnostic page.
  • http://localhost/sandstone-edition/www/index-dev.php/api/hello hello world route in dev mode.
  • http://localhost/sandstone-edition/www/api/hello hello world route in prod mode.
  • http://localhost/sandstone-edition/www/index-dev.php/_profiler/ Symfony web profiler (only dev mode).
  • ws://localhost:8482 Websocket server.

Access to the Silex console:

php bin/console

Run the websocket server with:

php bin/websocket-server

Docker installation

This installation requires make, Docker and docker-compose.

# Install a new Sandstone project
curl -L https://github.com/eole-io/sandstone-edition/archive/dev.tar.gz | tar xz
cd sandstone-edition-dev/

# Install and mount environment
make

See About Makefile section to learn more about Makefile commands.

Note: Sometimes you’ll need to do either a chown -R {your_user}:{your_group} . or a chmod -R 777 var/* to make it work.

Then check your installation by going to the diagnostic page: http://0.0.0.0:8480/hello/world.html

The installation is done.

Usage

Docker runs the whole environment, the RestApi, the websocket server and PHPMyAdmin. You now have access to:

Access to the Silex console:

docker exec -ti sandstone-php /bin/bash -c "php bin/console"

Open a bash session to PHP Docker container:

make bash

Docker default ports

Once the environment mounted, Docker exposes by default these ports:

  • 8480:http Web server for the RestApi (nginx)
  • 8481:http PHPMyAdmin instance
  • 8482:ws Websocket server

Raspberry Pi Docker environment

Raspberry Pi There is also an ARMv7 environment to mount Sandstone on Raspberry Pi.

Copy docker/docker-compose.arm.yml to docker-compose.override.yml to use arm docker images:

cp docker/docker-compose.arm.yml docker-compose.override.yml

Or if you already have a docker-compose.override.yml, change all images with the ones in docker/docker-compose.arm.yml.

What next

If the diagnostic is good, your are now ready to build your real-time Rest Api.

Create RestApi endpoints, websockets topics… Continue to the cookbook.