Meteor Kitchen - code generator for Meteor

Already known by community but never posted here:

Meteor Kitchen is my hobby project - code generator for Meteor.

Describe your application in one .json (or .yaml) file and meteor-kitchen will build:

  • directory structure
  • routes (iron-router)
  • pages (with widgets: form, dataview, markdown… etc.)
  • collections
  • user account system
  • multiple user roles (restrict access to pages and database operations)
  • write custom widgets
  • and more…

Take a look if you already didn’t

Enjoy! :wink:

23 Likes

Hi Perak,

I am interested in Meteor Kitchen, but I do not see how to make it suit my needs. I have not been able to find the source code or any information about licensing.

If i understand correctly perak:kitchen-site, is the generator for your Internet presence, not the actual source of Meteor Kitchen. Correct?

What is your license policy?
How can I contribute my own preferences back to you as Pull Requests?

Thanks,
Martin

1 Like

Hi Martin,

“Meteor Kitchen” (command line interface) is currently closed source. It’s just my hobby project (but publicly exposed). You are not the first - I got number of requests to open the source, maybe I’l do it in the future (BTW, it’s written in C++). Before that, I am planning to refactor core structure, make plugin system for widgets (widgets are currently named “components” and “plugins” but both will be unified and renamed to “widgets”), also I plan to simplify and improve metadata.json to ease writing GUI. With better core structure, meteor kitchen will be ready to became real open source project. Unfortunately, last few months I am busy with other things and I am working on meteor-kitchen only during weekends.

Yes, https://github.com/perak/kitchen-site is input file for meteor-kitchen that generates www.meteorkitchen.com site.

Please let me know what is the functionality you want to modify/improve?

About licensing
Thanks for reminding me - there is no licensing info on the site. I’l add it. Here for your notice: meteor-kitchen CLI (binary) is free and you are free to use it to generate applications. Also, generated application code is just a source code - you got full rights on it - the same as you wrote it manually (without generator).

Feel free to ask if you have more questions.

Very intersting idea,

this can definitely be useful for devs creating a lot of sites or trying to prototype quickly.

Some more info on the existing components would be nice (what packages are used, etc).
And open source would be great too.

But why C++?
Just because? ^^

Hi Chris,

Well, first thing people ask is “why C++” :smiley: - it’s definitely strange because meteor community is 99.99% javascript oriented, but I am basically C++ programmer and it was just easier for me to write it in C++.

Anyway, I don’t think that’s a problem - generator core should not change a lot - all future improvements - such as new widgets, kitchen-GUI etc. is written (and will be written) in javascript - generator core just assembles things together.

Also, it’s cross platform - compiles 1:1 under Linux, Mac, Windows (I compiled it on embedded FriendlyARM device too - just for fun). And there is no external source code dependencies (html parser, json parser etc - everything is written by me - and it compiles on any platform).

Kitchen-GUI (maybe you noticed, if you login into www.meteorkitchen.com there is a primitive GUI) is already open-source. Also, I am (slowly) working on improvements inside core to enable/ease writing more powerful and graphic oriented UI (WYSIWYG).

It’s just rare to find someone who touches C++ and the likes in the web dev community.
I try to spend at least a couple of days per quarter coding some C or Haskell to not get too immersed in Javascript.

Thank you for the clarification.

As a way to get out of FORTRAN, I looked at C++ in the early 90s and ran away shrieking! (ended up in SQL :smile: ) So, sorry, I don’t see how to collaborate.

Out of curiosity though – are you using a C++ template language of some kind? If you were to switch to Jade, and recode in JavaScript you would have a much easier time finding collaborators imo.

I’m also curious about a key characteristic of your, and anyone else’s, generator. If I generate a site, fiddle with it and generate the site again, are my fiddles overwritten? A decade ago I worked with AndroMDA a UML to Java application generator. They generated two files for each task: xxxBase and xxxImpl. The xxxImpls were skeletal “Your code goes here” files that deferred all generic functionality to the corresponding xxxBase file. The xxxBase files were regenerated every time. The xxxImpls were never overwritten. Do you, (could you), do anything similar?

Btw, I stumbled on to your work in my search for a convincing standard Meteor boilerplate. As a Meteor n00b, I want to be sure I start with the latest and highest level tools. So a boilerplate generator would be even more interesting if I could work with it. For now, I’m going to see what Meteoris does.

1 Like

Hey there @perak - I also have a code generator tool with a ‘kitchen’ theme (don’t sue me!)

http://package-kitchen.meteor.com/

View source (it’s client-side), or make a fork, if you feel like flexing your JS chops.

1 Like

Cool! Interesting stuff.

P.S. I’l send Dart Vader with imperial fleet directly to you - so prepare good excuse for using reserved word “kitchen” :slight_smile:

2 Likes

Hi Perak,

The Meteor Kitchen is pretty cool. Might take me a while to get the hang of it.

  1. I noticed that on your “getting started” page (http://www.meteorkitchen.com/getting_started) there’s this phrase
    "Here is the pattern for the input file structure:". Should it be the pattern for the output file structure?

  2. Also. I’ve been wondering how to include some AngularJS code into the input file for Meteor Kitchen, since it doesn’t seem like I can generate the app and then edit it in.

And also I have a few more questions about plugins:

  • wouldn’t it be easier to just declare component.html once instead of adding more on each line (see below, referring to the file plugins\example2\plugin.js)?

  • Also if I want to add in AngularJS markup code or AngularJS, how would I do it?

    component.html = ‘’;
    component.html += ‘’;
    component.html += ’

    ';
    component.html += ’ Hello! I am example plugin No.2: template with events ‘;
    component.html += ’ Click me! {{clickCounter}}’;
    component.html += ’

    ';
    component.html += ‘’;

Hi @breadcrumble to answer your questions:

  1. You are right, phrase from “getting started” is wrong, it should be “naming convention” or something similar - not “pattern for input file structure”…

  2. You can generate and edit app, but if you generate it again - your files will be overwritten. I didn’t try mixing Angular.js code with meteor (with or without generator), so I am not sure how to make it work, but I believe it’s possible - you can create component of type “custom_component” and provide custom html & js code that can contain anything. Also, you can instruct generator to copy any external files into server, client, both (anywhere - see application object, property “copy_files”).

About plugins: my plan is to completely remove plugins in future versions - their functionality will be replaced by extending “custom_component”. The only difference is that “custom_component” doesn’t have mechanism for executing custom code while generating app (but that possibility will be added).

However, to answer your questions about plugins:

  • Yes, it’s easier to provide external template html file and load it with readFileSync - my attention was to keep example as simple as possible without external files.

  • in plugin directory, you can see plugin.json file, it can contain something like:

{
	"packages": {
		"meteor": ["add-your-packages-here"],
		"mrt"   : []
	},
	"copy_files": [
		{ "source": "whatever_file", "dest": "CLIENT_DIR/whatever_file" }
	]
}

here you can specify packages that are used by your plugin, and also copy files into destination directories (you can use directory aliases, in this example CLIENT_DIR but there is more:

OUTPUT_DIR, CLIENT_DIR, CLIENT_LIB_DIR, CLIENT_STYLES_DIR, CLIENT_STYLES_DEFAULT_DIR, CLIENT_STYLES_THEME_DIR, CLIENT_VIEWS_DIR, CLIENT_VIEWS_NOT_FOUND_DIR, CLIENT_VIEWS_LOADING_DIR, LIB_DIR, SETTINGS_DIR, BOTH_DIR, BOTH_LIB_DIR, BOTH_COLLECTIONS_DIR, PUBLIC_DIR, PUBLIC_IMAGES_DIR, PRIVATE_DIR, SERVER_DIR, SERVER_LIB_DIR, SERVER_COLLECTIONS_DIR, SERVER_PUBLISH_DIR, SERVER_CONTROLLERS_DIR, SERVER_METHODS_DIR

I believe this should be enough, however, if you spent more time with using angular.js with meteor-kitchen, please keep me updated - and let me know can I make any quick-fix to make it easier (or possible).

Thanks!

Thanks for your quick reply. From what I have seen people would create a separate file e.g. Index.ng.html and then put the angular code in there, separate from the regular code for spacebars.

I was thinking in the case I will try to include these files under “copy_files” object like you said.

Thanks again for your clarification! :slight_smile:

New cool stuff in meteor kitchen:

  • Build app in the cloud (without installing and running generator locally)

  • Added sitemap. It’s drawn automatically. Currently static but will make possible to add/remove pages with drag & drop in (near) future. Trying to make kitchen-GUI more visual - “draw & generate”.

Currently working on possibility to generate app with OAuth login and adding upload feature to forms…

Enjoy! :smile:

3 Likes

This is very cool looking forward to using it

Hi Perak,

Thank you for putting the ingredients on your meteor kitchen out in the open! It helps a lot in developing rapid prototyping and perhaps developing an enterprise grade applications! I am currently developing/experimenting meteor kitchen, I’ve combined the admin and data view and did some tweaks to work and add some packages. I am wondering, probably an enhancement to include importing of csv, json etc. files in data view, the export functionality is working flawlessly! Again Thank you for putting a lot of effort in your meteor kitchen!

You’re a great chef!

Thanks,
Marvin

Thank you! :smile:

Data import: I agree, that’s useful. Added issue: https://github.com/perak/kitchen-site/issues/86 however, not sure when I’l add this functionality (working on a kitchen only when I find some free time - making “slow food” :smiley: )

1 Like

Hi @breadcrumble ,

Thanks for iniating conversation on angularjs . Can you share examples based on your understanding , It will helps the community lot .

Thanks @Parek for Wondefull tool

News from kitchen:

Thanks to Barton Hammond - new examples and video tutorials will be published soon.

Enjoy!

2 Likes

Hi Perak,

By the way, how do i create a additional custom roles, aside from the three default roles? Let say, super admin.

Thanks,
Marvin

@ajaxsoap just list your roles in “application.roles”.

Example:

{
  "application": {
    "roles": ["admin", "user", "blocked", "manager", "collaborator"]
  }
}

For custom roles, you can restrict access to pages and database operations:

{
  "application": {
    "roles": ["admin", "user", "blocked", "manager", "collaborator"]
    "collections": [
      {
        "name": "my_collection",
        "roles_allowed_to_read": ["admin", "manager", "user"],
        "roles_allowed_to_insert": ["admin", "manager"],
        "roles_allowed_to_update": ["admin", "manager"],
        "roles_allowed_to_delete": ["admin"]
      }
    ]
  }
}

There is also special built-in role “owner” - for use in collections - you can restrict read/update/delete operation only to owner (user who created document, actually maybe better name for this role is “creator”). For example, blog post can be edited/deleted only by owner.

But, creating “super admin” role… not sure is that possible (and what super admin is supposed to do?).