/haskell-elm-todo-app

Todo app build with Haskell (server-side) and Elm (client-side)

Primary LanguageElmMIT LicenseMIT

haskell-elm-todo-app

Update 09/24/2019: Support of GHC 8.6.5 and Elm 0.19

Todo app build with Haskell (Servant, Persistent) on server-side and Elm on client-side.

screenshot

Random notes (2016)

The modular structure of the Elm app based on the article "How I Structure Elm Apps" by Kris Jenkins. It also uses the elm-return library by Isaac Shapira for using a Writer monad approach with any update function.

It might be overkill somehow to use all these things for a simple Todo app. Anyway, I just wanted to check it out what is possible and how does it feel to write a bigger Elm application in any future...

Instructions

Server-side app

  • Build:
stack build
  • Execute:
stack exec haskell-elm-todo
  • Run tests:
stack test

DB queries

by using httpie:

# add a todo
http POST localhost:3000/todo/ completed:=false description="my todo"

# get a todo
http localhost:3000/todo/1

# delete a todo
http DELETE localhost:3000/todo/1

# update a todo
http PUT localhost:3000/todo/1 description="any other description" completed:=true

# get all todos
http localhost:3000/todos

Client-side app

  • Goto project folder
cd {project}/client/
  • Build:
npm i
  • Run:
npm start

Open http://localhost:3333.

Acknowledge (2016)

Helpful Haskell / Servant stuff

Helpful Elm stuff