Skip to content

sungitly/isr

Repository files navigation

Intelligent Show Room (ISR)

Deployment Guide:

Prerequisite:

Steps:

  1. Clone project code
$ git clone git@github.com:5peng/ucdip.git
  1. List item
$ cd ucdip/isr/
$ virtualenv venv
  1. Activate venv
$ source venv/bin/activate
  1. Setup database
$ mysql -uroot -p
mysql > CREATE SCHEMA `isr` DEFAULT CHARACTER SET utf8;
mysql > CREATE USER 'isr'@'localhost' IDENTIFIED BY 'welcome';
mysql> GRANT ALL PRIVILEGES ON isr.* TO 'isr'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> exit;
$ export DATABASE_URL=mysql://isr:1qaz2wsx@localhost/isr?charset=utf8
  1. Setup redis
export REDIS_URL=redis://:foobared@localhost:6379
  1. Run app
make run-all
  1. Test application
$ export MODE=debug
$ python manage.py runserver
$ curl http://127.0.0.1:5000/api/stores/2/sales

The application runs OK if an empty json array is returned.

Others:

  • Setup supervisor
$ cp deploy/gunicorn.conf.sample deploy/gunicorn.conf # make changes as you want
$ cp deploy/isrd.conf.sample deploy/isrd.conf # make changes as you want
$ cp deploy/celeryd.conf.sample deploy/celeryd.conf # make changes as you want

Then add isrd.conf and celeryd.conf to /etc/supervisor.conf

  • Config nginx to dispatch request to gunicorn

  • Grunt tasks

  1. compile all scss and combine js files in projects with source map, without source code compress.
$ grunt dev
  1. compile all js files only (combine all js, without compress)
$ grunt shampoo:dev
  1. compile all scss files with source map, without compress.
$ make sass:dev
  1. compile all scss with source map and combine js files, with js files modify watcher (will automatic update target js after file changes).
$ grunt watch
  1. combine all js files (only) without compress and watch js file changes.
$ grunt shampoo:watch
  • Load lookups
  1. Setup lookups for a new store
$ python manage.py lookup setup -s <store_id>
  1. Reload lookupvalues for a lookup
$ python manage.py lookup reload --id <lookup_id> -l <lookup_values_csv_location>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published