barryels / realworld-mithril

Starter kit for new RealWorld framework implementations
https://realworld.io
37 stars 3 forks source link

RealWorld Example App

Mithril codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

Demo    RealWorld

This codebase was created to demonstrate a fully fledged fullstack application built with Mithril including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the Mithril community styleguides & best practices.

For more information on how this works with other frontends/backends, head over to the RealWorld repo.

How it works

10 000 Foot View


                    +---------------+
                    |               |
            +------->  Component X  +-------+
            |       |               |       |
            |       +---------------+       |
            |                               |
 [store.prop reference]               (function call)
            |                               |
            |    +--------------------+     |
            |    |                    |     |
            -----+       domain       <-----+
                 |                    |
                 |    Updates its     |
                 |   internal state   |
                 |   in response to   |
                 |      API data      |
                 |                    |
                 +----------^---------+
                            |
                            |
                            V
                    (External API(s))

domain/index.js

Handles app-level concerns and is UI agnostic. It handles communication with the external API (which should be abstracted away into a separate module for larger apps). It has a basic store data object which can be (relatively) easily replaced by Redux, mobX, etc. with/out Immutable data structures. It has two public interfaces:

ui/router.js

[TODO Add detail]

ui/components/*.js

[TODO Add detail]

Getting started

You can view a live demo over at realworld-mithril.netlify.com

To get the frontend running locally: