Saleor: Saleor Headless Folder Structure (Without Front End)

Created on 25 Jan 2019  路  6Comments  路  Source: mirumee/saleor

What I'm trying to achieve

Saleor structure custom with just the API Graphql and the Admin. Without the front end.

Describe a proposed solution

Friends I would like you to read this idea:

Saleor should have a CLI to allow choosing options, such as Firebase CLI or Ruby on Rails.

This idea came to me because it would be a good idea if Saleor had an option with just the structure for the Graphql API, the Administrative Panel and Graphiql, Playground (or whatever it is used to debug the API) and without the front-end created of the ecomerce written in Django Template.

So this would be great if a CLI asked you something like this:

What structure do you need?

  • Saleor Classic (With Front End in Django Template)
  • Saleor Headless, (Just the GraphqlAPI with Admin Panel)
discussion

Most helpful comment

Hey, thanks for opening this issue! Actually, we were thinking about building a CLI for Saleor and one of its main features would be bootstrapping a new project.

One reason for that is that we already have a separate repository for Storefront 2.0 and once we close the features gap between Dashboard 1.0 and 2.0, we're going to move the latter to a separate repo as well. Then, a CLI would make it a lot easier to quickly setup everything without manually cloning each repo. So this is planned but I don't think we'll able to build it sooner than in Q2.

I think we could keep the issue open for discussion about Saleor CLI.

All 6 comments

Hey, thanks for opening this issue! Actually, we were thinking about building a CLI for Saleor and one of its main features would be bootstrapping a new project.

One reason for that is that we already have a separate repository for Storefront 2.0 and once we close the features gap between Dashboard 1.0 and 2.0, we're going to move the latter to a separate repo as well. Then, a CLI would make it a lot easier to quickly setup everything without manually cloning each repo. So this is planned but I don't think we'll able to build it sooner than in Q2.

I think we could keep the issue open for discussion about Saleor CLI.

An easy fix would be adding env variable, for turning on&off the static django frontend

I think the option of a CLI is quite interesting. Because this could open an infinite number of new possibilities.

Like the installation of themes, plugins, and different initial folder structures of the project.

@CharlyJazz Did you find any good solution to using a custom frontend with the Saleor API?

@maarcingebala Is the Saleor CLI still in the works, or have you move on to another approach to achieve a _headless_ Saleor GraphQL API, using a fully custom frontend?

@OArnarsson If you don't want to use the default storefront, you could simply drop all templates files, views and any code related to that. Our new storefront is a totally separate project that entirely depends on the GraphQL API.

About the CLI, we haven't started working on that yet. I guess that when we reach feature parity in Dashboard 2.0 we will want to move it to separate repo as well. Then we would need some tool to make it easy to setup Saleor and maybe that will be the moment we'll start thinking seriously about the CLI.

Speaking of CLI, if you mean of being able to pass settings as program arguments as well, I would guess we could do something like Viper (a go configuration framework) does:

  • it takes a struct (let's say a dict or a module's attributes, e.g., django's settings.py; it would be very easy to pass such objects containing key-value pairs with Python);
  • Add configuration handlers using the attribute names, whether it's a:

    • program argument, e.g. settings.py's DATABASE_URL=... => --database-url=...;

    • an environment variable, e.g. DATABASE_URL=...;

    • a provided configuration file (YAML or JSON), e.g.: -c PATH or --config PATH;

    • default configuration file paths, e.g.: ~/.saleor.yaml or ./common.env.

I'm guessing such thing probably does exist in Python (PyPI) as well.

Was this page helpful?
0 / 5 - 0 ratings