
Show HN: Open-source StackOverflow-like service - yoshiokatsuneo
http://paizaqa.herokuapp.com
======
anton_gogolev
Kudos for effort, but for the life of me I cannot understand why the hell is
"load empty shell of a page and then asynchronously fetch bits and pieces of
content, ruining the UI along the way" is so prevalent these days.

~~~
dkopi
That's how a basic angular.js app with client side templating works if it has
to fetch the the data from the server using AJAX calls.

A common optimization would be to preload the served javascript with the
initial AJAX results. This still means rendering the content on the client
side, but the content isn't fetched asynchronously. Another optimization is to
actually render all the DOM elements in advance on the server, and only use
client side rendering for updates.

~~~
anton_gogolev
This, I assume, is all done because 99% of web sites are trivially done with
server-side HTML generation and that is not hipstery enough.

~~~
mason55
It's not a matter of being "hipstery", the drawback is that each time you
refresh the view you have to resend all the markup. You're increasing the
total amount of data that's going back and forth between the browser and the
server. By sending the markup once and then dynamically populating it you can
have much faster transitions between objects that use the same view.

What you really want to do is provide progressive enhancement where the first
thing a user sees is usable and then more features become available without
disrupting whatever the user has started doing (e.g. don't reflow the page
while they're trying to read or browse). One way to achieve this is rendering
the initial view on the server side and then doing updates via AJAX request
but this has meant writing your rendering code twice, once on the server side
and once on the client side. This is a reason that node.js and isomorphic
JavaScript in general have become so popular.

~~~
anton_gogolev
Oh give me a break.

> ...the drawback is that each time you refresh the view you have to resend
> all the markup. You're increasing the total amount of data that's going back
> and forth between the browser and the server.

For like 99.9% of applications this is a non-issue. For crying out loud,
StackOverflow itself has been doing server-side rendering since day one and is
still heaps and bounds more usable than WhateverTheHellIsTrendingOnHn.js-based
single page isomorphic rich web applications.

It might be my age showing, but, while completely agreeing with you on
"progressive enhancement all the way", I find that too freakin' much resources
nowadays are spent doing and re-doing and re-inventing something that was
working fine in the first place.

~~~
spiderfarmer
I completely agree. I settled on using sockets.io for the small pieces of my
website that can benefit from the realtime aspect of Angular and friends. It's
shocking how little code you need to make an awesome 'modern' website. All
pages load in under 200ms on first load and I can mostly stick to what I know.

------
yoshiokatsuneo
And, how to make it is available here:

Building a QA web service in an hour - MEAN stack development(3)

[http://engineering.paiza.io/entry/2016/03/10/115345](http://engineering.paiza.io/entry/2016/03/10/115345)

------
omegote
The article is missing what I think is one of the most important parts, and
that's the reasoning behind using a MEAN stack instead of a more classic
approach using a standard back-end language like Ruby, Perl or Python, because
I honestly fail to see how this is easier than using a framework like Django
or RoR.

~~~
yoshiokatsuneo
Thank you for your feedback!

For me, the most important part is the language. I can use JavaScript for
client side, server side, and database. There is no context switching related
to language like Ruby, JavaScript, SQL. (And, the way of thinking related to
that like asynchronous and synchronous.)

It is especially helpful for startup or prototyping where small team build
everything.

~~~
plugnburn
Then you should definitely give a try to Meteor framework
([https://www.meteor.com/](https://www.meteor.com/)). Using it, we have built
and run a production-ready service + Android app for a local flower shop
delivery-messengers in about 5 days.

------
rallende
Askbot ([https://askbot.com](https://askbot.com)) is also open source and you
can create you QA forum "in a minute" (sic).

No seriously, the askbot guys have been for a long time on the field, great
app.

~~~
blackoil
they have there source code pretty well hidden, can't find any link to source
on Home / Developers / Contact page. So they may no longer want it to be open
source.

~~~
rallende
[https://github.com/ASKBOT/askbot-devel](https://github.com/ASKBOT/askbot-
devel) askbot creators believe that if someone does not know to google askbot
source code he shouldnt get the code :)

------
mkesper
StackOverflow has already often served me but sometimes I think what we really
need would be some place where some people fluent in languages/frameworks
could showcase best practices/mini howtos giving a little bit more context.

~~~
ChrisDutrow
More than half the questions I ask on there are not "How do I do something",
but "How do I do something WELL"

------
manu29d
I've been procrastinating a long time to write an article similar to this.
I've been using the generator since v1.x.x. Nice write up!

I even wrote a rails console-like equivalent for the older version[1]. Didn't
get time to write a new one though. Will be a good addition to the generator I
think.

[1]:
[https://gist.github.com/manu29d/ced4a558abf2fa654bff](https://gist.github.com/manu29d/ced4a558abf2fa654bff)

------
Animats
The problem isn't displaying the pages. It's the rating and asshole management
system for the questions and replies. How does that work?

------
orrinward
I think you mean "Q & A" and QA. QA = "Quality Assurance".

~~~
yoshiokatsuneo
Thank you for pointing out! I just changed the article's "QA" to "Q&A". Now,
the title is:

Building a Q&A web service in an hour - MEAN stack development(3)
[http://engineering.paiza.io/entry/2016/03/10/115345](http://engineering.paiza.io/entry/2016/03/10/115345)

------
listic
Isn't StackOverflow open source?

~~~
a3_nm
User content is under a free license (and dumps are provided), but the engine
is proprietary.

------
dionidium
Technical improvements were only one part of what made SO great. If you want
to compete with them, then you have to figure out how to prevent posts like
this one from lasting more than 5 seconds on the site:

[http://paizaqa.herokuapp.com/questions/show/56e1a5872c8dfa03...](http://paizaqa.herokuapp.com/questions/show/56e1a5872c8dfa03007cc6d7)

------
henrygrew
we have osqa [http://www.dzonesoftware.com/products/open-source-
question-a...](http://www.dzonesoftware.com/products/open-source-question-
answer-software)

------
r0m4n0
Clicking "ask question" kills the browser back button... Beware!

~~~
yoshiokatsuneo
Thank you for your pointing out ! I just fixed it by adding
"$location.replace()".

Also, there was a issue on Social Login, I also fixed the issue.

~~~
r0m4n0
Awesome! Cool concept btw

------
plugnburn
What's the real issue is:

<navbar></navbar>

Do you even know that this is invalid and the proper tag is called just <nav>?
Do you know that <title> must not be empty in the initial page? Do you know
that custom attributes must start with data- (not ng- or ui-)?

Did you even check your page with
[http://validator.w3.org](http://validator.w3.org)?

~~~
plugnburn
Care to explain why this was downvoted?

I honestly don't understand how did the authors manage to make a skeleton (!)
page not passing validation. Even <title> is empty when it must not be so.

Is it because of Angular? Well, if a framework forces you to write invalid
HTML (tags, attributes, whatever), it sucks, no matter what.

------
fiatjaf
I don't understand Ruby. Is there an easy guide for deploying to Heroku?

