· 2 min read ·401 words

Sandstone

on this page

TLDR: See project here !

What is Sandstone

Sandstone is a PHP microframework. The main purposes of this microframework are:

  • Building a RestApi
  • Mount a websocket server
  • Easily send push notifications.

Sandstone is based on Silex, the Symfony microframework.

If you don’t know Silex, it is a minimalist web framework similar to expressjs in nodejs, or flask in python.

What can I do with Sandstone

You can easily bootstrap a RestApi, and add real-time stuff, such as:

  • Notify all web clients that a new article has just been published through the RestApi
  • Create a chat working with your RestApi
  • For a game server, broadcasting players moves as soon as someone played

How to get started

If you’re starting a new project, you should be interested in the Sandstone edition.

It is a fresh installation of Sandstone you can start from to build a real-time RestApi, and also contains debug features.

This edition integrates:

  • Sandstone (Silex with websockets)
  • Docker environment to mount the whole application (RestApi, websocket server, MariaDB, PHPMyAdmin)
  • Doctrine ORM and Doctrine commands
  • Symfony web profiler for debugging RestApi requests and Push events
  • Silex annotations for controllers and routing annotations

Check it out:

💻 Sandstone edition

Or you can start from scratch or integrate it in an existing Silex application:

💻 Sandstone

📖 Sandstone documentation

Licence Creative Commons
Julien Maulny

Comments (archived from Disqus)

  • Sergio ·

    Hi Julien, i am a new Symfony 3.3 developer and i would like to know if i can use Sandstone in a Symfony 3.3 project.

    Will there be any problem if i add Sandstone to Symfony?

    I need to receive data from an outside application using API REST and then do a broadcast to clients using websockets.

    Can i use Sandstone in this way?

    Thank you very much.

    • Julien Maulny ·

      Hello,

      If you already have a Symfony application, you don't need Sandstone. You may be interested in WebsocketBundle: https://github.com/Geniuses...

      Coupling it with FOSRestBundle, and you have a Rest Api and a websocket server. So when you receive a RestApi call, you can send a message from rest api to websocket server with Push (zmq, amqp) feature that websocket bundle provides. Then you can broadcast your message to websockets clients.

      Sandstone uses the same workflow, but is a microframework, like a lightweight Symfony (Sandstone in based on Silex).

      • Sergio ·

        Ok, i'll do that.

        Thanks for replying :)