Astronomy v2 - released! Think: Model layer for Meteor applications

After months of hard work, @jagi just released Astronomy v2!

http://jagi.github.io/meteor-astronomy/v2#getting-started


Astronomy is basically the missing model layer for Meteor. You can write your validations, schema, methods, timestamps, callbacks, and more all in a single place. Think: A Rails model for Meteor.

It’s pretty awesome!

Example:

import { Class } from 'meteor/jagi:astronomy';

const Posts = new Mongo.Collection('posts');
const Post = Class.create({
  name: 'Post',
  collection: Posts,
  fields: {
    title: {
      type: String,
      validators: [{
        type: 'gte',
        param: 3
      }]
    },
    userId: String,
    publishedAt: Date
  },
  behaviors: {
    timestamp: {}
  }
});

Congratulations on the launch @jagi!

12 Likes

Would be cool to have this generate a GraphQL schema as well! Something to think about in the coming months, would make it super easy to get Apollo going.

9 Likes

I haven’t been playing with Apollo yet, but I will support it in the future. However, I think it’s gonna need to be a fork of Astronomy that would behave in a little bit different way. We will see as I start playing with Apollo.

2 Likes

Great news!
I am a total fan of Astronomy, here’s to hoping it will be around for a long time!
/j

1 Like

This looks awesome and like Sashko said, it would be really cool to see this implemented with Apollo.

2 Likes

I’ve edited my previous post. I wanted to say “I will” not "I won’t :slight_smile: but autocorrection works “perfectly” on my phone :slight_smile:

2 Likes