Skip to content

Example of integration between a React+Redux client side with an Elixir/OTP GenServer

License

Notifications You must be signed in to change notification settings

Limenius/tictactoe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic-tac-toe

This is an example how similar is to work with Redux and Elixir/OTP GenServers.

This code was used in the demo of a talk in AgentConf'18

Blog post: https://limenius.com/elixir-otp-react-redux/

Don't use this code as it is as base for anything serious, please. I have cut all the corners while developing this to showcase an idea. There is no lobby, no player negotiation, or anything like that, and for simplicity there is a GenServer that will listen to every websocket connection. There are examples like https://github.com/bigardone/phoenix-battleship that are closer to a real project.

Running it

Clone the repo:

git clone https://github.com/Limenius/tictactoe.git

cd into the project and then get the client dependencies:

yarn install

or

npm i

get the server dependencies:

cd server
mix deps.get

(note that you need to have Elixir installed).

run the server:

mix phx.server

And then in another terminal run the client application:

npm run start

You should be able to see the app live at http://localhost:3000/

About

Example of integration between a React+Redux client side with an Elixir/OTP GenServer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published