menu

Saleor Commerce

The world’s fastest growing open-source e-commerce platform with billions of dollars transacted. Powered by Python, GraphQL, ReactJS and PWA.

Channels
# All channels
view-forward
# General
view-forward
# Announcements
view-forward
# Design
view-forward
# Development
view-forward
# Saleor 3.0
view-forward
# Saleor Features
view-forward
Team

structure of Saleor

July 13, 2020 at 1:14am

structure of Saleor

July 13, 2020 at 1:14am
I know Saleor is running on Django, Saleor-dashboard is running in node.js, and Saleor-dashboard is also node.js. Why doesn't Saleor run everything in Django? Like using Django to server the static files in front-end. Is it really necessary to divide the whole project in three parts? Thanks

July 13, 2020 at 10:22am
Using django to host static files is ineffective. If you choose to serve SPA from CDN service (or use s3), then you can achieve better loading speeds because CDNs are better distributed around the world. Also host on s3 is cheaper than maintain typical server.
And why we chose to split Saleor into 3 modules:
  • HTML templates used in django were not enough for us (not dynamic enough, also rendering HTML is another CPU load for API server)
  • since we have graphql API, we are able to faster develop (also independently!) frontends in JS. Tooling is great (check out Apollo client and its caching capabilities)
  • we are specialized in highly customized Saleor implementations. Frontend is usually the part which highly differs from customer to customer, so having it separated from API logic is helpful to maintain such fork
  • its more effective for backend devs focus on creating API and frontends to develop good API consumers. Using django templates makes that separation harder
As a python dev who switched to frontend, I see that learning new stack is hard thing to do, but IMO it's worth it
Edited
like-fill
3
  • reply
  • like

July 14, 2020 at 5:04am
Thanks for your answer. I have another question. Can I deploy Storefront and dashboard to AWS S3, and the django API to heroku? So, heroku provides the API and AWS S3 serves static files?
  • reply
  • like
Also you mentioned Apollo Client. Do you use Apollo Client in Saleor right now? Or is this a tool you will introduce to Saleor in the future? Thanks
  • reply
  • like
I just see you are using Apollo in your code.
  • reply
  • like

July 14, 2020 at 7:58pm
Thanks for your answer. I have another question. Can I deploy Storefront and dashboard to AWS S3, and the django API to heroku? So, heroku provides the API and AWS S3 serves static files?
You're welcome :) Should be possible, but haven't done this myself. So far I've been sticking to the AWS cloud because that's what my clients mostly use and I've got nice credits bonus for students years ago (GitHub Student Pack is awesome, also you can get AWS Free Tier for 1 year which is great (but set up billing notifications! I've lost few bucks because of using too much resources)).
  • reply
  • like
Thanks for your reply.
  • reply
  • like