Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Improve docs
Patryk Zawadzki9c4487b459ae
diff --git a/docs/development.rst b/docs/development.rstnew file mode 100644index 0000000000..18f9af7ab7--- /dev/null+++ b/docs/development.rst@@ -0,0 +1,75 @@+Development+===========++Working with templates+----------------------++Default storefront templates are based on `Bootstrap 3 <http://getbootstrap.com/>`_.++You can find the files under ``/templates/``.+++Working with front-end assets+-----------------------------++All static assets live in subdirectories of ``/saleor/static/``.++Stylesheets are written in `Sass <http://sass-lang.com/>`_ and rely on `postcss <http://postcss.org/>`_ and `autoprefixer <https://autoprefixer.github.io/>`_ for cross-browser compatibility.++JavaScript code is written according to the ES2015 standard and relies on `Babel <https://babeljs.io/>`_ for transpilation and browser-specific polyfills.++Everything is compiled together using `webpack module bundler <https://webpack.github.io/>`_.++The resulting files are written to ``/saleor/static/assets/`` and should not be edited manually.++During development it's very convenient to have webpack automatically track changes made locally.+This will also enable *source maps* that are extremely helpful when debugging.++To run webpack in *watch* mode run:++.. code:: bash++ $ npm start++.. warning::++ Files produced this way are not ready for production use.+ To prepare static assets for deployment run:++ .. code:: bash++ $ npm run build-assets+++Working with backend code+-------------------------++Python dependencies+~~~~~~~~~~~~~~~~~~~++To guarantee repeatable installations all project dependencies are managed using `pip-tools <https://github.com/nvie/pip-tools>`_.+Project's direct dependencies are listed in ``requirements.in`` and running :code:`pip-compile` generates ``requirements.txt`` that has all versions pinned.++We recommend you use this workflow and keep ``requirements.txt`` under version control to make sure all computers and environments run exactly the same code.+++Running tests+-------------++Before you make any permanent changes in the code you should make sure they do not break existing functionality.++The project currently contains very little front-end code so the test suite only covers backend code.++To run backend tests use `pytest <http://docs.pytest.org/en/latest/>`_:++.. code:: bash++ $ py.test++You can also test against all supported versions of Django and Python.+This is usually only required if you want to contribute your changes back to Saleor.+To do so you can use `Tox <https://tox.readthedocs.io/en/latest/>`_:++.. code:: bash++ $ toxdiff --git a/docs/index.rst b/docs/index.rstindex 8f5eeb3669..043da2178f 100644--- a/docs/index.rst+++ b/docs/index.rst@@ -6,11 +6,12 @@ Contents:.. toctree:::maxdepth: 2- install- deploy+ installationstocksocialreporting+ development+ deploydiff --git a/docs/install.rst b/docs/install.rstdeleted file mode 100644index c4f7ddd506..0000000000--- a/docs/install.rst+++ /dev/null@@ -1,73 +0,0 @@-Installation-============--1. Clone the repository (or use your fork):-- .. code:: bash-- $ git clone https://github.com/mirumee/saleor.git---2. Enter the directory:-- .. code:: bash-- $ cd saleor/---3. Install all dependencies:-- .. code:: bash-- $ pip install -r requirements.txt---4. Set `SECRET_KEY` environmental variable.-- .. note::- Secret key has to be unique and must not be shared with anybody.-- .. code:: bash-- $ export SECRET_KEY='mysecretkey'---5. Prepare the database:-- .. code:: bash-- $ python manage.py migrate---6. Install front-end dependencies:-- .. note::- This step requires that you have Node.js installed. On Debian and Ubuntu systems you will also need to install the `nodejs-legacy` package.-- .. code:: bash-- $ npm install---7. Prepare front-end assets:-- .. code:: bash-- $ npm run build-assets---8. Run like a normal django project:-- .. code:: bash-- $ python manage.py runserver---Tests--------To run the test suite use:--.. code:: bash-- $ py.testdiff --git a/docs/installation.rst b/docs/installation.rstnew file mode 100644index 0000000000..6604a2ea1f--- /dev/null+++ b/docs/installation.rst@@ -0,0 +1,88 @@+Getting started+===============++Prerequisites+-------------++Before you are ready to run Saleor you will need certain software installed on your computer.++#. `Python <https://www.python.org/>`_ version 3.5 or 2.7++#. `pip <https://pip.pypa.io/en/stable/installing/>`_ if you're using an older release of Python 2.7++#. `Node.js <https://nodejs.org/>`_ version 4 or above++ .. note::++ Debian and Ubuntu users who install Node.js using system packages will also need to install the ``nodejs-legacy`` package.++#. `webpack module bundler <https://webpack.github.io/>`_ installed globally with:++ .. code:: bash++ $ npm i webpack -g++We also strongly recommend creating a virtual environment before proceeding with installation.+++Installation+------------++#. Clone the repository (or use your fork):++ .. code:: bash++ $ git clone https://github.com/mirumee/saleor.git+++#. Enter the directory:++ .. code:: bash++ $ cd saleor/+++#. Install all dependencies:++ .. code:: bash++ $ pip install -r requirements.txt+++#. Set `SECRET_KEY` environmental variable.++ .. note::++ Secret key has to be unique and must not be shared with anybody.++ .. code:: bash++ $ export SECRET_KEY='mysecretkey'+++#. Prepare the database:++ .. code:: bash++ $ python manage.py migrate+++#. Install front-end dependencies:++ .. code:: bash++ $ npm install+++#. Prepare front-end assets:++ .. code:: bash++ $ npm run build-assets+++#. Run like a normal django project:++ .. code:: bash++ $ python manage.py runserver