You are here: Home » NewsFeeds » Show HN: WebSocket-first development

Show HN: WebSocket-first development

README.md

This is a demo app for lattice-core which is a framework for crystal I’m working on that is still
very much in the proof-of-concept stage. The intent is to really show how powerful a WebSocket-first framework can be. Kemal serves as an excellent base, and crystal’s ruby-like syntax with native speed brings everything together.

If you haven’t spent some time investigation crystal, please take a look. It is an amazing language with an excellent library.

Installation

git clone git@github.com:jasonl99/card_game.git
cd card_game
shards install
crystal src/card_game.cr

Usage

Open a browser and go to localhost:3000/cardgame/abc where abc becomes a new game at that address.
Use Chrome, Firefox, Safari, or whatever browser you’d like at the same url to show more than one session accessing a game. Imagine each browser is a different user in a different location. Once a game is created, it stays in server memory (garbage collection is in progress on lattice-core.)

For demonstration purposes, each session


 

Original article