Install saleor ecommers

2 months ago

Saleor headless ecommers is one of the best open source ecommers platform base on git stars. In this blog post I will guidle you how to install, connect to db with pgadmin and fix common setup issues along the way.

Demo without install

If you want to check the demo only saleor provide a demo

https://demo.saleor.io/dashboard

Install with docker.

note: 

$ sudo docker-compose version
docker-compose version 1.25.0, build 0a186604
docker-py version: 4.1.0
CPython version: 3.7.4
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

docker-compose version 1.25 not work you will get error 

a bytes-like object is required, not 'str'

You need to upgrade to docker-compose version 1.29.2

Follow the install doc

git clone https://github.com/saleor/saleor-platform.git --recursive --jobs 3
cd saleor-platform
docker-compose build
docker-compose run --rm api python3 manage.py migrate
docker-compose run --rm api python3 manage.py collectstatic --noinput
docker-compose run --rm api python3 manage.py populatedb
docker-compose run --rm api python3 manage.py createsuperuser
docker-compose up

After that you can check the product in broswer with http://localhost:3000/

Connect to database with pgadmin

To find database username and password

# setting.py
...
DATABASES = {
    "default": dj_database_url.config(
        default="postgres://saleor:saleor@localhost:5432/saleor", conn_max_age=600
    )
}
...

Use username saleor and password saleor to connect to your database from pgadmin

 Database visualize 

Right click databse saleor -> generate ERD

Saleor service

1. Storefront : loalhost:3000
2. Dashboard:  loalhost:9000
3. GraphQL:  loalhost:8000