Code Monkey home page Code Monkey logo

graph-demo's Introduction

Friends Graph

A simple demo using fulcro, pathom and crux

Running (for clj devs)

Install npm deps

$ npm install

Start a REPL with dev profile

$ clj -A:dev

Call (user/-main) function. Wait the shadow-cljs build

Connect at localhost:8080

Running (for js devs)

Install npm deps

$ npm install

Start shadow-cljs via npm

$ npm start

Connect at localhost:8080

Running "production" jar

Install npm deps

$ npm install

Generate uberjar

$ lein uberjar

And run

java -jar target/graph-demo.jar

Connect at localhost:8080

React native (not working)

After get the web up'n'running, start the metro server

npm run rn-server

Then launch the app on emulator/app.

npm run rn-android

Hacking

src/
├── dev
│   └── user.clj ## dev helper
└── main
    └── souenzzo
        └── graph_demo
            ├── client.cljs   ## fulcro sutff
            └── core.clj      ## http, pathom and crux stuff
deps.edn                      ## clj deps
package.json                  ## js deps

Fulcro components generate a query like this

[{[:user/id "foo"]  [:user/id
                     :user/color
                     {:user/friends [:user/id 
                                     :user/color 
                                     {:user/friends [:user/id]}]}]}] 

Patohom resolver souenzzo.graph-demo.core/friends (bad name) will get "foo", turn into :user.id/foo, get the entity from crux, usually something like {:crux.db/id "foo" :user/friends [:user.id/var]} and return {:user/friends [{:user/id "bar"}]}

Pathom will flow the query recursively.

graph-demo's People

Contributors

souenzzo avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

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.