
Show HN: Scaffold App for Node.js, Express, Jade, Passport, MongoDB, Bootstrap - rodrigogs
https://github.com/rodrigogs/nodejs-web-jade-scaffold
======
danneu
I have a scaffold for Node + Koa (microframework) + Postgres + Twitter
Bootstrap + Nunjucks (templating):

\- Demo: [https://koa-skeleton.danneu.com/](https://koa-skeleton.danneu.com/)

\- Source: [https://github.com/danneu/koa-
skeleton](https://github.com/danneu/koa-skeleton)

~~~
pacomerh
Curious to see why you recommend Koa vs Express?. Looks simpler at first but
if you can elaborate that would be great.

~~~
Killswitch
Koa is the successor of Express, written by Express creator, TJ. I like it
because generator workflow makes writing apps better since we can yield
promises. Code is much cleaner.

    
    
      app.get('/', function * () {
        this.body = yield User.all()
      })
    

vs

    
    
      app.get('/', function (req, res) {
        User.all(function (err, users) {
          if (err) throw err
          res.end(users)
        })
      })

~~~
joepie91_
You can use promises in Express just fine, though. Especially with `express-
promise-router`. Not really fair to compare it to nodeback code in Express :)

------
stesch
People are still using MongoDB for new projects after all the negative
articles and comments about it?

~~~
rodrigogs
Ok then... Install your heavy SQL database on your super fast machine and use
it for everything till your memory screams.

I'm not saying SQL databases are bad. It's just... They are not the only
choice! You should be happy that now we have tons of alternatives to choose.

~~~
smt88
1\. SQLite isn't heavy. There are probably even lighter-weight relational
solutions, but I haven't needed one, so I haven't looked.

2\. Even among non-relational document storage solutions, Mongo has a poor
reputation. As someone else says elsewhere in the comments, it's hard to trust
a team that let so many ridiculously dangerous bugs (and a basically
unreliable design) out into production for so long.

~~~
bpatrianakos
No SQLite isn't heavy but I hope you mean for use in development only.

The issue isn't MongoDB is bad and relational DBs are awesome. The real issue
is new developers being taught that Mongo and NoSQL in general are the
databases you should be using with Node. The problem secondary to that is devs
not knowing when each is appropriate.

~~~
cdcarter
SQLite is the most widely deployed database engine out there.

~~~
coderdude
Not in production it isn't.

~~~
muzmath
It's actually commonly used in production for certain types of databases.
SQLite is not a replacement for something such as postgresql but it certainly
has it's use cases.

~~~
coderdude
Do you mean for public facing sites? If so, what are the use cases?

~~~
muzmath
The use case for SQLite isn't high traffic public facing webpages. Here is
their own list of 'famous' users:
[https://www.sqlite.org/famous.html](https://www.sqlite.org/famous.html)

Every iPhone, and Android phone have SQLite running on them, which easily
makes it the most used production database. It's use case is typically very
low traffic websites or as client side storage.

~~~
coderdude
Maybe I'm missing something but is Mongo in use on the client side in that
same way? If not then SQLlite is being shoehorned into the discussion and the
context in which production was used should be clear. I feel like people are
trying to be technically right instead of following the actual discussion. I
never meant client side software and definitely didn't mean someone's micro
traffic blog, where a toy database could be used.

It is interesting how much penetration SQLlite has on the client, though.

At any rate, I know better than to not be extremely specific so I brought this
on myself.

~~~
muzmath
The only reason I brought it up is that there is a myth that many developers
believe SQLlite is only useful as a dev enviroment database

~~~
collyw
On a multiuser system, that's a reasonable assumption.

~~~
muzmath
That's partially true, but it does seem to find it's way in production on lots
of low traffic sites.

------
nemild
You might enjoy the Hackathon Starter: [https://github.com/sahat/hackathon-
starter](https://github.com/sahat/hackathon-starter)

It has much more middleware, but is easy to strip down, based on what you're
building. It also has a CLI tool for some basic config.

~~~
sheraz
Funny, I was just using the same thing for django here -
[https://github.com/DrkSephy/django-hackathon-
starter](https://github.com/DrkSephy/django-hackathon-starter)

------
brudgers
This would make a good "Show HN". Reposting with "Show HN: " in the title will
make it appear there.

~~~
rodrigogs
Thanks, dude!

------
jonesb6
A word of advice on passport. Don't just throw it in there and not learn
anything about it. It's a really crafty middleware/library that is intended to
be customized/extended. If you write your own strategies (after looking up the
mainstream ones for reference) it'll give you a lot more power in terms of you
authentication/authorization schemes.

I think that can be said about most products of scaffolds. If you intend to
use this you should learn at least a little about
node/express/jade/mongo/bootstrap as well. I feel a lot of people don't I know
I didn't when I started web dev (I'm looking at you RoR).

------
bahmutov
Take a look at [https://github.com/bahmutov/PE-N-
starter](https://github.com/bahmutov/PE-N-starter) \- PouchDB (which later can
proxy to CouchDB), Express and Node. Much better DB and no locking you to any
rendering framework. Comes with GitHub integration plugin. Demo at [http://pe-
n-starter.herokuapp.com/](http://pe-n-starter.herokuapp.com/)

------
zappo2938
I'm trying to remember the WTF moment I had with working with MongoDB, there
were a few. I think it was not being able to do an atomic create or update
operation across a collection of documents.

------
awjr
One minor critique. You don't appear to have any tests.

~~~
rodrigogs
Added to TODO list. Although you guys are free to fork and do it :P

