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!
- Node:
4.1.2
- Elm:
0.16
- Clone the repo
npm install
./run_prod.sh
There's a lot in this project to take in. These are the important parts to look at!
In a brief summary, this program has support for the following in Elm
- Server-side programs
- A web server
- Database support in Elm
- Build tools
- Env/JSON config support
- Type-safe CSS
- Server-side rendered client-side HTML
- Shared models between client and server side code
- Server-side templating for data injection
- Moment.js wrapper both client and server side
- Knox server side
- Uuid server side
- Nedb server side
- StartApp on the server
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.
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.
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
There's no way of storing session data right now.
Yes! We're going to use in production.
Fresheyeball provided the PoC HTTP server implementation that we rewrote parts of here and then applied to production!
rtfeldman provided CSS support through elm-stylesheets
If you think this is awesome, why not apply to come join us make things?
[][team] [team]: http://noredink.com/about/team