• Stars
    star
    359
  • Rank 118,537 (Top 3 %)
  • Language
    Elm
  • License
    BSD 3-Clause "New...
  • Created about 9 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A take-home application server written in Elm and only Elm

take-home

take-home is the world's first open-source project with all parts of the stack written in only Elm. The server-side code is Elm. The stylesheets are Elm. The client-side code is Elm.There's even a branch which shows how the build tools could be in Elm. We went all out to write as much as we could in Elm!

Installation

Requirements

  • Node: 4.1.2
  • Elm: 0.16

How to run

  • Clone the repo
  • npm install
  • ./run_prod.sh

Interesting parts

There's a lot in this project to take in. These are the important parts to look at!

Support summary

In a brief summary, this program has support for the following in Elm

Some extras

  • Moment.js wrapper both client and server side
  • Knox server side
  • Uuid server side
  • Nedb server side
  • StartApp on the server

Framework

While this project provides a good start place for anyone wishing to use full-stack Elm, it does not provide a "do everything" framework like Rails or Django just yet. There is work to make it more like a framework with scripting, but at this time it's not there yet.

How does it work?

The server itself follows the Elm architecture. It uses a modified startapp implementation. This means you have the following core functions

update : Action -> Model -> (Model, Effects Action)
routeIncoming : Connection -> Model -> (Model, Effects Action)

Notice how there's no longer a view. The update function is responsible for updating the model, while the router is responsible for writing replies to the client.

Future work

Create a sensible way of having global footers and headers

At the moment, it's hard to link things in like stylesheets in each view without having a monolithic view function that rendered conditionally. It would be much more ideal to support a way of linking CSS in a header that was somehow included everywhere

Session data

There's no way of storing session data right now.

FAQ

Should I use this in production?

No! This project was an experiment and a proof of concept. A lot of the ideas in this project are really cool. But being cool doesn't make for a production-ready system. Let's talk about a day in the life of a server-side Elm programmer.

  • Write some business logic in Elm
  • Realise that you need some library support that doesn't exist in Elm
  • Spend the rest of the day fighting Node

As an Elm programmer, I like to write Elm! As a server-side Elm programmer, I hate writing yet another integration library that wraps around a Node library that uses mutable objects and callbacks in a weird way. There are a lot of battles that you have to face everyday writing libraries that work with Node. Sometimes there just isn't a way to make Node libraries play nicely with Elm. This does not make for a stable runtime, nor a stable platform.

The tl;dr here is that Node is not the ideal platform for server-side Elm. An alternate platform to base itself on would be great, but is unlikely to happen "soon". Please take away some of the ideas here and think about them! But if you value your sanity, your stability and your users, don't use this proof of concept for anything more than interest!

Credit

Fresheyeball provided the PoC HTTP server implementation that we rewrote parts of here and then applied to production!

rtfeldman provided CSS support through elm-css

Awesome!

If you think this is awesome, why not apply to come join us make things?


[NoRedInk][team] [team]: http://noredink.com/about/team

More Repositories

1

derw

An Elm-inspired language that transpiles to TypeScript
TypeScript
330
star
2

json-to-elm

Create Elm type aliases and decoders based on JSON input
Elm
279
star
3

servelm

Server-side Elm
Elm
117
star
4

elm-blogger

A blogging platform written in Elm + Elixir
Elixir
102
star
5

elm-server-side-renderer

Render elm on the server
Elm
99
star
6

elm-static-html

Statically render html from Elm!
JavaScript
89
star
7

elm-static-site

Static site generator using Elm
JavaScript
87
star
8

elm-phoenix

Phoenix helpers for Elm
Elm
74
star
9

elm-html-test

Test elm-html in Elm!
Elm
68
star
10

haskell-to-elm

68
star
11

elm-for-web-developers

A collection of tips for people using Elm from a web-dev background
56
star
12

elm-static-html-lib

TypeScript
56
star
13

elm-ffi

An FFI interface for Elm
Elm
50
star
14

elmxir

Interop tools for working with Elm in Elixir
Elixir
46
star
15

elm-all-dict

A dict for Elm which can store any type
Elm
37
star
16

elm-bash-completion

Bash completion for Elm
Shell
27
star
17

elm-init-scripts

Python
25
star
18

elm-fuse

Fuse support in Elm
Elm
24
star
19

elm-sketch-importer

Generate Elm code from Sketch files!
Elm
22
star
20

elm-proper-install

Properly install things from Github for Elm
JavaScript
16
star
21

make-your-own-tea

A step-by-step guide to making your own Elm architecture in TypeScript
Shell
15
star
22

coed

Elm-style library for writing modern frontends
TypeScript
15
star
23

neuro-lingo

A language where you only implement comments
TypeScript
13
star
24

elm-flat-matrix

Flat matrix implementation for Elm
Elm
12
star
25

elm-html-in-elm

Elm
12
star
26

elm-alternative-json

An alternative to core's JSON decoder
Elm
12
star
27

elm-xml

xml parser for elm
Elm
11
star
28

hiraeth

Shell
10
star
29

elm-lazy

Elm
10
star
30

elm-run-worker

Run Elm files in worker mode from the CLI
JavaScript
8
star
31

elm-dom-tests

Test dom things
JavaScript
8
star
32

elm-flasked

Elm
8
star
33

sass-to-elm

Elm
7
star
34

slack-today-i-did

Python
7
star
35

meta-elm

Examples of doing meta programming Elm, which you shouldn't do
Elm
7
star
36

elm-http-server

A HTTP server for Elm
Elm
7
star
37

elm-debug-json-view

A package for debugging a decoders with Json in Elm
Elm
6
star
38

stalk

stack-based language written in Elm
Elm
6
star
39

relm

Use react alongside elm
JavaScript
6
star
40

elm-help

JavaScript
6
star
41

elm-debug-decoders

A tool for debugging decoders
JavaScript
6
star
42

elm-package-for-production

Python
5
star
43

pycho

A game engine with inbuilt AI support written for Python 2 and 3.
Python
5
star
44

elm-node-elm-compiler

Elm compiler via Node
Elm
5
star
45

idris-hangman

Example of hangman in Idris
Idris
5
star
46

adeilad

Ensure JSON has the correct structure at runtime
TypeScript
4
star
47

elm-html-query

Elm
4
star
48

the-elm-report

A presentation on the state of Elm
JavaScript
4
star
49

elm-http-error-view

A generic view component
Elm
4
star
50

post-install-elm

Use NPM for managing elm deps
JavaScript
4
star
51

broken-clock

A broken clock used as examples for Elm
Elm
4
star
52

elm-macros

Python
3
star
53

elm-phoenixed

HTML
3
star
54

drawea

Elm
3
star
55

PyChat.js

A chat system built around graceful-websockets and tornado
JavaScript
3
star
56

elm-json-field-value

Elm
3
star
57

BigSister

Extendable IRC bot framework
Python
3
star
58

elm-test-runner

Python
3
star
59

elm-debounce-effects

An effect manager for dealing with debouncing
Elm
3
star
60

elm-query

JQuery for Elm
Elm
3
star
61

elm-diff

Elm
3
star
62

elm-stringify

DEPRECATED: no use
JavaScript
3
star
63

elm-game-of-games

Game of life in Elm
Elm
3
star
64

elm-shrink

Elm
2
star
65

elm-to-elixir

Elm
2
star
66

react-to-elm

Convert React components to Elm
2
star
67

elm-lint

Elm
2
star
68

fedora-matlab

Web challenge
2
star
69

PyGeo2

A project to continue maintaining PyGeo and bring it up to date
2
star
70

ts-core

Some core data structures and functions for typescript
TypeScript
2
star
71

code-golf

collection of code-golfs solutions from our code-golf club
Python
2
star
72

elm-lazy-list

Elm
2
star
73

talks

Various talks I've done
JavaScript
2
star
74

advent-of-code-2016

Idris
2
star
75

caching-layer-docker

Docker files for the elm caching layer
Shell
2
star
76

elm-default-dict

A dict implementation which allows you to provide a default value to use
Elm
1
star
77

SimpleGames

Simple games from Atari implemented in various languages.
Python
1
star
78

realrpg

Python
1
star
79

the-new-turing-omnibus

Elm
1
star
80

elm-uno

An Uno-to-x compiler written in Elm
Elm
1
star
81

mountain-path

Elm
1
star
82

ovas-2

C++
1
star
83

ts-list-zipper

TypeScript
1
star
84

relearn-yourself-a-java

A set of questions used to reteach Java to students.
Java
1
star
85

css-reactor

Elm
1
star
86

elm-safe-regex

JavaScript
1
star
87

Fuze

Elm
1
star
88

NetlogoSims

Simulations written using Netlogo
NetLogo
1
star
89

bach

TypeScript
1
star
90

newer-paper

Elm
1
star
91

ProcessingVisualizations

Python
1
star
92

elm-full-stack

1
star
93

baner

Flag parsing library in Typescript
TypeScript
1
star
94

fontbomber

A clone of https://github.com/code-curve/font-bomb, but written in Python
Python
1
star
95

SourceUploader

Simple uploader for files to gist
1
star
96

mainc

A simple, small benchmarking library for Node
TypeScript
1
star
97

LudumDare28

A game written for LudumDare28
Python
1
star
98

lets-write-elm

Elm
1
star
99

ArdLib

Arduino libraries and general programs with diagrams
1
star
100

elm-graphql-debug-errors

Elm
1
star