River Admin
consists of two parts that are backend and ui.
It is built with Django Rest Framework on the backend
side whereas Vue on the front end side.
River Admin
backend side is built with Django
and Django Rest Framework. So you need Django
development environment to be set up.
Install the dependencies
pip install -r requirements.txt
Install Tox to run the tests for all environments.
pip install tox
Install Twine and other necessary packages to upload packages to
PyPI
pip install wheel setuptools twine
You are ready to develop the backend side now.
python manage.py runserver
Tox is used on the backend side to automate Python
& Django
testing. Tests are under river-admin/tets/
. Simply run
tox
To run it for a specific environment;
tox -e py34-dj2.1
River Admin
ui is built with Vue. So you need Vue
development environment to be set up.
Install
node
&npm
Install
yarn
(Install Yarn)Install dependencies
yarn install
While developing the front end Vue
app of River Admin
,
you can run it without building it and the server will
auotmatically reload on any changes in the code. This is quite
useful thing for fast feedback and debugging. One thing you
should make sure before you run this, backend server is also
running since it needs to call the backend
python manage.py runserveryarn serve
UI tests are written with Jest javascript testing
framework from Facebook. Tests are under ui/tets/
.
To run the tests simply;
yarn test:unit
To run a specific one;
yarn test:unit StateInput.spec.js
To run the tests with a fresh snapshot (to clean the snapshots);
yarn test:unit -u
yarn build
The distribution folders of the Vue
app are
river_admin/templates
and river_admin/static
.
The reason for that is because a Django
app should
contains all the html
and static
files under
templates
and static
folders.