Build Tetris Game with Elixir and Phoenix LiveView. Full day workshop.
Phoenix LiveView provides ability to build web application without any custom javascript.
You can write all the code on Backend server and the connection is alive and stateful.
In this workshop, you will build Tetris App in Elixir and Phoenix LiveView. The aim of this workshop is give more hands-on Elixir experience and cover various functions and syntax.
Outline/Structure of the Workshop
1> Basic Counter example with Phoenix LiveView
2> Mouse key events update counter value
3> Tick auto-increment the counter
4> HTML CSS for Game Board example
5> new Elixir project - Elements needed for Tetris Game.
6> Game logic in Elixir
7> Refactor code
8> Use this Elixir project and make PhoenixLive paint it to the screen.
9> You have a working game on your machine.
We will cover many functions of Elixir that need to be used for Game logic Tetris example.
We will not cover OTP. We do not need GenServer at this point.
We will not cover Ecto as we are not storing anything to the Database.
Learning Outcome
The audience will have a working implementation of Tetris Game on their machine.
You will get to implement RealWorld app in Elixir.
Get to use many functions of Enum, List, Map, MapSet that you were not sure when and how to use.
The Game logic and game rules refactoring will help understand how to keep code easy to extend.
Target Audience
Beginners who want to have more hands-on with Elixir syntax and build a complete app in Elixir.
Prerequisites for Attendees
Basic Elixir Syntax like addition of numbers, Strings.
Write simple functions. Play around basic Enum operations.
Some understanding of CSS.
I will share a prerequisite doc with few examples that you can read before attending workshop.
Need to have elixir and phoenix installed and working on your laptop.
Links
Already Implemented and deployed here http://tetris-kachori.gigalixirapp.com/
Quick Video of the Game. https://www.youtube.com/watch?v=mIUN_Lw1Q6o
Blogging my experience here https://medium.com/@sandeshsoni/building-tetris-kachori-game-with-elixir-and-phoenix-liveview-sandesh-soni-5cc77cb884de
schedule Submitted 1 year ago
People who liked this proposal, also liked:
-
keyboard_arrow_down
Andrea Leopardi - BEAM Architecture Handbook
45 Mins
Talk
Intermediate
If you are writing a stateless web application backed up by a database, there is a good chance Elixir is a great fit. However, this is not where it shines. In this talk, we will discuss how to architect Elixir applications in order to leverage the features of the language and of its runtime.
We will look at this both from a lower level, talking about the architecture of processes inside an Elixir application, as well as from a higher perspective of writing Elixir services and architecting systems to play to Elixir's strengths. We will see practical use cases and discuss design patterns. -
keyboard_arrow_down
Bruce Tate - Coding LiveView
45 Mins
Demonstration
Intermediate
Startups and web developers take note. Phoenix LiveView is the revolutionary framework that allows rapid development of real-time web interactive applications without custom JavaScript. You read that right the first time, and the Elixir community is buzzing. So far, the performance numbers have been nothing short of earth-shattering.
In this session, you’ll see how it all works. We will do some live coding to show you LiveView under the hood.
-
keyboard_arrow_down
Anupam Jain - Typesafe Functional SQL
45 Mins
Talk
Intermediate
We'll discuss how to use strongly typed functional programming to build a typesafe and highly declarative DSL to generate SQL, that allows better abstractions and minimises runtime errors. We'll focus on type systems, and build an intuition for row types and how it guarantees correctness for SQL. I'll cover some parts of actual SQL generation.
A similar talk was given at IIIT Delhi earlier, however that was more geared towards beginners to Functional Programming (link below). I plan to give a more intermediate level talk this time.
-
keyboard_arrow_down
Nikhil More - Do you OOP in Elixir?
20 Mins
Experience Report
Beginner
One of the strategies being adopted by RoR or Java software developers in adopting Elixir is they have not yet adapted themselves to unlearn the OOP in developing the web systems. This has caused OOP concepts to creep into full fledged Elixir systems. This presentation seeks to highlight these subtle points that need to be avoided to make the code more FP and less OOP.
-
keyboard_arrow_down
Kapil Reddy - Handling and Composing complex side effects in Clojure with Sanity
45 Mins
Talk
Intermediate
At Helpshift, we face managing complexity of these side effects which touch 10s of different systems. Each side effect poses a failure scenario which can lead to it's own business decision. Compounded failures pose even more complexity. To add to the problems we extending the codebase to add new business logic regularly.
I will present a solution which is a combination of Clojure and FP following techniques. We will also discuss how ideas when combined together can create an elegant solution,
1. Data - Side effects definition as data
2. Almost no syntax - Minimal definition
3. Many functions for one DS - Multiple execution and failure recovery modes for side effects
-
keyboard_arrow_down
Anupam Jain - Supercharged Web Application development with Purescript
45 Mins
Workshop
Beginner
UPDATE: Please setup https://github.com/ajnsit/purescript-react-starter (follow the instructions in the README) on your laptops as a **prerequisite**.
Purescript is a purely functional, strongly typed language, that compiles to Javascript.
It provides several high quality libraries for frontend development, and comes with excellent tooling and editor support that makes writing code a snap!
In this talk I will provide a quick introduction to some basics of Purescript, and then dive into an interactive demonstration of building a non-trivial web application from scratch. I will show how to interface with React bindings, and how to interface with some existing Javascript libraries (a React UI component lib).
The presentation will be interactive and similar to an inpromptu talk I gave which is linked below. However, I will also demonstrate live coding of an actual purescript application which people can follow along.
Bring your laptop to follow along.
-
keyboard_arrow_down
Mangala Kader - Understanding the pitfalls in Erlang / Elixir and steering clear from them
Mangala KaderCTO | Co-FounderIteron Technologies Private Limited | ElixirExpertsschedule 1 year ago
45 Mins
Talk
Beginner
Erlang has been in production for more than 30 years and a highly battle-tested robust system, which is being used by everybody including Telecom systems that provides 99.99% uptime. Elixir has been built on top of Erlang overcoming the shortcomings of the language and also using meta-programming, it has opened a new paradigm of looking at the language itself. I want to show what Elixir is to the audience and minute nuances that every experienced or inexperienced developer should be aware of before jumping into the magical erlang and elixir world.
-
keyboard_arrow_down
Aditya Giri - Elixir and WebAssembly
20 Mins
Talk
Beginner
WebAssembly is one of the new technologies around the block that has vast areas still to be explored. I'd like to give a talk explaining what the WebAssembly is, what are the possibilities that you can cover with the help of WebAssembly, how does Elixir and BEAM VM fit into the equation and how to interoperate between Elixir and WebAssembly.
-
keyboard_arrow_down
Sandesh Soni - My Journey Building Tetris Kachori - Elixir and Phoenix LiveView
45 Mins
Case Study
Beginner
I will share my experience how I built this Tetris game without writing a single line of custom javascript code. All the code is written in Elixir and Phoenix LiveView.
you can play the game here http://tetris.sandeshsoni.com/
Public Feedback