Super simple Meteor app
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I want to learn Meteor and a simple example application would help me get started. I'd like the code for the following database-backed 'commenting' app:

-The app should simply display a list of comments, and lets anonymous users leave their own.

-Main/index page: Displays every Comment created so far (each with a link to the comment's page). Underneath the comments, there should be a text field where one can enter a comment. Upon entering a comment and hitting 'Enter', the browser should update the comments list via Ajax.

-Page for each 'comment': should show the Comment's contents and date of creation.

-Users should not be able to destroy existing comments via the terminal!

Thanks for your help!

Yes, MongoDB is fine
bevan over 8 years ago
I don't think that a separate page for each comment is possible see this, but I will try to devise a workaround for that.
alex over 8 years ago
awarded to alex

Crowdsource coding tasks.

2 Solutions

Winning solution

I'm not really sure how I was supposed to package the scripts, so I just zipped the three files commentr.html, commentr.css, and commentr.js. The files are available to download here.

If you didn't get my comment on multiple pages, it is impossible to create another page to display the comment separeately, so I just made one page with all the data on it, and when you hover over an comment, all the other comments will become less apparent.

Install Instructions
  1. Open Terminal
  2. Install/Update Meteor using this command curl install.meteor.com | sh
  3. Create the project using this command meteor create ~/commentr
  4. Replace the files in ~/commentr with the ones from the zip (link above)
  5. Change your directory to ~commentr in Terminal (cd ~/commentr)
  6. Execute Meteor using the command meteor
Change Log
  1. Added visible submit button for form
Thanks for researching the multiple pages issue, I wasn't aware of that!
bevan over 8 years ago
Just tested it out. It seems to work except for one thing: when I hit Enter when focused in the 'name' field, it doesn't seem to do anything (there is no terminal output, and nothing happens onscreen ). I can create new records manually via the terminal and they appear nicely, but I can't seem to enter them through the form. Could you check it still works on your end with Meteor 0.4.0? Cheers!
bevan over 8 years ago
Just tried it in Firefox and it works, was using Chrome before. Good enough for my purposes!
bevan over 8 years ago
I just uploaded a new version, and there should be a submit button to the right of the name form.
alex over 8 years ago

This weekend (at Startup Weekend Groningen), me and a team of 7 other developers built a Meteor based mobile web game called 42seconds. You can see it at www.fortytwoapp.com. We've open sourced the source code at https://github.com/jellea/42seconds

It was sometimes a bit hard to find answers because Meteor is so new but with some guys on board who had some node.js knowledge, we got it working. We're still working out some bugs (right now you're not able to advance to round 2) but that should be fixed this week. In the meantime, happy code reading!

View Timeline