suggestions re what modules to use for specific project

29 views
Skip to first unread message

chr...@gmail.com

unread,
Mar 25, 2015, 7:20:21 AM3/25/15
to expre...@googlegroups.com
I have a project, let's say similar to instagram, users can register and browse images, add those images to their profile, also add information regarding those images linked solely to their relation with that image. Insert new images with specific characteristics linked to those images etc. Also all the bunch of stuff you can think of like commenting other peoples images, following people and so on. What modules would you use to accomplish this kind of behavior using express?
As I understand a route links to a page of your website for example, but what if I have to modify only one item on the page on the fly like with an ajax call? Or add some items to database etc? Sorry I am new to express I am trying to learn.

Petar Aleksic

unread,
Mar 28, 2015, 3:53:52 AM3/28/15
to expre...@googlegroups.com
AFAIK there is no such module that would enhance the complete behavior of your app you described, but there are a lot of modules that would ease the development process, the default, basic modules so to speak.

,...but what if I have to modify only one item on the page on the fly like with an ajax call? Or add some items to database etc? 

This is not problem at all. In client side, either with ajax, jquery, backbone etc you just send a request to your back end express app. Accordingly to the request, you can then undertake different actions and logics in express. (database update or similar).

Jason Crawford

unread,
Mar 28, 2015, 4:19:22 PM3/28/15
to expre...@googlegroups.com
Some things to think about:

* A database: Decide whether you want a traditional relational database (SQL), in which case you'll probably want PostgreSQL (or maybe MySQL); or a NoSQL database such as MongoDB. Then you'll need a module to access the database and probably give you a nice model-object-based interface to it. For Mongo, the official module is Mongoose.

* A templating library: You'll need to render HTML somehow. Handlebars is very popular. Here's an article comparing several of them: https://engineering.linkedin.com/frontend/client-side-templating-throwdown-mustache-handlebars-dustjs-and-more

* A client-side framework: For instance, Backbone. Also popular are Angular and Ember. Lots more listed at http://todomvc.com

* User authentication: There is a good module that helps with this called Passport. It helps you do email/password signup, and also authenticate with third-party services like Facebook or Twitter.

There are lots of other modules that will probably end up being useful. For instance, if you need to storing images, you might want to put them in Amazon S3. For that, you'll want an S3 module. In the end your app will use dozens of modules.

There's a lot to learn here; you might want to get a book on the topic. There are entire book that walk you through how to build an app with Express—great for beginners.

Hope that helps; I didn't dig up links for most of the above but you can easily find them by searching.

Best of luck,
Jason

--
Blog: http://blog.jasoncrawford.org  |  Twitter: @jasoncrawford



On Wed, Mar 25, 2015 at 4:08 AM, <chr...@gmail.com> wrote:
I have a project, let's say similar to instagram, users can register and browse images, add those images to their profile, also add information regarding those images linked solely to their relation with that image. Insert new images with specific characteristics linked to those images etc. Also all the bunch of stuff you can think of like commenting other peoples images, following people and so on. What modules would you use to accomplish this kind of behavior using express?
As I understand a route links to a page of your website for example, but what if I have to modify only one item on the page on the fly like with an ajax call? Or add some items to database etc? Sorry I am new to express I am trying to learn.

--
You received this message because you are subscribed to the Google Groups "Express" group.
To unsubscribe from this group and stop receiving emails from it, send an email to express-js+...@googlegroups.com.
To post to this group, send email to expre...@googlegroups.com.
Visit this group at http://groups.google.com/group/express-js.
For more options, visit https://groups.google.com/d/optout.

deitch

unread,
Mar 29, 2015, 12:16:03 PM3/29/15
to expre...@googlegroups.com
Jason pretty much hit it. The first thing you need to decide is if you are doing server-side templating (like Handlebars, as Jason suggested) or a single page app, i.e. all templating on the client side and only static loads of assets (html, js, css, img) from the server plus REST Ajax requests. If the latter - which is how I build most of my stuff nowadays - you would need a real client-side framework. I have gone through many, latest project is in Angular (1.x) but looking at Polymer for the next one.

If you do Ajax calls, you need to decide if it is mostly HTML templates server-side, in which case just manually wire up a few calls with 

app.get('/path',handler1,handler2,...,handlern)


On the other hand, if there will be a large number of API calls, like with a single page app or iOS or Android app that will consume an API, then you want some kind of REST framework. I wasn't satisfied with what I saw and wrote booster http://github.com/deitch/booster on my 2nd to last project. 

In any case, the first things you need to decide are:

  • Data model
  • Server-client interaction model - server-side template rendering vs single-page-app+API
Once you have those, you can pull in modules and use them at will. 

Jason Crawford

unread,
Mar 29, 2015, 1:04:31 PM3/29/15
to expre...@googlegroups.com
Actually, for what it's worth, Handlebars works on both server and client, which is one reason I chose it for a recent project.

-Jason

deitch

unread,
Mar 29, 2015, 1:05:48 PM3/29/15
to expre...@googlegroups.com
Actually, that is worth quite a bit. Good point!

deitch

unread,
Mar 29, 2015, 1:06:17 PM3/29/15
to expre...@googlegroups.com
I used to do a lot of templating client-side, but really have taken too much of a liking to Angular-style 2-way binding. :-)
Reply all
Reply to author
Forward
0 new messages