reactioncommerce / reaction

Mailchimp Open Commerce is an API-first, headless commerce platform built using Node.js, React, GraphQL. Deployed via Docker and Kubernetes.
https://mailchimp.com/developer/open-commerce/
GNU General Public License v3.0
12.33k stars 2.17k forks source link

Complicated setup #6300

Closed ramezrafla closed 3 years ago

ramezrafla commented 4 years ago

Hello Reaction Commerce team,

I am a senior Meteor developer and active contributor to the community. I tried to start Reaction Commerce and faced a host of issues, from out-of-date documentation (is the CLI deprecated? If so, why is it still prominent in the docs?) to the complexity in launching it without Docker, and finally using Docker (with some pain) to eventually giving up as the road is steep, and going with Magento.

I mention that I am a senior developer so you know that if I am facing this, many others are silently walking away as it's too hard to launch it and test.

Here is my question: Why the complex microservice approach? Why not do everything in Meteor in one-place. It supports oAuth (I know as I have personally coded Google, MS, Zoom and Dropbox integration) and you can easily make it into a ID provider. The Admin UI can also be launched from Meteor itself.

A single app that is easy to launch that includes everything. This will cut your own development cost by more than half as you no longer have all this glue and documentation to hold this fragile infrastructure together.

This is really too bad, looks likes a good project.

kieckhafer commented 3 years ago

Hey @ramezrafla, thanks for the feedback.

I think the main thing to address is this project is no longer a Meteor application at all, it's now a headless node application.

Historically, Reaction was a monolith, built on Meteor, and included an admin and non-admin UI. Starting with v3.0.0, which was released in February 2020, Meteor was completely removed from this project, and v3.0.0 was released as a fully headless (and meteor-less) GraphQL-based API, with the Admin and Storefront UI being broken out into their own projects.

There were a lot of reasons we made this change. The micro-service architecture gives developers freedom to use their own fully customizable front-end frameworks for the admin and storefront - or use Reaction as a headless API with no UI if they wish. It allows developers much further customization by allowing them to write and use more widely used npm packages instead of Meteor plugins for all their plugins. And most importantly, the Meteor infrastructure and build times (10+ minutes with Meteor, 10 seconds with v3.0.0) were seen as one of the major pain points in our developer experience, and in the end removing Meteor was the right choice to remedy those issues.

You can read more about those specific changes in the changelog for release v3.0.0.

So now knowing that history, I'm happy to chat more about how we can improve upon your experience with Reaction v3.0.0. We know our docs can use some help, and are working on improving them. Have you tried using the Reaction Development Platform to get started? It's a really easy way to start Reaction (including our example-storefront and reaction-admin beta UI) with one command.

ramezrafla commented 3 years ago

Thanks for your reply @kieckhafer

I appreciate you taking the time and your courtesy

I tried to launch the Meteor reaction server, struggled with bcrypt (had to recompile manually). When I connect, the console gives me errors:

Error invoking SubsManager.subscribe("Accounts"):  Subscription 'Accounts' not found
meteorhacks_subs-manager.js?hash=8e9545c1a95e69c7bf1b4351f14d01e63c7460fd:224 Error invoking SubsManager.subscribe("PrimaryShop"):  Subscription 'PrimaryShop' not found
meteorhacks_subs-manager.js?hash=8e9545c1a95e69c7bf1b4351f14d01e63c7460fd:224 Error invoking SubsManager.subscribe("Packages"):  Subscription 'Packages' not found
meteorhacks_subs-manager.js?hash=8e9545c1a95e69c7bf1b4351f14d01e63c7460fd:224 Error invoking SubsManager.subscribe("Groups"):  Subscription 'Groups' not found
meteorhacks_subs-manager.js?hash=8e9545c1a95e69c7bf1b4351f14d01e63c7460fd:224 Error invoking SubsManager.subscribe("BrandAssets"):  Subscription 'BrandAssets' not found

Then I tried to see if I can launch the example storefront (v2.9.3), to no avail and docs don't help. Then I tried launching Hydra, turns out it's an empty repo with a docker-compose.

You can sympathize that it's frustrating, I tried both the newer (v3) and the Meteor one.

Also, I took a peak at the code in Meteor. It does need some help (no one uses meteor-hacks anymore or Blaze). If it was migrated to React and kept really monolithic, you would have been further along (take a look at BigBlueButton or RocketChat, great success stories).

I understand the argument that it takes 10 mins to build (truth is, with latest meteor it would take you 5 mins), but that is the only drawback in terms of developer experience. You would get a truly monolithic stack (like Magento, which only needs ElasticSearch as an external dependency -- other than MySQL and Apache) which I believe will help you go much further.

[Note: you won't nead ElasticSearch as Mongo has strong text-based search]

Imagine the time it takes you to fix all the docs, all those separate services, and all the wasted communicated and lost business. You could use Meteor / Node as your GraphQL server AND have both API-only or use with built-in client. I would move the oAuth server into it as well.

I brainstormed a bit to see if I can help coding, but it's just too huge and spread out. I don't see a clear path forward.

You are one of very few major NodeJS open-source eCommerce platforms still standing, but it has to be easy for end-users. I hate PHP and had to settle for Magento -- which is actually very well-built but, still PHP

ramezrafla commented 3 years ago

Speaking of monolithic, these guys did it: https://www.vendure.io/docs/getting-started/

We'll test it out with GatsbyJS client.

I'll close this issue then as I am not sure if we have a way forward.

kieckhafer commented 3 years ago

It seems like you're looking for two things that we no longer offer, a monolithic stack, and one that runs on meteor. We made the decisions to move away from both of those, and have no plans to move back to either, so if that's truly what you're looking for, Reaction v3.0.0 is probably not what you need.

As you mentioned, v2.9.3 is still meteor and monolithic, but that will be the final maintenance release of v2, as we no longer support Reaction v2 in any capacity as of September 1 of this year (and stopped non-essential support in February, which is why it's out of date). We highly recommend not using Reaction v2 for this reason.

I'd still be happy to chat more to get you on track with Reaction v3, and there is also an active Gitter channel that could provide help getting started.

ramezrafla commented 3 years ago

Thanks @kieckhafer

I am looking for something easy to deploy and maintain, a single server that has everything, and we can either generate our front-end or use the one built-in.

I am clarifying my need as I think it is universal. [Meteor would have been good as the UI would be built at the same time, but headless is great too.] With Reaction just to get headless we need a complicated infrastructure to deploy and maintain. Take a look at vendure.io. A single server and you use whatever frontend you want.

That's my whole point, sorry it got lost in my verboseness and thanks for your courtesy and follow up.

janus-reith commented 3 years ago

I agree that you have a point here @ramezrafla, although I see it as a major breakthrough that the dependency on meteor was removed (mostly, except for admin and IDP) and the stack became way more modular, thereby offering lot's of new possibilities.

Going forward, what I would like to see is even some more modularization on some ends, like it was started for the admin part with https://github.com/reactioncommerce/admin-core and removal of Meteor there aswell. At that point I would like to have these modules optionally be usable inside the nextjs-based storefront, so what you end up with is a single all-in-one solution that also is able to scale out of the box on serverless platforms and features one-click deployments, while still retaining full capabilities to have each part deployed individually like now, or use these modules in whatever else way you like. And at the same time, minimal overhead in maintaining multiple approaches. This certainly requires some work on the api aswell and would also come with some constraints. I did some experiments with this a few months ago and rewrote api-core to something that would work inside that environment, I however didn't have the time to continue on that yet. A complex OAuth 2 solution like Hydra + the IDP would certainly need to be switched out for something more simple on this type of deployments aswell, with Admin and Frontend on the same domain however I would also expect it to be more simple to find a quick replacement.

I'm convinced flexibility is the key here, and e.g. having that modular AiO Reaction running quickly inside codesandbox (Maybe with some in-memory db?) to quickly get started and fiddle around would be awesome.

ramezrafla commented 3 years ago

Thanks @janus-reith

To your point about ease of deployment, vendure.io have a one-line test startup with npx and it's operational. Their stack is similar (GraphQL, headless etc.) It took me 2 mins to start playing with it.

With Reaction, after many hours of trying ... I just wasted those hours and will likely never try again.