Starting up a node.js project - html

I'm about to start a project that's going to be a web site for storing photos. The method for uploading shall be drag and drop (from the desktop, same as Imgur), and it shall be possible to rate the photos as well commenting them.
For the project I'm going to use Node.js as well as HTML5, CSS3 and jQuery. The thing is that I'm a total newbie on Node.js and really could use some help regarding getting started. For the project I will of course need a database, and I have understood that MongoDB is a good choice. Is there any templates for this combination, so that I don't need to start from scratch?
I have installed Node.js and followed some tutorials but I really feel that I want to a template if there is one.
Thanks in advance!

As you said you are a beginner you can take the best independent modules for your project and start using. Instead of having a pre-defined package of necessary components as a single module. Problem is you may end up not understanding the whole pack and become more biased.
So,
I would suggest to use Expressjs (Best Choice) for url routing as mentioned above.
And,
File upload management:
formidable - a high performance file upload server with file parts reading and progress notifiers etc.
Template Engine (Markup libs for your custom htmls):
Jade
coffeekup
And consider Bootstrap as well for prebuilt templates if in case you need it.
Mongo - Good choice.
Mongo Modules
These libs should help.

Take a look at HTML5 Boilerplate + Express.js

As a basic starting point, this is a popular framework:
http://expressjs.com/
Here you will find some links to example applications:
Node.js Web Application examples/tutorials
https://github.com/heroku/facebook-template-nodejs
Open Source Node.js (and Express) projects

Express JS is good but I would recommend you have a look at Railway JS as well.
It is based on Express with support for numerous template engines and database adapters (including MongoDB). It is a lot more modular so you should not have much trouble working with it (in my opinion).
Check out: Uploading images using Node.js, Express, and Mongoose too.

Here is a list of resources that I have compiled using themeefy to start a node.js project http://www.themeefy.com/AvinashEga2/nodejs

I think Tower.js is something like what you're after.

Related

Best practise for updating / managing HTML pages

I am developing an e-commerce website as part of an assignment and am wondering what is the best practise for updating a collection of webpages.
I currently have one index.html page for the news etc. and then I copied and pasted the file and edited as i needed for the shopping cart functionality.
My question is; if I need to update something on the index.html file and which that change to show in all the pages, is there an easy / convenient way to update all of the pages together if I have a large amount instead of updating them manually one by one?
This is where the rubber meets the road for most developers. Now you are seeing a need to update something once and have that change propagate out to some / elements / pages. This is where making things "dynamic" and "modular" start to make sense and is the very reason server side scripting languages such as PHP were created. This in addition to a database such as mysql can create powerful, data driven websites and applications. HTML is just markup, all sites use it, but it by itself isn't able to take advantage of the benefits of being a dynamic language.
A great place to start looking for a content management system is by using something that has a lot of support / community behind it to help with the questions you will have along the way. It is also a good place to ease in to dynamic languages like php. I suggest using something like wordpress (wordpress.org) to get started. It handles most / all of the heavy lifting in regards to structure and all you really need to do is worry about the presentation of your site (themes). You'll only need something like MAMP (for mac) or XAMMP (for win) in order to make a local server (php / mysql) so you can install wordpress. There is a TON of resources and tutorials, plugins, themes, community support.
Edit :
Since you are limited to the client side. Alternatively, if you know javascript, you could look into a javascript MVC framework and use client side templates like handlebars, .EJS etc.
Good luck & Happy Coding!

Server Side Rendering/Templating

We are going to create some applications that will access the same api. We decided that the backed part will be developed in node.js and the database will be MySQL and maybe some parts mongoDB.
I have problem deciding about the front end of the web application that will be a website. Taking a look on this question: Separate REST JSON API server and client? we decided that fits better to us server side templating/rendering.
Do you think that using a PHP framework (like symfony, laravel etc) only for templating is good solution, or is it stupid to use a complete framework that offers a lot of features that we are not going to use only for templating? I was thinking to use twig that is only a template engine and try to fit backbone on it just to structure better the ajax calls to the RESTful API.
Do you have something different to suggest for server side rendering?
I have no experience at all, thats why i am writing to prevent taking bad decisions.
There are a bunch of awesome templating options for Node.JS! Here's a small list of some that I've used:
hogan (by twitter, feels like mustache)
jade (by tjholowaychuk, same code-machine behind express and a bunch of other awesome node projects)
ginger (by yours truly!)
swig (my personal favourite right now)
ejs (simple javascript-in-html thing, feels like php)
I like swig right now. It's basically what I wanted to build when I was working on ginger. It looks and feels a lot like django's templating system, which many popular template languages (twig, for example) have been inspired by.

Working with MySQL and Xcode

I've been programing for some time now, and the thing I get asked the most is, how about MySQL database.
What are some good sites for learning about data base programing with xcode, so I can make a app work together with a web site?
To integrate an iPhone/iPad application with mysql you need to develop webservices and then call them in your app. I would suggest the use of JSON, SOAP, XML or PHP, some examples:
http://www.raywenderlich.com/2941/how-to-write-a-simple-phpmysql-web-service-for-an-ios-app
http://www.icodeblog.com/2008/11/03/iphone-programming-tutorial-intro-to-soap-web-services/
http://www.devx.com/wireless/Article/43209
There are a lot of combinations possible.... you can use php or .net or other frameworks, so it's hard to give you a complete list of tutorials.
If you want to develop a regular iOS application, i would suggest this link:
http://blog.iosplace.com/?p=30
Hope it helps.

fastest public web app framework for quick DB apps?

I'd like to pick up a new tech for my toolbox - something for rapid prototyping of web apps. Brief requirements:
public access (not hosted on my machine) - like Google's appengine, etc
no tricky configuration necessary to build a simple web app host
DB access (small storage provided) including some kind of SQLish query language
easy front end HTML templating
ability to access as a JSON service
C# or Java,PHP or Python - or a fun new language to learn is OK
free!
An example app, very simple: render an AJAXy editable (add/delete/edit/drag) list of rich-data list items via some template language, so I can quickly mock up a UI for a client. ie. I can do most of the work client-side, but need convenient back end to handle the permanent storage. (In fact I suppose it doesn't even need HTML templating if I can directly access a DB via AJAX calls.)
I realize this is a bit vague but am wondering if anyone has recommendations. A Rails host might be best for this (but probably not free) or maybe App Engine, or some other choice I'm not aware of? I've been doing everything with heavyweight servers (ASP.NET etc) for so long that I'm just not up on the latest...
Thanks - I'll follow up on comments if this isn't clear enough :)
C# or Java,PHP or Python - or a fun new language to learn is OK
How 'bout Javascript? This place hosts server-side Javascript ticking most of your other boxes. So you can use the same language for client- and server-side stuff (which I find very handy). [Caveat: I only played with their service; seemed cool though. I use Javascript on the server-side on IIS and on Tomcat (via Rhino).]
For something bleeding edge - A new version of spring roo was released recently. With it you can create a great web app in 10 minutes. Supports GAE and GWT...
http://www.springsource.org/roo
xataface is a quick way to make a front end for a MySQL database.
It makes it easy to start an app quickly with dynamically created views and then you can change it to something very customized to your needs.
It simply needs a server service with MySQL and PHP.

Is there a working Cocoa MySQL Xcode project?

Or has this been abandoned? I can't seem to find a modern sample project. I haven't been able to make any the old code I find work. I just want to write a simple Mac app that accesses an external MySQL database that's also involved in a PHP website.
The old CocoaMySQL project has been abandoned, but the project has been resurrected as Sequel Pro.
It's open source and you can get the source code here.
If you want a straight library that allows you to access MySQL, you might try the commercial MacSQL framework.
You can also just use the MySQL C API directly, however be careful because if you want to use this in a commercial app the licensing fees are high.
You might find it easier to write some PHP code on the server to deliver the results to your client using JSON or some other lightweight data interchange format. PHP has direct support for JSON and there is a great Cocoa framework that makes it easy to parse and generate JSON code.
This method allows you to completely abstract the database connection from your client, so it is relatively trivial to change the database if necessary in future.
Thanks, Rob, I have actually seen the links to Sequel Pro but I was confused when I got there. Part of my problem is that I am really bad at adding things to an Xcode project. Once I have a project in hand with the correct libraries and whatever all linked up, I can make use of the various methods or functions.
That's why I was asking if someone had a super simple project using MySQL that would hopefully compile for me right out of the box. I can then add all my objects and coding.
Can't seem to find anyone out there willing to hold the hand of us project-challenged. The project settings dialog box and codes that go in various boxes therein are very confusing to me.