nathanic / purescript-simple-chat-client

A simple WebSocket chat client program using PureScript and Halogen.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

simple-chat-client

This is my first PureScript program, something simple for me to play around with. In particular, I am interested in Halogen and WebSockets.

I decided to make a client for the Haskell websockets library's nice little example chat server. I took the code from that example, added project files such that I could build it with Stack, and put it in the server/ directory in this repo.

I instantiated this from purescript-halogen-template This is a template for starting a fresh project using the library for declarative user interfaces.

Running the Server

The server is a Haskell program. You'll need Stack to build it.

cd server
stack install
stack exec simple-chat-server-exe

It'll echo chat traffic to stdout.

Running the Client

Build it:

npm run build

Though I mainly just edit the code in vim and run this in a tmux split:

npm run watch

Now you can just load the page via file:// from the project directory. There's probably better ways, I'm new to PureScript.

About

A simple WebSocket chat client program using PureScript and Halogen.

License:Apache License 2.0


Languages

Language:PureScript 58.5%Language:Haskell 36.5%Language:HTML 3.5%Language:JavaScript 1.5%