- This is a template for using servant and elm
- This template is built with:
- Stack -- build the haskell project
- Postgres -- database
- Elm -- front end
- Webpack -- bundling tool
- Typescript -- for frontend javascript such as embedding your elm app and ports
- Ruby -- for database migrations and build tool
- npm -- node package manager
- This app is just a raw skeleton to use haskell for your backend and elm for your front end.
- The example posts a dice to the server, rolls that dice, then sends back the result
- The code-generator generates your elm types, decoders, encoders, and api endpoints from your haskell types
- Install NodeJS v6.9+
choco install nodejs-lts
- Install Elm v0.18
choco install elm-platform
- Install Ruby
choco install ruby
- Install Postgres
choco install postgresql
- Install Stack
choco install haskell-stack
- Run stack setup
stack setup
- Install hpack
stack install hpack
- Install intero
stack install intero
- Install typescript globally
npm install -g typescript
- Run
npm install
- Install pg
gem install pg
- Install standalone_migrations
gem install standalone_migrations
- cd into
src
and runrake watch
- this will build your project and enable hot reloading
- IDE
- I recommend using VS Code with the following plugins:
- language-haskell
- Vans.haskero
- sbrink.elm
- abadi199.elm-format
- realazy.elmx
- monofon.hindent-format
- rebornix.ruby
- groksrc.ruby
- hoovercj.ruby-linter
- mrmInc.vscode-scss
- emmanuelbeziat.vscode-great-icons
- joeandaverde.vscode-elm-jump
- siegebell.prettify-symbols-mode
- I recommend using VS Code with the following plugins:
-
cd into
src
and runrake build
- this will build your app for production by generating your dist folder
-
then run
rake serve
to serve your production app -
on deployment server install docker
- run
- JQuery
- Bootstrap
- Font Awesome
- Tether
src
-- all source code goes hereclient
-- all client side codedb
-- all database migrationsserver
-- all server side code