Skip to main content

E-commerce solution

Project description

First Timers Only

๐Ÿ‡ฒ๐Ÿ‡บ ๐Ÿ‡ต๐Ÿ‡ฐ ๐Ÿ‡ณ๐Ÿ‡ฌ ๐Ÿ‡ฎ๐Ÿ‡ณ

Discord OpenCollective

shopcube

shopcube is an e-commerce solution for shops. Complete with

  • ๐Ÿ›’ cart
  • โญ wishlist
  • ๐Ÿ“‘ orders
  • ๐Ÿ“ค upload by csv
  • ๐Ÿ“Š charts

If you want to contribute, go ahead, we โค๏ธ it. We follow a ๐Ÿ’ฏ % first-timers-friendly policy. Join #shopcube if you get stuck or would just like to chat and say hi.

Powered by Shopyo, a Python web framework built on top of Flask.

โšก Quick try

$ python -m pip install shopcube
$ shopcube initialise
$ shopcube rundebug

Go to http://127.0.0.1:5000

๐ŸŽซ Some explanations

Shopcube has two modes:

  • package mode if you want to just use the app as is
  • control mode if you want to see exactly what's going on

Package mode has several commands to manage the json settings file

$ shopcube showjson # show settings
$ shopcube copyjson # copy json file from site-packages in current directory
$ shopcube applyjson # apply json file in current directory
$ shopcube restorejson # restore original json file in site-packages
$ shopcube create # create new project named shopcube in current directory
$ shopcube packageinfo # path of project

Control mode allows you to use Shopyo commands as you would in any project

$ shopcube create 
$ ls shopcube/
โ”œโ”€โ”€ app.py
โ”œโ”€โ”€ config.example.json
โ”œโ”€โ”€ config.json
โ”œโ”€โ”€ config.py
โ”œโ”€โ”€ conftest.py
โ”œโ”€โ”€ file.log
โ”œโ”€โ”€ __init__.py
โ”œโ”€โ”€ init.py
โ”œโ”€โ”€ instance
โ”œโ”€โ”€ __main__.py
โ”œโ”€โ”€ modules
โ”œโ”€โ”€ __pycache__
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ setup.cfg
โ”œโ”€โ”€ static
โ”œโ”€โ”€ tests
โ”œโ”€โ”€ utils
โ””โ”€โ”€ wsgi.py
$ cd shopcube
$ shopyo initialise
$ shopyo rundebug

๐Ÿผ First time setup

  • Download and install the latest version of git.

  • Configure git with your username and email.

    $ git config --global user.name 'your name'
    $ git config --global user.email 'your email'
    
  • Make sure you have a GitHub account.

  • Fork shopcube to your GitHub account by clicking the Fork button.

  • Clone the main repository locally (make sure to have your SSH authentication setup!). Replace {username} with your username.

    $ git clone git@github.com:{username}/shopcube.git
    $ cd shopcube
    
  • Create a virtualenv named env and activate the virtual environment:

    Linux/macOS

    $ python3 -m venv env
    $ . env/bin/activate
    

    Windows

    > py -3 -m venv env
    > env\Scripts\activate
    
  • Upgrade pip and setuptools:

    $ python -m pip install --upgrade pip setuptools
    
  • Install the development dependencies and shopcube requirements:

    $ python -m pip install -r reqs/dev.txt
    
  • Now initialize the app by running:

    $ python -m pip install -e .
    $ cd src/shopcube
    $ shopyo initialise
    
  • Run shopcube:

    $ shopyo rundebug
    
  • Go to the link http://127.0.0.1:5000/ and you should see the shopcube app running.

  • Login as administrator by clicking on the login icon on the top right hand side of the screen.

    Enter admin@domain.com as the username and 'pass' as the pasword.

    After login, you should be directed to http://0.0.0.0:5000/dashboard/.

    # see config.json 
     "admin_user": {
          "email": "admin@domain.com",
          "password": "pass"
      }
    

โ†ฉ Pull Requests

--> Add flag to readme

Make sure you have setup the repo as explained in First time setup before making Pull Request (PR)

  • Create a branch for the issue you would like to work on:

    $ git fetch origin
    $ git checkout -b <your-branch-name> origin/dev
    

    Note

    As a sanity check, you can run git branch to see the current branch you are on in case your terminal is not setup to show the current branch.

  • Using your favorite editor, make your changes, committing as you go.

    $ git add <filenames to commit>
    $ git commit -m "<put commit message here>"
    
  • Push your commits to your fork on GitHub. The -u option allows your local branch to be pushed to your GitHub repo.

    $ git push -u origin your-branch-name
    
  • Create a pull request. You should see the PR link in the terminal after you successfully push your commits. Link to the issue being addressed with fixes #123 in the pull request. See example PR.

๐Ÿ”จ Troubleshooting Guide

If you need further assistance, ping @contributor on discord.

  • When I initialise the app, I get an error related to MySQL (ie: a Connection Error)

    In config.py, make sure you have a database URI

    SQLALCHEMY_DATABASE_URI = "mysql+pymysql://{username}:{password}@{server_name}/{db_name}".format(
        username='shopcube',
        password='pass1234-A',
        server_name='localhost',
        db_name='shopcube'
    ) 
    

    or paste the following into config.py inside of the class DevelopmentConfig(Config):

    SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(base_path, 'app.db')
    
  • I launched the app but nothing shows up in /dashboard.

  • Additional development insights?

๐Ÿณ In Action

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shopcube-4.1.0.tar.gz (6.2 MB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page