3 ms·
Show HN: Fortune.js – High-level I/O for web applications
- nwmcsween 11y agoCool looks like virtus: https://github.com/solnic/virtus https://github.com/solnic/virtus, have you looked at how virtus, axiom: https://github.com/dkubb/axiom https://github.com/dkubb/axiom and the query optimizer are implemented?
- daliwali 11y agoI'd say it's a bit more similar to ActiveModel + ActiveModel::Serializer, or Waterline & JugglingDB in the Node.js realm, in that they can be used for the same purpose but go about the problem differently. Looks like axiom is coupled to RDBMS, while fortune tries to abstract away the data store (there are mongodb & postgres adapters) by providing a contract for reading/writing data. virtus looks very similar to the implementation of record type in fortune, has some extra features such as type coercion and lacks some features such as foreign keys. if you're interested in query implementation have a look at how the postgres adapter maps the adapter contract to sql: https://github.com/fortunejs/fortune-postgres/blob/master/lib/index.js https://github.com/fortunejs/fortune-postgres/blob/master/li...
- nwmcsween 11y agoAxiom is a relational algebra library it doesn't abstract an rdbms at all. The way datamapper 2 worked from my understanding was virtus was a property like api e.g. a back end agnostic schema that describes the data, axiom takes the relations (if any) from virtus then hands off the relations to a back end such as SQL, mongo, graphql query generator and optimizer. Datamapper 2 from looking is a much better structure.
- cvburgess 11y agoHas anyone used fortune? I saw this a long time ago when i dug through the Ember.js docs it mentioned this, but I never dug too deep into it.
- daliwali 11y agoThere are a few companies using it in production (and I use it for my work as the author of it), I just haven't bothered to ask for permissions etc. I discussed with one of the ember core team about replacing ember-cli's http-mock/fixtures with fortune, it seems doable by reusing ember data models in the backend. since they both support JSON API standard, the interaction should be frictionless.
- unindented 11y agoI've used it to prototype APIs during development, like this one: http://fort.herokuapp.com/api http://fort.herokuapp.com/api The code for that one lives here: https://github.com/unindented/fortune-example https://github.com/unindented/fortune-example
- nbrempel 11y agoThis looks great! I'm looking forward to giving it a try.
- hliyan 11y ago"WebSocket (included)" "Fortune includes a browser build, which comes with the IndexedDB" Brilliant. This is exactly what I've been looking for.
- d2xdy2 11y agoNeDB support!