News for hackers. Stuff that matters.
Re:My Startup Failed, So We Open-Sourced the Tech by martini333 on Saturday February 22, 2020 @07:58PM (#22394406)
cool, I guess.

But why would anyone use this?

Re:My Startup Failed, So We Open-Sourced the Tech by atymic on Saturday February 22, 2020 @08:10PM (#22394450)
Even if it's not usable for other, it could be a great resource as an example MEVN stack app for newer developers to learn from.

Props to you guys for open sourcing it!

Re:My Startup Failed, So We Open-Sourced the Tech by dfcowell on Saturday February 22, 2020 @10:51PM (#22394999)
Unfortunately the repo has some truly awful antipatterns. The catalog service is a masterclass in how not to write Node.
Re:My Startup Failed, So We Open-Sourced the Tech by anonytrary on Sunday February 23, 2020 @12:06AM (#22395255)
I think the controller/service abstractions are completely unnecessary and cause unwanted indirection. Otherwise, this looks like a typical CRUD service -- with custom logging, database model schemas, authentication, and routes that utilize all of the above.
Re:My Startup Failed, So We Open-Sourced the Tech by ozfive on Sunday February 23, 2020 @12:10AM (#22395268)
So fix it!!! It's open source. Put some work in, or your complaints fall on deaf ears.
Re:My Startup Failed, So We Open-Sourced the Tech by anonytrary on Sunday February 23, 2020 @12:52AM (#22395375)
You're assuming quite a lot. First, I'm not saying it's broken, so what is there to "fix"? Second, I'm not using this library, so why would you expect me to submit a PR? People aren't expected to contribute to libraries just because they noticed a smell in the code. Open source is about contributing to stuff you use. You don't have to (and shouldn't be expected to) fix everything you see broken in in the world.
Re:My Startup Failed, So We Open-Sourced the Tech by preommr on Sunday February 23, 2020 @06:44AM (#22396401)
seems pretty normal, what's so bad about it?
Re:My Startup Failed, So We Open-Sourced the Tech by dfcowell on Sunday February 23, 2020 @07:29AM (#22396533)
Thanks for the question - for clarity, this is the file I'm referring to in this reply: https://github.com/Viveckh/Veniqa/blob/develop/shopping-serv...

1. The service is a leaky abstraction, it knows about HTTP status codes and presumably the response body format. The point of separating concerns is to make code reusable, HTTP response codes don't make sense outside of a HTTP call. Similarly, any calling code needs to know that `sortRule` is expecting a MongoDB sort parameter.

2. The control flow is super unclear due to mixing async/await and Promise API coding styles. The `.catch()` call on the promise chain means that the `catch` block will never be hit and the API will always return OK, with the error object exposed to the client in the `responseData` - likely exposing implementation details about the server via the stacktrace on the error object.

There are other nits I could pick, but those are the most important issues and my other criticisms are more a matter of preference.

Re:My Startup Failed, So We Open-Sourced the Tech by PretzelFisch on Saturday February 22, 2020 @08:31PM (#22394522)
How would someone judge the code quality and architecture to say this repository is a good example and how? Wouldn't the general tutorial and training material be a better source then a startups ship it now code base?
Re:My Startup Failed, So We Open-Sourced the Tech by Jaygles on Saturday February 22, 2020 @10:18PM (#22394871)
The code itself doesn't have to be good to be a good example. One thing the average tutorial doesn't have is complexity. Picking apart how this code handles complexity could be a good lesson to people who are trying to learn how to architect good sized projects.
Re:My Startup Failed, So We Open-Sourced the Tech by dfcowell on Saturday February 22, 2020 @10:54PM (#22395008)
Only if the reader is discerning enough to notice when they’re looking at a bad implementation. Otherwise there’s a risk of learning bad practices.
Re:My Startup Failed, So We Open-Sourced the Tech by bcrosby95 on Sunday February 23, 2020 @01:23AM (#22395454)
It might be a good read to see how other people are solving a problem. But I wouldn't use it directly. After looking at the code for a few minutes I noticed this: https://github.com/Viveckh/Veniqa/blob/develop/shopping-serv...

It makes sense that awkwardly hard coded hacks like this will exist in a startup's piece of software. But it's possibly full of similar things that might take a lot of effort to find, much less fix.

When money is running out and deadlines are looming its hard to have the discipline to not do stuff like this, and a startup's goal tends not to really be to build open source software for everyone to use anyways, so I'm not surprised something like this might exist.

Re:My Startup Failed, So We Open-Sourced the Tech by wolco on Saturday February 22, 2020 @08:52PM (#22394578)
I'm using this to understand how certain pieces are structured coming from a different language background.