Giter Site home page Giter Site logo

untangled-todomvc's Introduction

Untangled • TodoMVC

A client-only standard todomvc is on the client-only branch of this git repository. The master branch is the released version, and we use Git Flow, so the develop branch is active development.

Both develop and master contain a full-stack implementation of the TodoMVC application, with the following extensions:

  • Lists are persisted on the server (currently selected by adding a ?list=X param to URL)
  • Internationalization
  • Support VCR Viewer

Configure it:

WARNING: The server will not start without this step!

Copy resources/config/defaults.edn to /usr/local/etc/todomvc.edn.

{ 
 :datomic {
   :dbs {
     :todo {:url "datomic:mem://todo" 
            :schema "todomvc.migrations" 
            :auto-migrate true 
            :auto-drop true}}} 
 :port 3000} 

You can configure the datomic database URL to a file-based one if you wish, in which case you might want to turn off auto-drop so your lists persist over server restarts. Leave auto-migrate on, since that just makes sure the schema is up-to-date.

Running it:

Figwheel/Clojurescript Build

Start figwheel (the JVM options tell figwheel which builds to run):

JVM_OPTS="-Ddev -Dtest" lein run -m clojure.main script/figwheel.clj

which should start auto-building the cljs source and show a browser REPL.

You can do this in IntelliJ using a regular Clojure Main REPL that runs script/figwheel.clj (Parameters field). The -Ddev and -Dtest options can go in the JVM arguments field.

Our internal figwheel support uses Java system properties to select the builds you want to start (so you can create multiple run profiles for different tasks that target only specific builds). The supported build IDs are whatever builds are defined in the project file (it extracts build configurations from there). So, including -Dtest in the JVM arguments will include the build of tests.

Server

Start a CLJ REPL (e.g. command line or IntelliJ):

lein repl

At the REPL, start the server:

(go)

Navigate to: http://localhost:3000/dev.html?list=MyList

The list URL parameter allows you to select which persisted TODO list on the server you want.

Changes to the source should re-render without a browser reload.

Changes to server code can be put into effect at the REPL (will wipe database) with:

(reset)

Running the tests

The figwheel build above will start the client test build. Simply open (any number of) browsers on http://localhost:3000/test.html

Internationalization

The i18n support has been integrated into this example. A tutorial video will be out soon.

Viewing a Support Request

You'll need to start the build that creates the support viewer, so use this to start figwheel (restart figwheel and add -Dsupport to your JVM options):

JVM_OPTS="-Ddev -Dtest -Dsupport" lein run -m clojure.main script/figwheel.clj

Start the server as before.

Now load dev.html as before, do some operations, and create a support request using the Help button at the top of the screen. The server will persist it (in memory only), and give a support ID in the server logs. Simply open the support viewer with this URL (embedding the correct ID from the server log):

http://localhost:3000/support.html?id=ID_OF_REQUEST

You should now be able to step back in time through up to 100 steps of history. Each support request is stored separately. The implementation on this server does not persist them to Datomic, so they only exist for the lifetime of the server.

Credit

Created by NAVIS

untangled-todomvc's People

Contributors

awkay avatar egracer avatar graemenelson avatar laurio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

untangled-todomvc's Issues

Config Suggestion

This step requires people to copy around config stuff but I don't understand why this step is even needed.

If we just add "resources" to :resource-paths then everything in the resources directory will be available on the classpath. Then in todomvc.system we can get the path simply by

(-> (io/resource "config/defaults.edn") .getPath)

I feel like this reduces the friction needed to get started with this project and makes more sense. But maybe there's something I'm unaware of?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.