Meteor code generator

3,104 views
Skip to first unread message

Petar Korponaić

unread,
Aug 4, 2014, 2:51:22 PM8/4/14
to meteo...@googlegroups.com
Hi guys!

I started this project - it's meteor application generator: http://www.meteorkitchen.com

Maybe can be useful to someone. It's in early stage but it already saves me from a lot of boring and repeating code. Currently I am using it to start a new meteor application.

Please let me know what do you think? I plan to continue on this project if you find it useful and interesting.

Cheers!
Petar

P.S. site is meteor application created with generator without writing a single line of code. :)

Petar Korponaić

unread,
Aug 4, 2014, 3:12:07 PM8/4/14
to meteo...@googlegroups.com

James Wilson

unread,
Aug 4, 2014, 3:48:14 PM8/4/14
to meteo...@googlegroups.com
Great work man!

Very cool. Good job!

James Wilson


--
You received this message because you are subscribed to the Google Groups "meteor-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meteor-talk...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Maxime Quandalle

unread,
Aug 4, 2014, 7:29:50 PM8/4/14
to meteo...@googlegroups.com
Hi Petar,

For a single line installation like the one you propose:

> curl http://www.meteorkitchen.com/install | /bin/sh #

You should really use SSL, I don't want to execute some middle man code on my machine!

Otherwise, this generator is something new to me. Does that exists for other frameworks? Rails? Django?
Do you expect developers to write the JSON files [0] or maybe we can imagine an app with some UI (in the browser, or in the command line) to generate this file for the dev?
How does that compare to em [1]?

Maxime

[0]: https://github.com/perak/kitchen-site/blob/master/meteor-kitchen.json
[1]: https://github.com/EventedMind/em

Petar Korponaić

unread,
Aug 5, 2014, 12:46:12 AM8/5/14
to meteo...@googlegroups.com, Ja...@jameswilson.name
Thank you James! :)

Petar Korponaić

unread,
Aug 5, 2014, 1:10:38 AM8/5/14
to meteo...@googlegroups.com
Hi Maxime,

Thank you for review!

1. I'l switch to SSL soon.

2. It doesn't exists for other frameworks, I made it specifically for meteor.

3. Manually writing input JSON file can be difficult but it's still much faster than writing resulting application code. In "getting started" I wrote that GUI is under construction; In fact, I paused work on GUI because I need to make quality CLI first (currently I am working on better user account system and improving built-in components (form, dataview etc.).

4. "em" is cool: my tool currently cannot be used to add something later into application (when executed, it overwrites existing files), but "meteor-kitchen" can produce page contents (as you can see in examples), and developer can make own page content components (plugins). Main idea behind "meteor-kitchen" is to build as much code as possible in the beginning.

Deivide Oliveira

unread,
Aug 5, 2014, 11:18:00 AM8/5/14
to meteo...@googlegroups.com
Excellent!! 

Thank you very much!! 

Cheers! 

Deivide

Maxime Quandalle

unread,
Aug 5, 2014, 11:33:02 AM8/5/14
to meteo...@googlegroups.com
Also, do you plan to open the source code?


Le lundi 4 août 2014 20:51:22 UTC+2, Petar Korponaić a écrit :

Vijay Tailor

unread,
Aug 6, 2014, 10:08:09 AM8/6/14
to meteo...@googlegroups.com
Wow, very impressive. I wouldn't count on Meteorite at the moment though and build my own solution + would definitely invest in GUI or at least a wizard. Something like http://generatewp.com/ maybe?

Cheers,
Tailor

בתאריך יום שני, 4 באוגוסט 2014 21:51:22 UTC+3, מאת Petar Korponaić:

Petar Korponaić

unread,
Aug 6, 2014, 10:18:47 AM8/6/14
to meteo...@googlegroups.com
Thanks Deivide!

Petar Korponaić

unread,
Aug 6, 2014, 10:25:34 AM8/6/14
to meteo...@googlegroups.com
When I start making "meteor-kitchen", I did it to help myself, but then I decide to share it and see how people reacts - does meteor generator makes any sense or not. 

Currently, I am not sure what to do and what model to choose. For now, source code is closed. 

What do you think about that?

Petar Korponaić

unread,
Aug 6, 2014, 10:54:49 AM8/6/14
to meteo...@googlegroups.com
Hey Tailor!

Yeah, GUI is definitely on my list. Thank you for your suggestions. I already have some vision on how it should look like. In fact, It's 3rd application generator that I made: the first one in 2001-2002, it is windows application generator with GUI, it served in my ex. company for 10+ years and is "in house" development tool never commercialized/published. 

However, any idea is welcome. 

Also, GUI can be separate tool from CLI/generator core - GUI should produce JSON file which is input for generator. I am ready to help if someone have time and wish to work on that project.

Cheers,
Petar :)

Pahan Sarathchandra

unread,
Aug 6, 2014, 11:56:06 AM8/6/14
to meteor-talk
looking good. does dataview feature support pagination?


--
You received this message because you are subscribed to the Google Groups "meteor-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meteor-talk...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--pahans

Petar Korponaić

unread,
Aug 6, 2014, 2:37:06 PM8/6/14
to meteo...@googlegroups.com
Hi Pahan,

DataView component currently doesn't support pagination for large datasets. 

For all feature requests feel free to open github issue here: https://github.com/perak/kitchen-site/issues

Also, take in account that you can create your own component (plugin) for generator. Plugin documentation is thin, but I'l expand it when I find some free time (you can open issue for that too).

Thank you!
:) 

Steve Heady

unread,
Aug 10, 2014, 2:48:36 PM8/10/14
to meteo...@googlegroups.com
Hi Peter,

Thanks for putting this together, tested it out with a few examples and have a couple points of feedback:

1.  The directory structure is somewhat unconventional.

/both
  /router/router.js
  /collections/name.js

/lib
  (empty)

As opposed to the standard directory structure:

/lib
  router.js
/collections
  name.js

In general a lot of empty folders to sift through for a streamlined process

2.  Some of the types aren't fully defined.  

"type": "boolean" crashes on the error:  

Field source element "#form-input-checkbox" not found.

Unclear how to create array objects within collections.  The simpleSchema way isn't compatible:
{ "name":"stat","type":"object" }
{ "name":"stat.$.value" }
{ "name":"stat.$.description"}

3. The object reference page would be more useful if it listed available options for each paramater.  Right now most of them list the default but aren't clear what values are accepted.

Overall, its a departure from the process I'd use to create a project, but see plenty of potential in meteor-kitchen.  I'd also look into dropping the JSON creator into a webform to expose options and make setup easier.

-Steve

Petar Korponaić

unread,
Aug 10, 2014, 3:55:15 PM8/10/14
to meteo...@googlegroups.com
Hi Steve,

Thank you for detailed review!

Answers to your questions:

1. Directory structure is somewhat unconventional. I plan to modify it to be compatible with "em" scaffolding tool: https://github.com/EventedMind/em


2. Form component is not fully finished yet: it currently supports only "read_only", "text" and "textarea" input fields (I see form error message that your form have "checkbox" input field). 

Other form inputs will be added soon. Also, you can modify form template in directory where meteor-kitchen is installed, by default it is in "~/.meteor-kitchen/templates/bootstrap/form.html" - you can add <div id="form-input-checkbox"... but note: that will be overwritten when you install new version.


3. Object reference is automatically generated from source code & code comments. That will be changed - new version of generator (I didn't uploaded it yet) can export metadata information about each object with default values and possible options for each property. That metadata will be used for kitchen-GUI and for documentation generator. Currently I am really busy with other things, but I plan to generate kitchen-GUI with meteor-kitchen itself by using metadata info.

Stay tuned! :)

Cheers,
Petar

Gabriel Pugliese

unread,
Aug 10, 2014, 8:34:06 PM8/10/14
to meteo...@googlegroups.com
Hey guys, for 1) check my issue https://github.com/EventedMind/em/issues/29



Gabriel Pugliese
CodersTV.com
@coderstv

Serkan Durusoy

unread,
Aug 11, 2014, 7:34:33 AM8/11/14
to meteo...@googlegroups.com
Wow!

"Files in subdirectories are loaded before files in parent directories, so that files in the deepest subdirectory are loaded first, and files in the root directory are loaded last."

from the official docs is then soooo misleading!.. Well, to be fair, semantically debatable...

Phuc Nguyen

unread,
Aug 11, 2014, 9:27:38 AM8/11/14
to meteo...@googlegroups.com
This is very awesome :D !!!

Gabriel Pugliese

unread,
Aug 11, 2014, 3:37:58 PM8/11/14
to meteo...@googlegroups.com
@Serkan,

The docs are not wrong, look at the third bullet:
  • After sorting as described above, all files under directories named lib are moved before everything else (preserving their order).


I've done another test and I think putting simply on lib/both/ is not enough. Look at this:


  <script type="text/javascript" src="/client/lib/test.js?2a3453bba5b8f7e5a39caf4f0fb6016f1b588104"></script>
  <script type="text/javascript" src="/lib/both/test.js?2a3453bba5b8f7e5a39caf4f0fb6016f1b588104"></script>
  <script type="text/javascript" src="/lib/test.js?2a3453bba5b8f7e5a39caf4f0fb6016f1b588104"></script>
  <script type="text/javascript" src="/project.js?452b723531a416610206cc10bcbb81ffec4d33e1"></script>

client/lib is still loaded first. If something inside that folder depends on something at lib/both/ it will not work :(




Gabriel Pugliese
CodersTV.com
@coderstv


Serkan Durusoy

unread,
Aug 11, 2014, 3:44:13 PM8/11/14
to meteo...@googlegroups.com
Hmm, even more confusing, but what I'm baffled at is actually line 122 of your screenshot https://camo.githubusercontent.com/330b16ec2dabb249bd3a85f0fda66f3986562a1d/687474703a2f2f692e696d6775722e636f6d2f673855337471762e706e67

This looks counter-intuitive at best.

Petar Korponaić

unread,
Aug 11, 2014, 3:46:11 PM8/11/14
to meteo...@googlegroups.com
Thank you Phuc! ;)

Gabriel Pugliese

unread,
Aug 11, 2014, 4:18:28 PM8/11/14
to meteo...@googlegroups.com
That's because client/views/private/ has more deeper than both/collections/ (3x2)

Sorry for polluting your thread @Petar :(



Gabriel Pugliese
CodersTV.com
@coderstv


Petar Korponaić

unread,
Aug 11, 2014, 4:20:56 PM8/11/14
to meteo...@googlegroups.com
No problem :)

Tom Huges

unread,
Aug 11, 2014, 8:39:36 PM8/11/14
to meteo...@googlegroups.com
Thanks Petar! Very helpful for somebody like me who's starting out with Meteor.

Petar Korponaić

unread,
Aug 13, 2014, 7:08:21 AM8/13/14
to meteo...@googlegroups.com
Thanks Tom! :)

Also, instead of manually typing JSON input file, you can expect kitchen-GUI soon (next week), so... stay tuned! ;) 

Cheers!
Petar

Ali Camarata

unread,
Aug 13, 2014, 9:35:35 AM8/13/14
to Meteor Talk
What's the github repo so we can contribute and post issues via github?


Petar Korponaić

unread,
Aug 13, 2014, 11:57:44 AM8/13/14
to meteo...@googlegroups.com
Hi Ali,


But... code is not open (yet)

I am working on GUI and I improved plugin support in new version (not uploaded yet). Also, there will be public repository for plugins so anyone will be able to contribute by writing plugins. 

Also, any issues reported are welcome!

Thank you! :) 

Petar Korponaić

unread,
Aug 20, 2014, 7:07:12 AM8/20/14
to meteo...@googlegroups.com
Hi everybody,

I just uploaded new version of meteor-kitchen, just run install again to upgrade.

What's new:

- CoffeeScript: if you add "--coffee" switch, generator will produce .coffee code instead of .js (you need to install "js2coffee" npm module to do that).

- Metadata: generator can extract metadata info (JSON describing input file structure). I don't know would it be useful to someone - I am using it in kitchen-GUI.

- Examples are built-in, with --example switch you can build 5 example apps (type "meteor-kitchen --help" for more info).


I am still working on GUI, stay tuned!

:)

Dirk Stevens

unread,
Aug 20, 2014, 1:30:23 PM8/20/14
to meteo...@googlegroups.com

Cool stuff Petar - looks great to get started !

Petar Korponaić

unread,
Aug 22, 2014, 3:48:54 AM8/22/14
to meteo...@googlegroups.com
Thank you Dirk! :)

Petar Korponaić

unread,
Aug 22, 2014, 3:53:57 AM8/22/14
to meteo...@googlegroups.com
Good news for Jade lovers: use --jade switch and generator will convert html files to jade.

Jade converter is experimental (I wrote it in rush). It's not 100% syntactically clean and will be improved in future. At least, it's super fast (long live good old friend: C++).

Enjoy! (and share your impressions).

吕世博

unread,
Aug 22, 2014, 7:44:46 AM8/22/14
to meteo...@googlegroups.com
I think it's necessary to allow registered users visit pages in public zone(Most websites did this right?), and there are a few points I complained when I was building an app:
1. Should we have a i18n support of the login/register page and form controls? Or allow developers modify the strings.
2.Why do you choose navbar-inverse instead of default? It's really ugly, I think you can provide an option to let developer choose the one they love.
3.It's stupid to write all the "code" into one son file. Could we have some ways to "include" a json file? Or just auto-link all the files in the source folder, just like meteor.

在 2014年8月5日星期二UTC+8上午2时51分22秒,Petar Korponaić写道:

David Collier

unread,
Aug 22, 2014, 1:09:01 PM8/22/14
to meteo...@googlegroups.com
This is very cool! There's a whole world of SSGs (static site generators) out there, but you just made it as easy to generate a live site!

you might want to think about YAML rather than JSON as it's a lot easier / less error-prone to write by hand.

it's impressive you wrote your own C++ Jade converter! There's also this related project from Denis G  https://github.com/DenisGorbachev/priest

Petar Korponaić

unread,
Aug 23, 2014, 2:19:57 AM8/23/14
to meteo...@googlegroups.com

Thank you for review!

1. Login/Register page will be improved in future. However, you can do it yourself: go to meteor-kitchen templates directory, typically it is in: ~/.meteor-kitchen/templates/bootstrap/ and find login.html/login.js, register.html/register.js etc. Make renamed copies of these files and modify them. Than you can do in your input file:

...
{ "name": "login", "template": "your_version_of_login.html" },
{ "name": "register", "template": "your_version_of_register.html" },
{ "name": "forgot_password", "template": "your_version_of_forgot_password.html" },
{ "name": "reset_password", "template": "your_version_of_reset_password.html" }
...


2. You are right: layout is currently fixed and should be improved. You can do it yourself, template files are:

~/.meteor-kitchen/templates/bootstrap/layout_simple.html
~/.meteor-kitchen/templates/bootstrap/layout_accounts.html

Note: when you install new version of meteor-kitchen, these files will be overwritten (!)


3. Single JSON file that you wrote produces 1000's lines of js & html code. How many code you want to write to produce dynamic site? :D BTW, take into account that I am working on GUI: once I finish - no more writing json files.


Cheers!
Petar   

Petar Korponaić

unread,
Aug 23, 2014, 2:32:30 AM8/23/14
to meteo...@googlegroups.com
Thank you David!

YAML/JSON: I am currently working on a kitchen-GUI. Once I finish - no more need to manually write JSON (or any other type of) input file. So, stay tuned! :)

Cheers!
Petar

吕世博

unread,
Aug 27, 2014, 1:23:49 AM8/27/14
to meteo...@googlegroups.com
Thank you. And are you ready for Meteor 0.9? Still, I think it's necessary to allow registered users visit pages in public zone.

在 2014年8月23日星期六UTC+8下午2时19分57秒,Petar Korponaić写道:

Petar Korponaić

unread,
Aug 27, 2014, 3:27:58 AM8/27/14
to meteo...@googlegroups.com

Meteor Kitchen is ready for 0.9.0, but some packages used by built-in components are not compatible with new packaging system yet. So, I temporary modified newest version of meteor-kitchen to forcibly use meteor 0.8.3 (it executes "meteor create project_name --release 0.8.3"), I will wait few days to see what will happen, currently there is real mess with packages.

About pages in public zone: I added issue to github page https://github.com/perak/kitchen-site/issues/13

Feel free to report issues here: https://github.com/perak/kitchen-site/issues 

Thanks!
Petar

Vijay Tailor

unread,
Sep 11, 2014, 12:02:24 PM9/11/14
to meteo...@googlegroups.com
Hi Peter, any updates on Meteor Kitchen and Meteor 0.9.0/1?

Kind regards,
Tailor Vijay

בתאריך יום רביעי, 27 באוגוסט 2014 10:27:58 UTC+3, מאת Petar Korponaić:

Rafiki Cai

unread,
Sep 11, 2014, 12:05:11 PM9/11/14
to meteo...@googlegroups.com
Vijay:

I trust that all is well w/ Petar.  He's been clean off
the radar for a while now.

RC

Petar Korponaić

unread,
Sep 12, 2014, 1:46:43 AM9/12/14
to meteo...@googlegroups.com
Hi guys!

I am alive! :) But... busy these days. I uploaded new version yesterday: it is related to user roles and collection hooks, but no docs yet (except "object reference"). I will update docs soon (getting started page).

I didn't focused on 0.9+ yet. I believe that mess around meteor packages is now mostly fixed, so my next step (when I find some time) will be to make kitchen work with new package system.

P.S. let me know what for / how are you using meteor-kitchen? (Just curious) :)

Cheers!
Petar

Marco Wettstein

unread,
Sep 12, 2014, 4:49:41 AM9/12/14
to meteo...@googlegroups.com
oh, that's so cool! thank you very much!

Petar Korponaić

unread,
Sep 15, 2014, 2:26:23 AM9/15/14
to meteo...@googlegroups.com
Hey Vijay,

Kitchen now works with Meteor >=0.9 (and doesn't work with <0.9 anymore). 

Just update it (install kitchen again).

Cheers!


On Thursday, September 11, 2014 6:02:24 PM UTC+2, Vijay Tailor wrote:

Petar Korponaić

unread,
Sep 15, 2014, 2:44:33 AM9/15/14
to meteo...@googlegroups.com
Hello everybody!

"Meteor Kitchen" now works with Meteor 0.9+ (and be careful - it doesn't work with old versions anymore).

Other news:

User roles

You can now define user roles, and restrict any page to any set of user roles. Also, access to collections can be restricted: collection definition now has properties "roles_allowed_to_read", "roles_allowed_to_insert", "roles_allowed_to_update" and "roles_allowed_to_delete". No docs and examples yet (only docs about roles is in "object reference" page).

Form

Built-in form component now supports more input controls (added: checkbox, radio and select). Also, input type "select" can show options from collection (lookup_query).

Fixed some bugs

I fixed bunch of minor bugs.


Enjoy!

On Monday, August 4, 2014 8:51:22 PM UTC+2, Petar Korponaić wrote:

Petar Korponaić

unread,
Sep 15, 2014, 4:32:42 AM9/15/14
to meteo...@googlegroups.com
Update: added guide about user roles into "Getting started" page.

Jan S

unread,
Sep 25, 2014, 11:13:40 AM9/25/14
to meteo...@googlegroups.com
latitudee5400@Latitude-E5400-PC:~$ curl http://www.meteorkitchen.com/install | /bin/sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2187    0  2187    0     0   2795      0 --:--:-- --:--:-- --:--:--  3521
Installing "Meteor Kitchen" - Meteor application code generator
Detecting OS...
Detected OS: Linux
Downloading distribution...
######################################################################## 100,0%
Creating destination directory...
Unpacking...
Cleaning up...
rm: cannot remove `/home/latitudee5400/.meteor-kitchen/examples/example-*.json': No such file or directory
Done.

"Meteor kitchen" is now installed in "/home/latitudee5400/.meteor-kitchen".

Creating symlink: ln -s /home/latitudee5400/.meteor-kitchen/bin/meteor-kitchen /usr/local/bin/meteor-kitchen
Done.

Now you can launch generator by typing:

    meteor-kitchen

For more info visit: www.meteorkitchen.com
Enjoy!
latitudee5400@Latitude-E5400-PC:~$ meteor-kitchen
bash: /usr/local/bin/meteor-kitchen: cannot execute binary file
latitudee5400@Latitude-E5400-PC:~$ sudo meteor-kitchen
/usr/local/bin/meteor-kitchen: 1: /usr/local/bin/meteor-kitchen: Syntax error: "(" unexpected

 
can't get meteor-kitchen working on my machine :( anyone else experiencing issues?

by the way great project - keep up the good work!

 

Petar Korponaić

unread,
Sep 25, 2014, 11:22:00 AM9/25/14
to meteo...@googlegroups.com
Hi Jan,

What operating system are you using?

Petar Korponaić

unread,
Sep 25, 2014, 11:22:39 AM9/25/14
to meteo...@googlegroups.com
(which linux distribution to be more precise)

Jan S

unread,
Sep 25, 2014, 3:19:04 PM9/25/14
to meteo...@googlegroups.com
Hey, I'm using elementary OS (Luna), based on Ubuntu 12.04 LTS

Petar Korponaić

unread,
Sep 25, 2014, 3:28:57 PM9/25/14
to meteo...@googlegroups.com
Kitchen is working perfectly in Ubuntu 12.04 (I made it in Ubuntu 12.04). Are you using 64-bit version? (kitchen doesn't work in 32-bit OS).

Also, message is strange: "meteor-kitchen" is binary file and there is no code that can produce error like that, so I am curious what it can be ( :o )

Petar Korponaić

unread,
Sep 25, 2014, 3:37:19 PM9/25/14
to meteo...@googlegroups.com
Maybe you can try to add execute permissions and run kitchen without "sudo":

sudo chmod +x /usr/local/bin/meteor-kitchen

--
You received this message because you are subscribed to a topic in the Google Groups "meteor-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/meteor-talk/zXgP7ddCdHk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to meteor-talk...@googlegroups.com.

Jan S

unread,
Sep 25, 2014, 3:49:02 PM9/25/14
to meteo...@googlegroups.com
Oh really? Yeah I'm running 32bit version :/ didn't know about that

Petar Korponaić

unread,
Sep 26, 2014, 12:45:50 AM9/26/14
to meteo...@googlegroups.com
Sorry. You can remove it by typing:

sudo rm -rf ~/.meteor-kitchen
sudo rm -rf /usr/local/bin/meteor-kitchen

Cheers!
Petar

Jan S

unread,
Sep 26, 2014, 2:41:11 AM9/26/14
to meteo...@googlegroups.com
Ok thanks. Is there a reason why only 64bit is supported? You should put up a note at meteorkitchen.com on the docs. There's just a note that Meteo needs to be installed!

Jan S

unread,
Sep 26, 2014, 4:48:47 AM9/26/14
to meteo...@googlegroups.com
Another question:

Is it possible to use checkboxes, radio buttons or select with meteor-kitchens form component?

Petar Korponaić

unread,
Sep 26, 2014, 9:52:02 AM9/26/14
to meteo...@googlegroups.com
1. The reason why only 64-bit OS is supported is: To be honest, I am too lazy to cross-compile it or install 32-bit OS in VM and compile it, and then bundle and upload it each time I change something :)

2. Yes, it's possible to use checkboxes, radio-buttons and selects: you can define field (inside form, or globaly inside collection definition) like this:

  "name": "someField",
  "title": "Some field", 
  "input": "radio", 
  "input_items": [
    { "value": "someValueForFirstItem", "title": "First item title" },
    { "value": "someValueForSecondItem", "title": "Second item title" },
    ...
  ]
}
 
(the same for checkbox or select: "type" should be "checkbox" or "select")

Jan S

unread,
Oct 2, 2014, 6:58:22 AM10/2/14
to meteo...@googlegroups.com
Is cross-compiling a big thing? Wouldn't it be great to target a bigger group of users for your Meteor generator? ;)

Jan S

unread,
Oct 5, 2014, 4:13:16 AM10/5/14
to meteo...@googlegroups.com
Is there a way to integrate templates (and their helpers), that are not generated, but already defined in a package that will be added afterwards to a route or a page in general? I have no idea how to do that. Thank you in advance!

Petar Korponaić

unread,
Oct 5, 2014, 6:25:11 PM10/5/14
to meteo...@googlegroups.com
Sorry Jan, I don't understand your question. Can you please explain better (maybe with some example).

Petar Korponaić

unread,
Oct 6, 2014, 2:29:06 AM10/6/14
to meteo...@googlegroups.com
If I understand well, maybe this can help you:

You can add generic component into page and write your own html and js code, like this:

{
 
"name": "my_component",
 
"title": "My cool component",
 
"type": "component", // type "component" is generic and requires custom template
 
"custom_template": "relative_path/something" // you need to provide something.html and something.js, path is relative to input json file
 
"query": {
   
"name": "some_query",
   
"collection": "some_collection",
   
"filter": {}
 
}
 
...
}


Your HTML and JS file can contain anything. Your component can contain other components, can use query - the same as any other built in component. 

If you want your component to be reusable in multiple pages, then you should use tokens in HTML and JS files that will be replaced by generator, for example:

something.html

<template name="TEMPLATE_NAME">
 
<h1>COMPONENT_TITLE</h1>

 
<ul>
    {{#each QUERY_VAR}}
     
<li>
        {{some_field}}
     
</li>
    {{/each}}
 
</ul>
</template>


something.js

Template.TEMPLATE_NAME.helpers({
 
"itemCount": function() { return QUERY_VAR.count(); }
});


Template.TEMPLATE_NAME.events({
 
"click h1": function(e, t) { /* do something */ }
});


Generator will automatically replace strings:

COMPONENT_ID
TEMPLATE_NAME
COMPONENT_TITLE
COMPONENT_CLASS
QUERY_VAR
COLLECTION_VAR
APP_TITLE



On Sunday, October 5, 2014 10:13:16 AM UTC+2, Jan S wrote:

Jan S

unread,
Oct 10, 2014, 5:03:15 AM10/10/14
to meteo...@googlegroups.com
I defined a package that has a template and a helper. I want to make a page that is only containing this template with your great generator.

An common example would be {{>loginButtons}} from accounts-ui (okay doesn't make much sense to create a page only containing this template because loginButtons is just a small UI element but I hope you know what I mean)

What I've done was a ugly workaround:

   {
                            "name": "myDetails",
                            "components": [{
       "name": "Details",
       "type": "markdown",
                                    "source_file": "template/details.md"
   }]

And details.md only containing:
{{>myFbDetails}}

Is there a direct way to bind a template to a page instead of defining a extra html+js? Thanks for your quick and detailed answer!

Petar Korponaić

unread,
Oct 10, 2014, 11:29:53 AM10/10/14
to meteo...@googlegroups.com
Did you try to make page like this:

{
     "name": "myDetails",
     "text" : "{{>myFbDetails}}"
}

That page will contain only:

<div class="container">
  {{>myFbDetails}}
</div>

Jan S

unread,
Oct 13, 2014, 3:13:52 AM10/13/14
to meteo...@googlegroups.com
Thank you very much. So basically it is a template that is nested into another template (+div). That is okay

Petar Korponaić

unread,
Oct 31, 2014, 3:58:57 AM10/31/14
to meteo...@googlegroups.com
Meteor 1.0 is now supported. Enjoy! :)

Jonah Simon

unread,
Oct 31, 2014, 1:48:50 PM10/31/14
to meteo...@googlegroups.com
Hi Petar, 
this is great project - I feel like this is really important.  I’m coming from the Drupal world where I’m used to building applications from an interface rather than only straight from the code. I love Meteor and it’s reactivity/speed, and wonder if the future of Meteor is where there is built-in administration GUI controls for setting up apps… Here is my vision:

Without having to go and add a bunch of standard packages which everyone would add anyways… *cough* iron:router, ui-accounts, etc *cough*...  by default there would be an admin user created and an administration panel that lets you easily create pages (which would of course automatically set up their routes)… instead of blocks like Drupal has you could create templates from a builder that you can then specify where in the layout they go and what pages they show up on (think blocks and/or panels in Drupal).  And then something like a collection-builder (think content-type creation in Drupal), and a way to easily create queries (think Views in Drupal).  Of course user/permission/roles is always something you need to think about when it comes to building apps, and something built in for managing that would be great.

To me that sounds like the absolute holy grail: You get the speed and reactivity of Meteor with easy controls for setting up applications - which in turn would add even more speed to the Meteor development process...


Your project is essentially going down that path and I love it. 

Petar Korponaić

unread,
Oct 31, 2014, 3:03:19 PM10/31/14
to meteo...@googlegroups.com
Hi Jonah,

Thank you for your trust and support!

Yes, that's my vision too - something like Drupal or WordPress of the new (data-on-the-wire) ages ;) :)

I already started kitchen-GUI. If you registered and logged into meteor-kitchen, you saw empty "under the construction" pages - that's actually a place for application builder. (BTW, I am using meteor-kitchen to generate GUI :)

I am freelancer, and I already finished one application with generator. Currently I am working on the other one - kitchen speeds up development to the speed of light. Also, I am adding new features to the generator on-the-fly as I need them. But... writing input json file for larger application is a nightmare (still faster than manually writing miles of code) so that's why I started working on a GUI.

Stay tuned, and thank you again! :)

Cheers!
Petar

Benstr

unread,
Nov 4, 2014, 2:40:38 AM11/4/14
to meteo...@googlegroups.com
You can now break your JSON out into multiple files and using this script to compile them all into one JSON when you are ready to pass to Kitchen. It adds one more notch on the level of complexity because you need to manually link to your separate files but it is still better than writing your app by hand.  https://gist.github.com/benstr/f61301e7fc55530253de 

Petar Korponaić

unread,
Nov 4, 2014, 6:57:03 PM11/4/14
to meteo...@googlegroups.com
Since version 0.7.7 Input file can be in YAML format. File format is detected by extension and should be ".yml" or ".yaml" (any other file extension is assumed JSON). You need https://www.npmjs.org/package/yaml2json converter.

Enjoy!

John O Kolade

unread,
Nov 14, 2014, 4:42:47 PM11/14/14
to meteo...@googlegroups.com
Hello Petar, Thank for your excellent work. I am looking forward to your gui, let me know how I might help. I haven't dove deeper into MeteorKitchen yet. I have a complex project in-mind and I might need to consult you about. Do you have a consultation service. I Will really appreciate that. I follow you on twitter and Facebook it will be nice if you can approve that. Looking forward to speaking with you and doing business together. This is a great project you have going on, and will love to see it come to fruition. 


On Friday, October 31, 2014 2:03:19 PM UTC-5, Petar Korponaić wrote:
Message has been deleted

Petar Korponaić

unread,
Nov 19, 2014, 2:23:16 PM11/19/14
to meteo...@googlegroups.com
"Meteor Kitchen" code generator now have GUI.

GUI is web based - built with meteor-kitchen itself. Just login to http://www.meteorkitchen.com

It's early prototype (and I didn't tested it properly yet). I am currently working on docs...

BTW, GUI is open source ("kitchen-site" repository https://github.com/perak/kitchen-site)

Enjoy!

P.S. meteor server is insanely slow at the moment...

mourad zamoun

unread,
Nov 22, 2014, 8:44:26 PM11/22/14
to meteo...@googlegroups.com
Hi

I tried your app with : meteor-kitchen --metadata example-invoices invoices
and I don't see the code generated except the file example-invoices.

I don't understand how it works ??
Message has been deleted

Petar Korponaić

unread,
Nov 23, 2014, 2:52:56 AM11/23/14
to meteo...@googlegroups.com
Hi Mourad,

This is because you are using option "--metadata". That option extracts metadata information and is used internally by generator itself.

So, do the same thing without option "--metadata" :

meteor-kitchen --example-invoices invoices

mourad zamoun

unread,
Nov 23, 2014, 5:38:12 AM11/23/14
to meteor-talk
don't work again :

meteor-kitchen example-invoices invoices

*** Meteor Kitchen v0.9.2 ***
Meteor Application Generator - www.meteorkitchen.com
Copyright (c) Petar Korponaić

Reading input file...

Invalid input file structure: "application" object not found.


2014-11-23 8:51 GMT+01:00 Petar Korponaić <petar.k...@gmail.com>:
Hi Mourad,

This is because you are using option "--metadata". That option extracts metadata information and is used internally by generator itself.

So, do the same thing without option "--metadata" :

meteor-kitchen example-invoices invoices


On Sunday, November 23, 2014 2:44:26 AM UTC+1, mourad zamoun wrote:

--
You received this message because you are subscribed to a topic in the Google Groups "meteor-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/meteor-talk/zXgP7ddCdHk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to meteor-talk...@googlegroups.com.

Petar Korponaić

unread,
Nov 23, 2014, 7:49:42 AM11/23/14
to meteo...@googlegroups.com
Sorry, I made typo, there should be two "--" chars before "example":

meteor-kitchen --example-invoices invoices


Maybe this is little bit confusing, I'l modify "usage" text. But if you read carefully it says:

meteor-kitchen --example-<name> <output_dir>

Available examples:

example-invoices
example-minimal
example-accounts
example-subpages
example-plugins
example-dataview

:)

mourad zamoun

unread,
Nov 23, 2014, 8:38:54 AM11/23/14
to meteor-talk
meteor-kitchen --example-invoices invoices

*** Meteor Kitchen v0.9.2 ***
Meteor Application Generator - www.meteorkitchen.com
Copyright (c) Petar Korponaić

Reading input file...
Executing "meteor create invoices/"...
invoices/: Already exists                     
                                              
Error executing "meteor". Error executing "meteor". No such file or directory


Petar Korponaić

unread,
Nov 23, 2014, 8:51:37 AM11/23/14
to meteo...@googlegroups.com
Meteor gives you error (as it normally do even without generator) because you are trying to create new application in the existing directory ("invoices" directory already exists).

mourad zamoun

unread,
Nov 23, 2014, 9:55:32 AM11/23/14
to meteor-talk
Thanks Petar ;-)

It works fine ...

can we generate a pdf file of an invoice and send it by email to customer ?



Petar Korponaić

unread,
Nov 23, 2014, 10:06:46 AM11/23/14
to meteo...@googlegroups.com
This is just an example application for generator so I didn't want to complicate it with "print" feature. 

If you add this feature, let me know :)

There are wkhtmltopdf and pdfkit packages for Meteor. (wkhtmltopdf converts html to pdf at server-side, pdfkit can build pdf document client side...). I didn't play too much with printing from Meteor, but this feature is must have in many applications, so if you have enough time and will - try to implement it and I'l add it to "example-invoices" - I will list you as contributor @ meteorkitchen site 

:)

mourad zamoun

unread,
Nov 23, 2014, 10:44:21 AM11/23/14
to meteor-talk
Ok
Thank you for informations :)


Mihai Frimu

unread,
Nov 28, 2014, 8:54:53 PM11/28/14
to meteo...@googlegroups.com
Hi,

Amazing work !!!!  The best generator I have seen in ages.

I have 2 questions: 

1. Are you using total.js - and what is it used for?
2. Is the login using Meteor accounts-password or is it something separate?

Petar Korponaić

unread,
Nov 29, 2014, 5:58:46 AM11/29/14
to meteo...@googlegroups.com
Hi Mihai,

Thank you.

- I am not using total.js

- Generated application is using accounts-base and accounts-password

Mihai Frimu

unread,
Nov 29, 2014, 9:36:22 AM11/29/14
to meteo...@googlegroups.com
Thanks,

How would you access the  Meteor.users collection in a dataview?

Thank you. 

Petar Korponaić

unread,
Nov 29, 2014, 7:29:03 PM11/29/14
to meteo...@googlegroups.com
In your dataview's query, specify "collection": "users" You don't need to define users collection, generator will detect what you want and will generate appropriate code.

Here is example application with user accounts system and admin page with ability to set three user roles: admin, user and blocked

{
"application": {
"title": "Example application",
"meta_title": "Example application",
"meta_description": "Meteor Kitchen - example application",
"theme": "bootswatch-flatly",

"roles": [ "admin", "user", "blocked" ],
"default_role": "user",

"collections": [
],

"public_zone": {
"pages": [
"name": "home_public", 
"title": "", 
"components": [
{
"name": "home_jumbotron",
"title": "Example application",
"type": "jumbotron",
"text": "Admin example",
"button_title": "Continue &raquo;",
"button_route": "login"
}
]
},
{ "name": "login", "template": "login.html" },
{ "name": "register", "template": "register.html" },
{ "name": "forgot_password", "template": "forgot_password.html" },
{ "name": "reset_password", "template": "reset_password.html", "route_params": ["resetPasswordToken"] }
],

"menus": [
{
"name": "left_menu",
"class": "nav navbar-nav",
"dest_selector": "#menu",
"items": [
{ "title": "Home", "route": "home_public" }
]
},

{
"name": "right_menu",
"class": "nav navbar-nav navbar-right",
"dest_selector": "#menu",
"items": [
{ "title": "Register", "route": "register" },
{ "title": "Login", "route": "login" }
]
}
]
},

"private_zone": {
"pages": [
{ "name": "home_private", "title": "Welcome {{userFullName}}!" },


{
"name": "admin",
"roles": ["admin"],
"pages": [
{
"name": "users",
"components": [
{
"name": "view",
"type": "dataview",
"title": "Users",
"text_if_empty": "No users yet",
"query": {
"name": "admin_users",
"collection": "users",
"filter": {},
"options": { "sort": { "\"profile.name\"": 1 } }
},

"fields": [
{ "name": "profile.name", "title": "Name"},
{ "name": "profile.email", "title": "E-mail" },
{ "name": "roles", "title": "Role" }
],

"insert_route": "admin.users.insert",

"edit_route": "admin.users.edit",
"edit_route_params": [
{ "name": "userId", "value": "this._id" }
],

"details_route": "admin.users.details",
"details_route_params": [
{ "name": "userId", "value": "this._id" }
]
}
],
"pages": [
{
"name": "details",
"route_params": ["userId"],
"components": [
{
"name": "details_form",
"type": "form",
"mode": "read_only",
"title": "User details",
"query": {
"name": "admin_user",
"collection": "users",
"filter": { "_id": ":userId" }
},
"fields": [
{ "name": "profile.name", "title": "Name"},
{ "name": "profile.email", "title": "E-mail", "type": "email" },
{ "name": "roles", "title": "Role" }
],
"close_route": "admin.users",
"back_route": "admin.users"
}
]
},
{
"name": "insert",
"components": [
{
"name": "insert_form",
"type": "form",
"mode": "insert",
"title": "Add new user",
"submit_route": "admin.users",
"cancel_route": "admin.users",
"query": {
"name": "users_null",
"collection": "users",
"filter": { "_id": null }
},
"fields": [
{ "name": "profile.name", "title": "Name", "required": true },
{ "name": "profile.email", "title": "E-mail", "type": "email", "required": true },
{ "name": "password", "title": "Password", "input": "password", "required": true },
{
"name": "roles",
"type": "array",
"title": "Role",
"input": "radio",
"input_items": [
{ "value": "user", "title": "User" },
{ "value": "admin", "title": "Admin" },
{ "value": "blocked", "title": "Blocked" }
]
}
]
}
]
},
{
"name": "edit",
"route_params": ["userId"],
"components": [
{
"name": "edit_form",
"type": "form",
"mode": "update",
"title": "Edit user",
"submit_route": "admin.users",
"cancel_route": "admin.users",
"query": {
"name": "admin_user",
"collection": "users",
"filter": { "_id": ":userId" }
},
"fields": [
{ "name": "profile.name", "title": "Name", "required": true },
{ "name": "profile.email", "title": "E-mail", "type": "email", "required": true },
{
"name": "roles",
"type": "array",
"title": "Role",
"input": "radio",
"input_items": [
{ "value": "user", "title": "User" },
{ "value": "admin", "title": "Admin" },
{ "value": "blocked", "title": "Blocked" }
]
}
]
}
]
}
]
}

],

"menus": [
{
"name": "side_menu",
"class": "nav nav-stacked nav-pills",
"items": [
{ "title": "Users", "route": "admin.users" }
]
}
]
},


{
"name": "user_settings",
"pages": [
{ "name": "change_pass", "template": "change_pass.html" }
],

"menus": [
{
"name": "side_menu",
"class": "nav nav-stacked nav-pills",
"items": [
{ "title": "Change password", "route": "user_settings.change_pass" }
]
}
]
},
{ "name": "logout", "template": "logout.html", "action_code": "App.logout();" }
],

"menus": [
{
"name": "left_menu",
"class": "nav navbar-nav",
"dest_selector": "#menu",
"items": [
{ "title": "Home", "route": "home_private" }
]
},
{
"name": "right_menu",
"class": "nav navbar-nav navbar-right",
"dest_selector": "#menu",
"items": [
"title": "{{userEmail}}",
"items": [
{ "title": "Settings", "route": "user_settings" },
{ "title": "Admin", "route": "admin" },
{ "title": "Logout", "route": "logout" }
]
}
]
}
]
}
}
}

Petar Korponaić

unread,
Nov 29, 2014, 7:32:07 PM11/29/14
to meteo...@googlegroups.com
When you generate and run this application, and when you register, your user account will have role "user" by default. To create first admin, in your mongo shell type:

db.users.update({ _id: "YOUR_USER_ID" }, { $set: { roles: ["admin"] } })

Mihai Frimu

unread,
Nov 29, 2014, 9:31:04 PM11/29/14
to meteo...@googlegroups.com
Thank you for the help!

I made 2 small donations today - when I have more money, I'll be able to donate more :) soon I hope.

PS: Somehow I find it faster to write the JSON than using the UI. I guess it is the copy & paste...

There was a little bug, in one instance the UI was generating something like "\"key:\"":"\"value\"" or similar... (I downloaded the JSON, I don't remember. Anyways one of the quotes was escaped. Next time I'll be more precise... :)

Mihai

Petar Korponaić

unread,
Nov 30, 2014, 5:05:00 AM11/30/14
to meteo...@googlegroups.com
Mihai, that's great, thank you very much! :)

GUI is in early state and is full of bugs - anyway, if you find some bug please report to "kitchen-site" repo: https://github.com/perak/kitchen-site/issues and I'l do my best.

Also, GUI is open-source so anyone can contribute ("kitchen-site" repository) - I'l try to find some time to write docs and make better code comments.

Thank you again!
Cheers!
- Petar

Petar Korponaić

unread,
Nov 30, 2014, 2:33:23 PM11/30/14
to meteo...@googlegroups.com
I just added new "official" example: application with multiple user roles and admin panelhttps://github.com/perak/kitchen-examples/tree/master/example-admin

Enjoy! :)


On Monday, August 4, 2014 8:51:22 PM UTC+2, Petar Korponaić wrote:

Mihai Frimu

unread,
Dec 1, 2014, 6:25:10 AM12/1/14
to meteo...@googlegroups.com
Hi Petar, 

Are you available for private work?

email-me

Thanks

Mihai Frimu

unread,
Dec 1, 2014, 8:50:33 AM12/1/14
to meteo...@googlegroups.com
The admin demo has a slight error:

both/router/controllers/admin/users/users_controller.js:24:40: Unexpected token ILLEGAL

24-> admin_users: Users.find({}, {sort:{\"profile.name\":1}})

removed the \ 's 

24-> admin_users: Users.find({}, {sort:{"profile.name":1}})

Thanks for the demo


On Sunday, November 30, 2014 2:33:23 PM UTC-5, Petar Korponaić wrote:

Petar Korponaić

unread,
Dec 1, 2014, 10:34:41 AM12/1/14
to meteo...@googlegroups.com
That error happens if you are using previous version of meteor-kitchen (that bug should be fixed in 0.9.4). What version are you using? 

--
You received this message because you are subscribed to a topic in the Google Groups "meteor-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/meteor-talk/zXgP7ddCdHk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to meteor-talk...@googlegroups.com.

Mihai Frimu

unread,
Dec 1, 2014, 11:11:23 AM12/1/14
to meteo...@googlegroups.com
0.9.3

Thanks !

Vincent Lamoly

unread,
Dec 2, 2014, 4:24:54 AM12/2/14
to meteo...@googlegroups.com
Hello Petar, 

Thank you for all your work. It really help. 

Perhaps I miss something but I do not understand how to modelize a master-detail relationship with an embedded document between 2 objects. 
I mean, for example, if I do not want to have a separate collection for adresses but instead I prefer them to be embedded into the customers document, how can I implement this in the json file please ? 

Thank you for your help, 

Cheers, 
Vincent

Vincent Lamoly

unread,
Dec 2, 2014, 4:26:38 AM12/2/14
to meteo...@googlegroups.com
Hello Petar, 

Thank you for all you work. It really help. 

Perhaps I miss something but I do not understand how to modelize embedded document. 
I mean for example if I do not want to have a separate collection for adresses but instead I prefer them to be embedded into the customers document, how can I implement this in the json file please ? 

Thank you for your help, 

Cheers, 
Vincent

Vincent Lamoly

unread,
Dec 2, 2014, 4:27:10 AM12/2/14
to meteo...@googlegroups.com
Sorry Mihai for the previous email


On Monday, December 1, 2014 8:11:23 PM UTC+4, Mihai Frimu wrote:

Petar Korponaić

unread,
Dec 2, 2014, 4:52:43 AM12/2/14
to meteo...@googlegroups.com
Hello Vincent,

Did you mean: how to generate CRUD with meteor-kitchen that reads/writes array embedded into document? 

If so, answer is: built-in components (such as form and dataview) are currently working only with top-level collections.

Feel free to open issue for that. 

BTW, is it enough if I add (into built-in form component) for fields of type "array", input list with add/remove functions? (So, in your case: in insert or edit customer form, for address field you'l have list showing addresses from "customerAddress" array with "Add address" button) ?

James Wilson

unread,
Dec 2, 2014, 12:49:21 PM12/2/14
to meteo...@googlegroups.com
I've tried several times over several days,

http://www.meteor-kitchen.com/ does not load for me.

Anyone know the status? Thank you

James Wilson

--
You received this message because you are subscribed to the Google Groups "meteor-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meteor-talk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meteor-talk/12878c2e-24e7-44c3-8af2-6c8b28950907%40googlegroups.com.

Petar Korponaić

unread,
Dec 2, 2014, 1:01:13 PM12/2/14
to meteo...@googlegroups.com
Hi James, it's: http://www.meteorkitchen.com (no dash) :)

In one of my previous posts I accidentally wrote it with dash, maybe that confuses you.

--
You received this message because you are subscribed to a topic in the Google Groups "meteor-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/meteor-talk/zXgP7ddCdHk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to meteor-talk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meteor-talk/CAPLk928tRtwW9dNj%3DBzed88dwZR61PeJUTrzEssg90VCSfHs3g%40mail.gmail.com.

Petar Korponaić

unread,
Dec 2, 2014, 4:08:30 PM12/2/14
to meteo...@googlegroups.com
Meteor Kitchen's database is now moved from production-db-a1.meteor.io to production-db-d1.meteor.io and now it's much faster.

Enjoy! :)
It is loading more messages.
0 new messages