These are chat archives for quorrajs/quorrajs

1st
Jun 2016
Niall O'Brien
@niallobrien
Jun 01 2016 00:03 UTC
Hi all, just wondering what makes Quorra a better choice than Sails for example? Thanks.
erkan1991
@erkan1991
Jun 01 2016 04:24 UTC
Screen Shot 2016-06-01 at 2.23.02 PM.png
Hi all, has anyone had this issue ?
Harish
@harishanchu
Jun 01 2016 05:25 UTC

yes, you are right @oliworx

its because of wrong model configuration

email field should be like:

    email: {
        required: true,
        email: true,
        type: 'string'
    }

or

    email: {
        required: true,
        type: 'email'
    }
I will update the User model.. Thanks
Harish
@harishanchu
Jun 01 2016 05:30 UTC
@oliworx My mysql schema I posted above is not based on any standard. I just created it to test sails-mysql. As you said there is no need to keep remember_token field as not null
Harish
@harishanchu
Jun 01 2016 05:43 UTC
@erkan1991 Are you sure psql server is running on your machine
Could you please try to connect to psql server from terminal and see if that works?
Oliver Kurmis
@oliworx
Jun 01 2016 07:25 UTC
@harishanchu but why is your remember token a int(100) ?
Harish
@harishanchu
Jun 01 2016 08:34 UTC
@oliworx as I said I just created user table to test sails-mysql
remember_token column should be varchar(60)
Also there was an error in remember_token generation.. the length was wrong, which I have fixed and published.
Niall O'Brien
@niallobrien
Jun 01 2016 08:43 UTC
Hi all, what's the main difference between Quorra and Sails?
Harish
@harishanchu
Jun 01 2016 08:54 UTC
Quorra have different request processing architecture
you can read about how quorra functions from the doc: https://quorrajs.org/docs/v1/getting-started/request-lifecycle.html
Sails is built on top of express
and it functions with some kind of hook based architecure
I have used sails in some of my projects and I felt it like a hack over express
its not easy to understand what really going on behind sails
control flow and all
but with quorra its very trasnparent.. everythign is in control
Harish
@harishanchu
Jun 01 2016 09:09 UTC
unlike other frameworks quorra uses javascript prototype pattern in most of its code base
hence code looks cleaner and its more maintainable
We are also concerned about application performance
Quorra got a better application performance
Niall O'Brien
@niallobrien
Jun 01 2016 09:18 UTC
Interesting, are there any benchmarks?
Harish
@harishanchu
Jun 01 2016 09:19 UTC
once I ran perfomance test with apache benchmark.. and I found quorra perfroms better
I don't remember the figures
but its very easy to test with apache benchamark
command ab -t 10 -c 10 <applicaiton url> will instruct Apache Benchmark to run for 10 seconds with 10 concurrent requests happening.
Harish
@harishanchu
Jun 01 2016 09:29 UTC
Please see the rough test results:
Quorra:
Screenshot from 2016-06-01 02:58:37.png
sails:
Screenshot from 2016-06-01 02:59:22.png
Please note that I just ran this tests on a new installation of quorra and sails

I haven't done any configurations other than changing the conents of landing route(/) to:

res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World');

so actual results may vary on both frameworks after configurations and perfromance optimzations
Niall O'Brien
@niallobrien
Jun 01 2016 09:37 UTC
ab.jpg
For comparison, here’s a regular Express app with some usual middleware loaded.
I don’t know how Quorra handled more reqs in the same time.
@harishanchu Interesting though.
Harish
@harishanchu
Jun 01 2016 09:40 UTC
yup
Niall O'Brien
@niallobrien
Jun 01 2016 09:41 UTC
How do I retrieve old data from the session in a view?
Harish
@harishanchu
Jun 01 2016 09:42 UTC
I will do a detailed performance comparison once after we release our first stable version
Niall O'Brien
@niallobrien
Jun 01 2016 09:42 UTC
:+1:
Harish
@harishanchu
Jun 01 2016 09:43 UTC
you have to configure session first: https://quorrajs.org/docs/v1/middlewares/session.html
You can get old data by flashing data to session
Niall O'Brien
@niallobrien
Jun 01 2016 09:43 UTC
So I always specify the key & value?
Harish
@harishanchu
Jun 01 2016 09:46 UTC
yes, but for input data there are other methods: https://quorrajs.org/docs/v1/getting-started/requests-&-input.html#old-input
much handy
Niall O'Brien
@niallobrien
Jun 01 2016 09:46 UTC
How do I access that in a view?
Or do I have to flash it?
eg. req.session.flash(‘oldUsername', req.input.old('username’))
Is that right?
Harish
@harishanchu
Jun 01 2016 09:50 UTC
nope
when you do req.input.flash(); all input data is already in flash
that can be accessd later with req.input.old('username');
Niall O'Brien
@niallobrien
Jun 01 2016 09:52 UTC
Ok, but how do I access that in a view?
as username?
Harish
@harishanchu
Jun 01 2016 09:52 UTC
basically methods req.input.flash and req.session.flash does the same thing
it depends on template system you use
you have to call method req.input.old('username'); from the view to retrieve it
for that you may pass the req.input object to your view as view option or through res.locals
or you may retrieve the value from route and pass the value to the view
Niall O'Brien
@niallobrien
Jun 01 2016 09:54 UTC
It would be nice if old session data was automatically exposed to the views
Also, the same for validation errors.
Harish
@harishanchu
Jun 01 2016 09:55 UTC
Good suggestion. I will note it down
hey, I gotta go now.. will get back later
Niall O'Brien
@niallobrien
Jun 01 2016 09:55 UTC
So, if using Jade/Pug I could do
if errors
  …
  etc.
Niall O'Brien
@niallobrien
Jun 01 2016 10:27 UTC
It would be nice if we moved to ES6 syntax
Harish
@harishanchu
Jun 01 2016 10:29 UTC
Yup.
Code base is written in es5
Niall O'Brien
@niallobrien
Jun 01 2016 10:29 UTC
Is it just you working on it @harishanchu?
Harish
@harishanchu
Jun 01 2016 10:30 UTC
Even though it uses es5 in codebase users can use es 6 code on their app
In routes n all
Niall O'Brien
@niallobrien
Jun 01 2016 10:30 UTC
Agreed, maybe a good place to start is by updating the initial generated app code.
Harish
@harishanchu
Jun 01 2016 10:31 UTC
Yes.
Yes it's me working on quorra
Niall O'Brien
@niallobrien
Jun 01 2016 10:31 UTC
You’ve done a great job!
Harish
@harishanchu
Jun 01 2016 10:31 UTC
Started this as my side project
Thank you 😃
Niall O'Brien
@niallobrien
Jun 01 2016 10:32 UTC
I wish I had more experience to help more.
Harish
@harishanchu
Jun 01 2016 10:33 UTC
My friend @nikhilben is also helping me with some of the things
Hey thanks for showing interest in this
Niall O'Brien
@niallobrien
Jun 01 2016 10:34 UTC
No problem. I’m currently using Express & Mongoose, but I like fullstack frameworks :)
Harish
@harishanchu
Jun 01 2016 10:35 UTC
:+1:
Niall O'Brien
@niallobrien
Jun 01 2016 10:36 UTC
Might be good to update Jade to Pug also.
What future plans do you have for Quorra?
Harish
@harishanchu
Jun 01 2016 10:44 UTC
Yes
There is already an issue registered for this in github
There are lot of things to be done before first stable release
Niall O'Brien
@niallobrien
Jun 01 2016 10:45 UTC
Is there a list?
Harish
@harishanchu
Jun 01 2016 10:46 UTC
There is no public list yet
Niall O'Brien
@niallobrien
Jun 01 2016 10:46 UTC
I would help if I could.
Harish
@harishanchu
Jun 01 2016 10:46 UTC
Yes, will do once this is stable
I have to create a service loading strategy
Now everything is loaded in a flat file in order during server lift
Niall O'Brien
@niallobrien
Jun 01 2016 10:47 UTC
Oh, services will be nice! :)
Harish
@harishanchu
Jun 01 2016 10:49 UTC
I'm tryingto implement application testing now
need to document how to test application
after that I have to upgrade outdated dependecies
Niall O'Brien
@niallobrien
Jun 01 2016 10:49 UTC
Awesome, Ava looks nice - https://github.com/avajs/ava
Harish
@harishanchu
Jun 01 2016 10:50 UTC
I have already done this
Niall O'Brien
@niallobrien
Jun 01 2016 10:50 UTC
What do you mean?
Harish
@harishanchu
Jun 01 2016 10:50 UTC
I configured quorra to use mocah + should
Niall O'Brien
@niallobrien
Jun 01 2016 10:50 UTC
Ah
Harish
@harishanchu
Jun 01 2016 10:50 UTC
its already there
I have to write docs
there is a sample test defined in quorra
Niall O'Brien
@niallobrien
Jun 01 2016 10:51 UTC
I might try build a simple app with Quorra and log issues/suggestions as I go along. What do you think?
Harish
@harishanchu
Jun 01 2016 10:52 UTC
you can run tests now itself with npm test from quorra project root
Niall O'Brien
@niallobrien
Jun 01 2016 10:55 UTC
Does Quorra use Express?
Niall O'Brien
@niallobrien
Jun 01 2016 11:03 UTC
@erkan1991 It looks like Postgres isn’t running
Harish
@harishanchu
Jun 01 2016 11:07 UTC
Nope.. it donot use express
Niall O'Brien
@niallobrien
Jun 01 2016 11:08 UTC
Ok, so I cannot use Express middleware such as Passport for social logins? :(
Harish
@harishanchu
Jun 01 2016 11:08 UTC
I have used express's request and response helper methods in quorra
Niall O'Brien
@niallobrien
Jun 01 2016 11:09 UTC
Not sure how I’d do social logins so.
Harish
@harishanchu
Jun 01 2016 11:10 UTC
It's not a big deal
Niall O'Brien
@niallobrien
Jun 01 2016 11:11 UTC
How so?
Harish
@harishanchu
Jun 01 2016 11:11 UTC
You can do some wraparound express middlewares to make it work for quorra
In fact quorra already uses some middlewares like such
G
For example body-parser
Please c quorra middlewares documentation to understand how to write middlewares for quorra
Niall O'Brien
@niallobrien
Jun 01 2016 11:14 UTC
Ok, so I’ve to write my own middleware?
Looking at BodyParserMiddleware.js now
quorra uses prototype pattern for middleware too
gives some standard and structure
Niall O'Brien
@niallobrien
Jun 01 2016 11:16 UTC
The alternative would be ES6 classes, right?
Harish
@harishanchu
Jun 01 2016 11:17 UTC
yes
its easy to wrap any express middleware to this structure
Niall O'Brien
@niallobrien
Jun 01 2016 11:18 UTC
I don’t know how comfortable/good I am to wrap Passport social login strategies. :(
Harish
@harishanchu
Jun 01 2016 11:18 UTC
yup
I'm planning to write wrappers for some popular express middlewares
for passport too
Niall O'Brien
@niallobrien
Jun 01 2016 11:19 UTC
That would be a great help
Harish
@harishanchu
Jun 01 2016 11:19 UTC
Niall O'Brien
@niallobrien
Jun 01 2016 11:20 UTC
Sure, I just don’t know how I’d wrap Passport and the different strategies.
Harish
@harishanchu
Jun 01 2016 11:21 UTC
ok
see this one
it uses cookie-parser middleware inside
when quorra grows old there will be inbuit support for most of the popular express middlewares
for the rest you can create custom middlewares
Niall O'Brien
@niallobrien
Jun 01 2016 11:24 UTC
That would be fantastic. A tutorial on how to wrap popular middleware would even help.
Harish
@harishanchu
Jun 01 2016 11:24 UTC
yup
erkan1991
@erkan1991
Jun 01 2016 11:53 UTC
Thanks @niallobrien. All working now.
Niall O'Brien
@niallobrien
Jun 01 2016 11:54 UTC
I like to use that.
Harish
@harishanchu
Jun 01 2016 11:56 UTC
@niallobrien he pm ed me that his issues are resolved
Niall O'Brien
@niallobrien
Jun 01 2016 11:56 UTC
Glad to hear :)
Niall O'Brien
@niallobrien
Jun 01 2016 16:39 UTC
When do you plan to officially release v1?
Harish
@harishanchu
Jun 01 2016 16:46 UTC

I didn't fix a date yet.

I have following things to complete before v1 release:

  • Application test setup and documentation
  • Implement a better internal service load strategy
  • Update outdated dependencies
  • Filewatch support for quorra-cli
Niall O'Brien
@niallobrien
Jun 01 2016 16:47 UTC
Filewatch? I just use nodemon
Harish
@harishanchu
Jun 01 2016 16:50 UTC
yeah
that is what I suggest for now:
but I will integrate it with cli tool if its not a big deal
Niall O'Brien
@niallobrien
Jun 01 2016 16:56 UTC
nodemon has to be installed globally afaik, so that might not be a good idea
Harish
@harishanchu
Jun 01 2016 16:58 UTC
but if you once install it gloabally, can be used for any other projects too
and its only for now
I'm planning to have our own implementation
Niall O'Brien
@niallobrien
Jun 01 2016 16:58 UTC
Yes