Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewsuzuki/elm-todo-rest-api
Modular, heavily-documented Elm todo app with a json rest api
https://github.com/andrewsuzuki/elm-todo-rest-api
Last synced: 28 days ago
JSON representation
Modular, heavily-documented Elm todo app with a json rest api
- Host: GitHub
- URL: https://github.com/andrewsuzuki/elm-todo-rest-api
- Owner: andrewsuzuki
- Created: 2016-06-23T13:55:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-27T01:01:26.000Z (about 7 years ago)
- Last Synced: 2024-04-22T13:34:02.334Z (8 months ago)
- Language: Elm
- Homepage:
- Size: 56.6 KB
- Stars: 105
- Watchers: 4
- Forks: 18
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- Awesome-BigData - TodoMVC with JSON API - Bare-bones, modular, heavily-documented todo app with JSON API persistence. (Examples)
README
# elm-todo-rest-api
![Todo Screenshot](screenshot.png)
The official [elm-todomvc](https://github.com/evancz/elm-todomvc) uses localStorage to persist state. Since most
real-world elm apps will interact with a web api to persist state,
this is a simple elm todo app demonstrating interaction
with a simple json api server.Additionally, the code here has about 10x the modularity of the official implementation.
This app is sparse on css on purpose.
The code is heavily-documented. If something is confusing,
submit an issue or PR and I'll improve the documentation there if possible.## Beginners
I recommend following roughly this order for checking out the code:
`Main → Models → Messages → Update → View`
then in the `Todos` directory:
`Todos.[Models → Messages → Update → Commands → View → Edit]`
then if you're feeling confident:
`Utils`
## Getting Started
If you haven't installed Elm 0.18 yet, do so [here](http://elm-lang.org/install).
elm-todo-rest-api 0.2.0 is compatible with **Elm 0.18**. If you're still on Elm 0.17, download elm-todo-rest-api 0.1.0 [here](https://github.com/andrewsuzuki/elm-todo-rest-api/releases/tag/0.1.0).
First, clone this repository:
```
$ git clone https://github.com/andrewsuzuki/elm-todo-rest-api.git
$ cd elm-todo-rest-api
```Then install dependencies:
```
$ npm install
$ elm package install
```To play with the app, first start up the api:
```
$ npm run api
```All changes will be reflected in `db.json`.
Then, in a new terminal window run the following to start a hot-reloading dev server through webpack:
```
$ npm run dev
```Visit [http://localhost:8000/](localhost:8000) in your browser and you should see the app!
Make some changes and see what happens.