News for hackers. Stuff that matters.
Re:Show HN: Django and React SaaS boilerplate tutorial by sandGorgon on Wednesday December 23, 2020 @09:57AM (#25518191)
unless you're doing a lot of math - where python/numpy/sklearn/scipy/BLAS/LAPACK/Tensorflow is unparalleled - you should do everything in JS/TS.

something like nextjs - with built in frontend+backend is ideal.

Re:Show HN: Django and React SaaS boilerplate tutorial by djstein on Wednesday December 23, 2020 @10:19AM (#25518426)
Look, this argument is always thought provoking, but not worth any devs time to execute. Django/Rails/Spring/.Net have years of combined dev experience. They contain almost all the things every web application needs, with highly adopted off the shelf plugins for everything else. When engineers fall for the trap of Flask/Express/Sinatra/Go they don’t realize they’ll either be a. Writing everything the above frameworks have by hand or b. Cobbling together a ton of different/non related tools that may not be battle tested. In either case they spend time writing features we solved 20 years ago. My favorite example of this is database connections/migrations/translations.

You suggested using nextjs for the backend. This weeks flavor of nextjs database connections is to be done with Prisma. Setting the two up together is no walk in the park. So great, you’ve spent a week setting up Prisma and the layers which connect it to your API. You’ll probably now task yourself with connecting the database to a GraphQL API with a Playground (another week). What about auth? Hand roll of reach some the suggested Auth0 library for nextjs. Another week of integrating. You can see the pattern. Meanwhile, the Django user has everything setup in day one, nextjs app for front end only deployed on day 2, and is building user features day 3.

We haven’t even talked about setting up request middleware, integration with logging tools, distributed tracing, exception aggregators, sending email, scheduled background tasks. Which you can spend another week for each or just go to your battle tested framework of choices’ doc page.

Re:Show HN: Django and React SaaS boilerplate tutorial by sandGorgon on Wednesday December 23, 2020 @10:31AM (#25518577)
im very conscious that this may trigger a very opinionated war. so let me backoff for a moment.

My comment is in context of this project and not a generic statement. My startup is built entirely in python.

A boilerplate - by definition is a get started quickly tool for people that are (by choice or otherwise) not interested in going to the depths of a framework. In that very particular context, a Nextjs based boilerplate will beat this one.

As an example, let me share a nextjs template that you can buy for 20$ https://themeforest.net/item/react-material-bootstrap-4-admi...

https://themeforest.net/item/react-next-modern-landing-page-...

again, im not trying to crap over the OP's attempt. I seriously commend it. But if there's someone looking for a boilerplate to get something with a frontend/backend up and running quickly...i still do think doing it in one language/framework is much better.

P.S. And I do think TS is a fantastic language. But again, my point was not a purist Python vs TS/JS slugfest

Re:Show HN: Django and React SaaS boilerplate tutorial by pplonski86 on Wednesday December 23, 2020 @11:21AM (#25519178)
I'm very biased towards Python. I'm working on AutoML tools (created MachineLearning-as-a-Service web-service and open-source AutoML Python package). That's why I'm using Django. In my opinion it is very powerfull. There are for sure many people looking for easy start in Django+React setup, that's why I started writing tutorials.
Re:Show HN: Django and React SaaS boilerplate tutorial by sandGorgon on Wednesday December 23, 2020 @11:54AM (#25519516)
fully agree - and in my first comment i do mention that if you are doing anything in math, then you NEED+HAVE to stay in python. No choice - even if you love javascript ;)
Re:Show HN: Django and React SaaS boilerplate tutorial by heliodor on Wednesday December 23, 2020 @10:59AM (#25518930)
I've bought a number of templates over the course of a year building my company's website.

The general result is that the code quality is very low and the class names are not specific enough, so you get bogged down in css when you try to customize things.

Fool me once ... fool me twice ... fool me three times ...

Re:Show HN: Django and React SaaS boilerplate tutorial by city41 on Wednesday December 23, 2020 @10:56AM (#25518895)
But these templates you've linked to are frontend focused. Next doesn't really address the backend much at all. Most of what it does backend wise is to help the frontend (such as SSR).

If I needed a full webapp spun up quickly (db, auth, api emails, etc), I'd choose Django before Next.

Re:Show HN: Django and React SaaS boilerplate tutorial by sandGorgon on Wednesday December 23, 2020 @11:41AM (#25519404)
well YMMV, but nextjs is fairly complete.

e.g. https://nextjs.org/commerce

here's one with Firebase auth, graphql, everything already setup https://themeforest.net/item/livani-react-next-ecommerce-sto...

Re:Show HN: Django and React SaaS boilerplate tutorial by city41 on Wednesday December 23, 2020 @11:57AM (#25519544)
Don't get me wrong, I like and use Next. But from what I can understand, it's just not as complete as Django, Rails, etc. I think the fact that template is using Firebase for its storage says a lot.

Next itself does not help you with Firebase or databases or any kind of persistent storage. It's entirely left up to you. That's a huge difference from Django, Rails, etc. The same is true of auth and many other things.

Re:Show HN: Django and React SaaS boilerplate tutorial by tln on Wednesday December 23, 2020 @06:58PM (#25523717)
The nextjs one uses a third party (bigcommerce) as the back end.

Firebase is also a third party backend.

Any recommendations on one where you can own the backend yourself, like Django? Without composing all the pieces manually?

I'm currently running a Django backend, Vue frontend, and think Django is a fine tool -- but occasionally look for a nice cohesive Django alternative in the JS world.

Re:Show HN: Django and React SaaS boilerplate tutorial by megaman821 on Wednesday December 23, 2020 @12:04PM (#25519625)
Totally agree. Flask (or any other micro-framework) is great for beginners because there is very little configuration and it maps closely to the request-response cycle. But, if you are working on a real project and have to ask between a full-stack or micro framework, you probably don't even know the things you are missing by choosing a micro-framework. A lot of thought has been put into Django, most Flask setups I have seen are not at the same level of quality.
Re:Show HN: Django and React SaaS boilerplate tutorial by toinbis on Wednesday December 23, 2020 @10:33AM (#25518603)
You should NOT use nuxt, react, gatsby in bussiness environment for anything but internal employee-facing applications.

Reasons being, that nextjs&friends(hydrated site alongside js-based navigation) make it:

a)impossible to do decent a/b testing;

b)impossible to do decent personalizations;

c)impossible to have decent page load times;

d)impossible to have any decent web analytics;

e) team is unable to understand what's going on with a page after looking into source code - devs get more control in expense of ppc teams, ux teams, cro teams, analytics teams, data teams, sysadmins, monitoring teams. This is the biggest killer argument even though a)-d) arguments might seem fancier at first. Sooo many devs just can't ever relate to this, because yes - reactgasm is a strong emotion. But you have to think about others. Devs can survive jquery. Marketer can not survive react.

So You just stick to css+html+vanilla js+web components(svelte or stencils or whatever). That is based on my 8+ years working as a marketer/product owner building billion-grade ecommerce projects.

As you have not spent too much time on elaborating your points but throwing out strong opinion to the wild, I will do more or less the same.

Happy to discuss in comments though :)

Re:Show HN: Django and React SaaS boilerplate tutorial by arcturus17 on Wednesday December 23, 2020 @02:38PM (#25521263)
a) Haven't done much A/B testing in a while, but Optimizely has what seems like a huge library for React, which suggests this is false.

c) I can attest that this is complete bollocks, I have React apps in production that are blazing fast, and I have seen many others in the wild. I've also built a few prototypes in Next.js and got near-perfect speed scores without optimizing anything. I can only imagine it's gotten better in the last year or so.

d) I guess depends on definitions of "decent" analytics, but I've seen a few analytics solutions working with React in production and they worked more than decently.

As a closing thought, Facebook uses React all over the place. They are massive on personalization, analytics and A/B testing, for better and for worse, at hyperscale. I guess you think it's just the exception that confirms the rule?

Re:Show HN: Django and React SaaS boilerplate tutorial by toinbis on Wednesday December 23, 2020 @03:55PM (#25522123)
Reply to a) No, it is not false at all. Let's skip the brands out of discussion. Client side a-b testing is impossible to be decent. Period. The fact that optimizely built something for react is not a valid argument.

Reply to c) Your react app is 30% slower that anything decent. Why would any bussiness owner would ever sign this off to happen in their acquisition funnel(i.e. where user experience is especially crucial)?

Reply to d) Decent is ~100% correctness and completeness versus ~70%.

Reply to "I guess you think it's just the exception that confirms the rule?" -> You keep mentioning companies and brands instead of implementations which suggest you have no experience on the implementation part. That is the thing - facebook does a/b testing server-side. And i'll just mention that facebook also used react to create their, arguably, second most important project - facebook ads manager. And it's a complete 'bollocks'(using your words) architectural decision to build such tool for react - it's a UX as terrible as it can get and i've used it for 5 years and I know at least 100 advertising agency employees who would sign this statement with their sweat and they are one of two. Just to give a counter-argument of the same origin as Yours one.

So am very thankful for constructive discussion - all your arguments are fair and well elaborated. Just you can't buy any of them. Really hope am not insulting with my strong opinions, always happy to discuss further!

Re:Show HN: Django and React SaaS boilerplate tutorial by arcturus17 on Wednesday December 23, 2020 @05:36PM (#25523081)
> You keep mentioning companies and brands instead of implementations

This doesn't make any logical sense. I was clearly referring to Facebook primarily as an implementation, not as a brand.

> Client side a-b testing is impossible to be decent

OK, so Netflix, Facebook, Instagram, AirBnB - all web app implementations - cannot decently A/B test, but you can. Gotcha.

> Your react app is 30% slower that anything decent

How would you know, anyway? The web apps I've worked on (not app, in singular) are faster than just about anything "decent", faster than many SSR industry peers or competitors, and objectively so under many industry-standard performance tests.

You further resort to a personal attack by questioning my implementation or engineering chops without any evidence of them - just my evidence-based opinion that SPAs are not inherently slow at all (they really aren't).

I've got nothing against SSR, it's got its use cases and I've personally used it too, but you on the other hand seem to be an SSR jihadist - surely that could be a telltale sign of a really poor engineer?

Re:Show HN: Django and React SaaS boilerplate tutorial by toinbis on Thursday December 24, 2020 @11:14AM (#25528731)
>> This doesn't make any logical sense. I was clearly referring to Facebook primarily as an implementation, not as a brand.

Facebook is a product of 100000 different implementations which might theoretically change daily. If we were discussing can we do thing X or Y with MySQL, and you'd say 'look - there is facebook, it's working, it means you can('t) do thing X or Y with MySQL' - that would not not be very specific. I'll add term 'architecture' to discussion.

>> OK, so Netflix, Facebook, Instagram, AirBnB - all web app implementations - cannot decently A/B test, but you can. Gotcha.

So, let's talk architectures. "Netflix, Facebook, Instagram, AirBnB" - if you can, please specify what architecture and for what purpuse they have implemented. And tell about the specific example. We will have something to discuss, now we just don't.

For instance, https://docs.developers.optimizely.com/full-stack/docs/optim... -> this is architecture of optimizely experiment for React. This is other feature https://www.youtube.com/watch?v=NRLhlTopFzw being showcased, but you can get a sense of how the SDK is being used. Let's say bussiness requirement is to run experiment where for 50% of traffic you show nothing at the top of the page, for other 50% you show country flag image and city flag(cout of arms) image. Site is built with next.js. The next day you throw next.js out and build your site from scratch on other page. How would you implement that?

>>How would you know, anyway?

a) You use common technical sense and realize that's the only way it can be;

b) If you don't trust your guts, you go and analyze performance tests: https://css-tricks.com/radeventlistener-a-tale-of-client-sid... and learn that react is 40x slower that the industry standard. Not stressing 40x, just - it's slower, was and will always be (except RenderToStaticMarkup and Server Side Components).

c) You go and check what world is using - https://w3techs.com/technologies/comparison/js-jquery,js-rea... , you realize that, statistically speaking, no one is actually using react, probably for a reason. (Ok ok, this argument is also a bit overstrech, and yet... :)

d) You can only know for sure by building stuff and comparing. You build https://turboeshop.com/fastestpageintheworld/ and https://gatsbyeshop.com and compare: https://imagebin.ca/v/5lrH1VnQBac7 .

>> 'faster than many SSR industry peers or competitors'

'Not worse then most competitors' is not how you win in bussiness competition, is it? :)

>> You further resort to a personal attack

Honest apologies if that sounded that way. If I may - I take all that back.

>> I've got nothing against SSR, it's got its use cases and I've personally used it too, but you on the other hand seem to be an SSR jihadist

Ok, now we talk. For the record - I write a lot of client-facing vue code, sometimes a bit of react. Love both, great developer experience, I call them both 'godsend' for frontend development.

Yes, I do turn radical when people start shouting 'react is the answer, what was the question'. And this tread we are having discussion in began with 'you should do everything in JS/TS' statement. And believe me, there are many devs like this.

When faced such statements and situations I do take a stance and say that there are so many bussiness requirements that make hydration/js-navigation/react-vue-svelte obsolete from day one, they are just out of consideration when picking a stack.

Problem is devs makes usually make choices and bussiness usually does not not the costs they are incurring in letting devs to use tech stack they do love. Reactgasm(term found online) has it's high costs for some bussinesses. It sure does. It has obvious gains as well. Which are the greater - devs only can never decide, yet it happens that they think they can.

My main profession, broadly speaking, is e-commerce marketing. And when dev comes and says 'i'll use react in the acquisition funnel of the project you'll be optimising' - sometimes turning to SSR jihadism is the only way of winning an argument. Am glad we finally came to a conclusion that 'it depends on bussiness requirements', which I honestly think is always a start and end of discussions as such.

My final point is "react&friends are not default options for tech stack for ecommerce bussiness acquisition funnel (I have quite some expertese and many years of experience in this specific domain, that's why I allow myself strong statements), but in practice it may surely be a comlete opposite if bussiness decides so". That says nothing about that react or vue ar not great projects they do not have their use cases. In a neutral environment without react-jihadism i'm perfectly fine saying 'tech stack needs to meet bussines requirements', but that's only with an asterisk *if bussiness requirements are actually being taken into consideration, not devs just picking what they love and pretending everything else does not actually matter.

Many thanks for good discussion, apologies again if any of the statements were impolite, am not a native English speaker. Feel free to challange my technical discussions above, but I think I'll resist of pushing this further, as I've elaborated my point of view and then I believe it's about sharing ideas not winning arguments why we are in HackNews :) Kindest regards and happy holidays!

Re:Show HN: Django and React SaaS boilerplate tutorial by biddit on Wednesday December 23, 2020 @12:08PM (#25519664)
Absolutely agreed. One thing that really concerns me is that the newest generation of web developers really has no idea that web development doesn’t need to be so bloody complex.

I’m working on a simple internal enterprise app for managing document workflow right now. It should just be a basic CRUD application maintained by 2-3 devs at most. Because of how it’s architected (extreme normalization on the backend, Vue used for every single simple component on the front end), we have a team of 15 devs on the project.

I had to update the options in a simple select drop-down menu last week. It took me a full day and modifying six files to get it right. 10 years ago it would have been a 20 minute task and two files.

It’s sickening because the entire team thinks this is normal.

Re:Show HN: Django and React SaaS boilerplate tutorial by WD-42 on Thursday December 24, 2020 @12:15PM (#25529313)
There was a story on HN recently about a security breach on some website because of a hand written auth scheme. I was surprised with how many people just thought it was normal to hand roll auth stuff. I think it comes mostly from the server side JS crew but it is definitely disturbing the amount of wheels being reinvented out there
Re:Show HN: Django and React SaaS boilerplate tutorial by sandGorgon on Wednesday December 23, 2020 @11:56AM (#25519537)
would love to hear from you about this.

Doesnt react have like a massive ecosystem of integrations around this ? for example Optimizely - https://docs.developers.optimizely.com/full-stack/docs/javas...

what do you think ? i mean i dont like kubernetes...but the ecosystem is already there right ?

Re:Show HN: Django and React SaaS boilerplate tutorial by toinbis on Wednesday December 23, 2020 @12:03PM (#25519606)
Client-side a/b testing/personalizations(default option for google optimize, visual website optimizer, optimizely) mean you have to use page hiding snippet - https://support.google.com/optimize/answer/7100284?hl=en.

Which, if you look at it closer - "'dataLayer',4000," 4000 ms mean that you basicly make your website white blank for up to 4s while all the ab testing loading stuff is happening behind the scenes.

And this makes your initial load UX a very very awkward experience.

If personalization / ab testing is happining on load-time parameters (i.e. country), well, you are in a situation where I have mentioned hydrated site is out of options to be considered for the stack selection.

Re:Show HN: Django and React SaaS boilerplate tutorial by toinbis on Wednesday December 23, 2020 @12:13PM (#25519719)
As for other points, let me elaborate on web analytics. Google Analytics default seup collect around 70-80% of transactions/events/pageviews data. If you want to fix this, you revert to server-side stuff, and that's where you meet js-based navigations.

That's when you either try to go this way with gatsby: https://www.gatsbyjs.com/plugins/gatsby-plugin-no-javascript... .

That's when you are stuck with sapper: https://stackoverflow.com/questions/64507516/how-to-disable-... .

That's when you end up in tickets like this with Nextjs: https://github.com/vercel/next.js/issues/4381 . And never look back.

Re:Show HN: Django and React SaaS boilerplate tutorial by toinbis on Wednesday December 23, 2020 @12:22PM (#25519824)
As for pageload, next.js is 30% slower than vanilla website. No ecommerce bussiness should ever alow this(my personal opinion).

Take a look at my top comment of https://news.ycombinator.com/item?id=25342767 for more details.

Re:Show HN: Django and React SaaS boilerplate tutorial by bpt3 on Wednesday December 23, 2020 @10:14AM (#25518359)
> unless you're doing a lot of math - where python/numpy/sklearn/scipy/BLAS/LAPACK/Tensorflow is unparalleled - you should do everything in JS/TS

In my opinion, JS development is unpleasant because of the many, many inconsistencies and corner cases that must be accounted for when writing code, the dumpster fire that is the npm ecosystem, and the lack of established frameworks like Django. Things like TypeScript make writing code less painful, but I only use JS when I have to (i.e. I need something to execute in a browser).

> something like nextjs - with built in frontend+backend is ideal.

This is completely subjective, and I would disagree.

Re:Show HN: Django and React SaaS boilerplate tutorial by bliteben on Wednesday December 23, 2020 @11:27AM (#25519250)
even just wiring up a management command / cron job is a huge pain in javascript right now with the require vs import stuff. typescript makes it better, but until type script is more supported this type of stuff is going to continue to be an issue.
Re:Show HN: Django and React SaaS boilerplate tutorial by bpt3 on Wednesday December 23, 2020 @11:46AM (#25519457)
Agreed, I think it's much easier to make a list of what is not a huge pain in javascript that it would be to make a list of everything that is.
Re:Show HN: Django and React SaaS boilerplate tutorial by MoSattler on Wednesday December 23, 2020 @10:10AM (#25518319)
The JS ecosystem is unfortunately lacking anything as powerful as the Django ORM.
Re:Show HN: Django and React SaaS boilerplate tutorial by nicoburns on Wednesday December 23, 2020 @10:27AM (#25518518)
The ORM space is actually getting much closer. Both TypeORM and Objection.js are good options. But if you're talking about Django as whole then I totally agree.
Re:Show HN: Django and React SaaS boilerplate tutorial by arcturus17 on Wednesday December 23, 2020 @03:14PM (#25521657)
I’ve considered them before along with Sequelize but their repos are chock-full of issues, and I’ve read some very negative opinions about all of them. They make me unsure that they’re production-worthy.
Re:Show HN: Django and React SaaS boilerplate tutorial by djstein on Wednesday December 23, 2020 @10:21AM (#25518455)
This is it. If you can’t connect to your database effectively and safety execute queries + migrations (looking at you people who write SQL queries by hand in Typescript) you’re just writing something that is one key stroke away from destroying your database.
Re:Show HN: Django and React SaaS boilerplate tutorial by nicoburns on Wednesday December 23, 2020 @10:29AM (#25518543)
> you’re just writing something that is one key stroke away from destroying your database.

Is it any more difficult to destroy your database in Django DSL than it is in raw SQL? We're using a lot of raw SQL at day job, and the two junior developers on our team who had no priory experience of working with SQL databases at all have picked it up just fine.

Re:Show HN: Django and React SaaS boilerplate tutorial by dstep-init on Wednesday December 23, 2020 @01:44PM (#25520653)
It just seems kind of like building a car by hand to me. Why would you want to use raw SQL when you can leverage the power of your favorite programming language? Isn't it cleaner to write a Model with Pythonic field constraints, methods, and subclassing? Don't get me wrong - knowing SQL is important for every developer, but one doesn't need to be an SQL expert to be a back-end development expert.
Re:Show HN: Django and React SaaS boilerplate tutorial by arcturus17 on Wednesday December 23, 2020 @02:43PM (#25521327)
I love React and JavaScript but I completely disagree with this. I've moved to Django for my back-ends and it's an infinitely better experience than any Node.js-based backends. It provides a structure and set of facilities which are completely unmatched in the JS server world.

I would only use Node.js again for the back-end if I explicitly needed its performance characteristics.

Re:Show HN: Django and React SaaS boilerplate tutorial by tomcam on Wednesday December 23, 2020 @10:48AM (#25518780)
How many line of business apps do you maintain?