These are chat archives for quorrajs/quorrajs

1st
Jun 2016
Niall O'Brien
@niallobrien
Jun 01 2016 00:03
Hi all, just wondering what makes Quorra a better choice than Sails for example? Thanks.
erkan1991
@erkan1991
Jun 01 2016 04:24
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

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
@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
@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
@harishanchu but why is your remember token a int(100) ?
Harish
@harishanchu
Jun 01 2016 08:34
@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
Hi all, what's the main difference between Quorra and Sails?
Harish
@harishanchu
Jun 01 2016 08:54
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
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
Interesting, are there any benchmarks?
Harish
@harishanchu
Jun 01 2016 09:19
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
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
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
yup
Niall O'Brien
@niallobrien
Jun 01 2016 09:41
How do I retrieve old data from the session in a view?
Harish
@harishanchu
Jun 01 2016 09:42
I will do a detailed performance comparison once after we release our first stable version
Niall O'Brien
@niallobrien
Jun 01 2016 09:42
:+1:
Harish
@harishanchu
Jun 01 2016 09:43
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
So I always specify the key & value?
Harish
@harishanchu
Jun 01 2016 09:46
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
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
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
Ok, but how do I access that in a view?
as username?
Harish
@harishanchu
Jun 01 2016 09:52
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
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
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
So, if using Jade/Pug I could do
if errors
  …
  etc.
Niall O'Brien
@niallobrien
Jun 01 2016 10:27
It would be nice if we moved to ES6 syntax
Harish
@harishanchu
Jun 01 2016 10:29
Yup.
Code base is written in es5
Niall O'Brien
@niallobrien
Jun 01 2016 10:29
Is it just you working on it @harishanchu?
Harish
@harishanchu
Jun 01 2016 10:30
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
Agreed, maybe a good place to start is by updating the initial generated app code.
Harish
@harishanchu
Jun 01 2016 10:31
Yes.
Yes it's me working on quorra
Niall O'Brien
@niallobrien
Jun 01 2016 10:31
You’ve done a great job!
Harish
@harishanchu
Jun 01 2016 10:31
Started this as my side project
Thank you 😃
Niall O'Brien
@niallobrien
Jun 01 2016 10:32
I wish I had more experience to help more.
Harish
@harishanchu
Jun 01 2016 10:33
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
No problem. I’m currently using Express & Mongoose, but I like fullstack frameworks :)
Harish
@harishanchu
Jun 01 2016 10:35
:+1:
Niall O'Brien
@niallobrien
Jun 01 2016 10:36
Might be good to update Jade to Pug also.
What future plans do you have for Quorra?
Harish
@harishanchu
Jun 01 2016 10:44
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
Is there a list?
Harish
@harishanchu
Jun 01 2016 10:46
There is no public list yet
Niall O'Brien
@niallobrien
Jun 01 2016 10:46
I would help if I could.
Harish
@harishanchu
Jun 01 2016 10:46
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
Oh, services will be nice! :)
Harish
@harishanchu
Jun 01 2016 10:49
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
Awesome, Ava looks nice - https://github.com/avajs/ava
Harish
@harishanchu
Jun 01 2016 10:50
I have already done this
Niall O'Brien
@niallobrien
Jun 01 2016 10:50
What do you mean?
Harish
@harishanchu
Jun 01 2016 10:50
I configured quorra to use mocah + should
Niall O'Brien
@niallobrien
Jun 01 2016 10:50
Ah
Harish
@harishanchu
Jun 01 2016 10:50
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
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
you can run tests now itself with npm test from quorra project root
Niall O'Brien
@niallobrien
Jun 01 2016 10:55
Does Quorra use Express?
Niall O'Brien
@niallobrien
Jun 01 2016 11:03
@erkan1991 It looks like Postgres isn’t running
Harish
@harishanchu
Jun 01 2016 11:07
Nope.. it donot use express
Niall O'Brien
@niallobrien
Jun 01 2016 11:08
Ok, so I cannot use Express middleware such as Passport for social logins? :(
Harish
@harishanchu
Jun 01 2016 11:08
I have used express's request and response helper methods in quorra
Niall O'Brien
@niallobrien
Jun 01 2016 11:09
Not sure how I’d do social logins so.
Harish
@harishanchu
Jun 01 2016 11:10
It's not a big deal
Niall O'Brien
@niallobrien
Jun 01 2016 11:11
How so?
Harish
@harishanchu
Jun 01 2016 11:11
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
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
The alternative would be ES6 classes, right?
Harish
@harishanchu
Jun 01 2016 11:17
yes
its easy to wrap any express middleware to this structure
Niall O'Brien
@niallobrien
Jun 01 2016 11:18
I don’t know how comfortable/good I am to wrap Passport social login strategies. :(
Harish
@harishanchu
Jun 01 2016 11:18
yup
I'm planning to write wrappers for some popular express middlewares
for passport too
Niall O'Brien
@niallobrien
Jun 01 2016 11:19
That would be a great help
Harish
@harishanchu
Jun 01 2016 11:19
Niall O'Brien
@niallobrien
Jun 01 2016 11:20
Sure, I just don’t know how I’d wrap Passport and the different strategies.
Harish
@harishanchu
Jun 01 2016 11:21
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
That would be fantastic. A tutorial on how to wrap popular middleware would even help.
Harish
@harishanchu
Jun 01 2016 11:24
yup
erkan1991
@erkan1991
Jun 01 2016 11:53
Thanks @niallobrien. All working now.
Niall O'Brien
@niallobrien
Jun 01 2016 11:54
I like to use that.
Harish
@harishanchu
Jun 01 2016 11:56
@niallobrien he pm ed me that his issues are resolved
Niall O'Brien
@niallobrien
Jun 01 2016 11:56
Glad to hear :)
Niall O'Brien
@niallobrien
Jun 01 2016 16:39
When do you plan to officially release v1?
Harish
@harishanchu
Jun 01 2016 16:46

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
Filewatch? I just use nodemon
Harish
@harishanchu
Jun 01 2016 16:50
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
nodemon has to be installed globally afaik, so that might not be a good idea
Harish
@harishanchu
Jun 01 2016 16:58
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
Yes