This project was tested on python 3.5 See package.json for JS requirements and requirements.txt for python requirements
pip install pyenv
pyenv install 3.5.4
pyenv virtualenv 3.5.4 alterspace
pyenv activate alterspace
cp config/config.example.py config/config.py
pip install -r requirements.txt
I have noticed that there are problems with newer versions of node.
To get around this, I ran brew install nvm
(a node package manager)
and then nvm install 8.11.1
In another bash window:
cd frontend
npm install
cd ..
fab run
or, to run on a different port:
fab run:8000
We use Celery to handle all of our light-related tasks, since some tasks might take longer than others and we don't want that to clobber anything else we might want to be doing. Therefore, we need to start the Celery service in a different terminal session:
fab celery
In development, we need to serve both the flask app and vue frontend.
To serve files:
cd frontend
npm run serve
This command runs a live reload server at from http://127.0.0.1:8080/
Remember to build files before adding them to the source code:
$ cd frontend
$ npm run build
All built front-end files will be in alter-space/dist folder.
Now you should be able to visit http://127.0.0.1:5000/ and see everything working as intended.
Note: some static assets live in the /public folder. On build, these get copied over to the /dist folder instead of compiled using the webpack configuration.
We use the lovely vue-svgicon for dealing with svgs in Vue. To use, place all svg assets into frontend/svg-icons. Run the following command to compile (assets will be placed in frontend/src/components/icons):
$ cd ./frontend
$ npm run generate-icons
In your Vue component's script tag, import your icon
import './icons/your-icon';
In your vue component's template, place the svg
<svgicon icon="your-icon" width="60" height="60" :original="true" class="btn-default" stroke="0"></svgicon>