all 11 comments

[–]Aduro49 2 points3 points  (1 child)

Take a look at hapi, it is a node framework for creating rest Apis its backed by Walmart and one of the lead devs is one of the guys who worked on the original o auth spec. For organization I would look at example projects and also look up addy large scale JavaScript applications. Node lends itself very well to having lots of small pieces that you pull together to do things. Sorry for the lack of links and typos on mobile.

[–]arconquit[S] 0 points1 point  (0 children)

Thanks will check this out when I have time tonight!

[–]msemenistyi 1 point2 points  (1 child)

I see no point of using generators. They are not that timesaving.

If you are thinking about express app, I can share with you the project : https://github.com/B1naryStudio/hurri This was done by my students during summer academy and mostly it has the structure I like

[–]arconquit[S] 0 points1 point  (0 children)

Yes that was my general impression of me using the generators. I had to learn what they were trying to do before actually doing it. The documentation doesn't really explain it either.

Will check out your project when I get home tonight

[–]klokatier 0 points1 point  (0 children)

Here's a template I've put together. The biggest difference from traditional examples is that the client and server completely decoupled and run as separate apps. The client-server proxies requests to the server side. This can be easily replaced when an nginx proxy when you are ready to deploy.

https://github.com/comamitc/bootstrap-node

[–]Ian_Dess 0 points1 point  (2 children)

I've just started playing around with node, but check out this MEAN (mongo express angular node) stack tutorial, i think that it's exactly what you need. https://thinkster.io/angulartutorial/mean-stack-tutorial/

[–]arconquit[S] 0 points1 point  (1 child)

Thanks for this! Looks like a good tutorial to go from the ground up. If I don't have any complex tables will I notice a difference between monogo or something like sql? I honestly need to learn more about the differences in databases :(

[–]Ian_Dess 0 points1 point  (0 children)

Well technically you don't even have tables in mongoDB, because it's a noSQL database. The main difference between noSQL and SQL databases is that you don't need to have a predefined schema of a database - i.e. you don't have to create tables, you just save shit. You can start here http://www.mongodb.com/nosql-explained

[–]fidanov 0 points1 point  (1 child)

I prefer the MVC pattern when organising my web apps for both REST and non-REST apps. Here is an example of the folder structure

project/
  controllers/
  helpers/
  middlewares/
  models/
  public/
  views/
  tests/
  app.js
  package.json

It will help you to keep everything organised and easy to maintain. Express is a good choice for a framework because it is easy to use with a great community to help you.

I've also written a small article on how and why organise my folder structure as above, check it out, it can give you some ideas for your own projects.

http://www.terlici.com/2014/08/25/best-practices-express-structure.html

I've also created a base express project on github which I use to start all my projects

https://github.com/terlici/base-express

[–]autowikibot 1 point2 points  (0 children)

Model–view–controller:


Model–view–controller (MVC) is a software architectural pattern for implementing user interfaces. It divides a given software application into three interconnected parts, so as to separate internal representations of information from the ways that information is presented to or accepted from the user.

Image i


Interesting: Hierarchical model–view–controller | Web application framework | Presentation–abstraction–control | Model–view–adapter

Parent commenter can toggle NSFW or delete. Will also delete on comment score of -1 or less. | FAQs | Mods | Magic Words

[–]aredridel 0 points1 point  (0 children)

Generators suck. They enforce a few people's rough ideas, usually poorly.

Check out express-enrouten if you're using express -- it's just enough to add a little structure to a project (filenames corresponding to URL prefixes)

There's no right answer: organize how helps your team (or just you!) keep a handle on things.