📚 Update documentation.

This commit is contained in:
Andrey Antukh 2019-08-21 16:51:56 +00:00
parent 62856e005f
commit f45d687d2a
2 changed files with 72 additions and 91 deletions

View file

@ -44,92 +44,38 @@ We will use the `easy fix` mark for tag for indicate issues that are
easy for begginers. easy for begginers.
## Development environment ## ## Commit Message Guidelines ##
### Introduction ### We have very precise rules over how our git commit messages can be formatted.
The development environment consists in a docker container that mounts your local The commit message format is:
copy of the uxbox souce code directory tree and executes a tmux inside the container
in order to facilitate execute multiple processes inside.
```
<type>(<scope>): <subject>
### System requirements ### [body]
You should have `docker` installed in your system in order to set up properly [footer]
the uxbox development enviroment.
In debian like linux distributions you can install it executing:
```bash
sudo apt-get install docker
``` ```
Where type is:
### Start the docker container ### - `:bug:` a commit that fixes a bug
- `:sparkles:` a commit that adds feature
**Requires a minimum knowledge of tmux usage in order to use that development - `:recycle:` a commit that introduces a refactor
environment.** - `:lipstick:` a commit with cosmetic changes
- `:ambulance:` a commit that fixes critical bug
For start it, staying in this repository, execute: - `:books:` a commit that improves or adds documentation
- `:construction:`: a wip commit
```bash - `:construction_worker:` a commit with CI related stuff
./manage.sh run - `:boom:` a commit with breaking changes
``` - `:wrench:` a commit for config updates
- `:zap:` a commit with performance improvements
This will do the following: - `:whale:` a commit for docker related stuff
- `:rewind:` a commit that reverts changes
- Build the image if it is not done before. - `:paperclip:` a commit with other not relevant changes
- Download all repositories if them are not downloaded previously.
- Start a container with predefined tmux layout.
- Start all needed processes such as gulp and figwheel.
### First steps with tmux ###
Now having the the container running and tmux open inside the container, you are
free to execute any commands and open many shells as you want.
You can create a new shell just pressing the **Ctr+b c** shortcut. And **Ctrl+b w**
for switch between windows, **Ctrl+b &** for kill the current window.
### Inside the tmux session ###
#### UI ####
The UI related tasks starts automatically so you do not need do anything. The
**window 0** and **window 1** are used for the UI related environment.
#### Backend ####
The backend related environment is located in the **window 2**, and you can go
directly to it using `ctrl+b 2` shortcut.
By default this tasks are performed:
- Start postgresql.
- Load initial fixtures into the database.
The backend is not started automatically, and frontend code by default does not
requires that (because it uses a remote server on default config).
You can start it just execting the `run.sh` script:
```bash
./scripts/run.sh
```
You also can start an repl and strart the backend inside of them:
```bash
lein repl
```
And use `(start)` to start all the environment, `(stop)` for stoping it and
`(reset)` for restart with code reloading. If some exception is raised when
code is reloaded, just use `(refresh)` in order to finish correctly the
code swaping and later use `(reset)` again.
More info: https://gist.github.com/parmentf/035de27d6ed1dce0b36a
## Code of conduct ## ## Code of conduct ##

View file

@ -10,36 +10,56 @@
![UXBOX](https://piweek.com/images/projects/uxbox.jpg) ![UXBOX](https://piweek.com/images/projects/uxbox.jpg)
## Introduction ## ## Introduction ##
The open-source solution for design and prototyping. UXBOX is currently at an early development stage but we are working hard to bring you the beta version as soon as possible. Follow the project progress in Twitter or Github and stay tuned! The open-source solution for design and prototyping. UXBOX is
currently at an early development stage but we are working hard to
bring you the beta version as soon as possible. Follow the project
progress in Twitter or Github and stay tuned!
[See SVG specification](https://www.w3.org/Graphics/SVG/) [See SVG specification](https://www.w3.org/Graphics/SVG/)
## SVG based ## ## SVG based ##
UXBOX works with SVG, a standard format, for all your designs and prototypes . This means that all your stuff in UXBOX is portable and editable in many other vector tools and easy to use on the web. UXBOX works with SVG, a standard format, for all your designs and
prototypes . This means that all your stuff in UXBOX is portable and
editable in many other vector tools and easy to use on the web.
## Development ## ## Development ##
Most of the main operations can be done through the helper script `manage.sh`. Most of the main operations can be done through the helper script
`manage.sh`.
The development requires of UXBOX is done through a single docker
container. Each main service is opened in a different
[tmux](https://github.com/tmux/tmux) sessions.
The development requires of UXBOX is done through a single docker container. Each main service is opened in a different [tmux](https://github.com/tmux/tmux) sessions.
## Docker ## Docker
Docker is also used to build release images for backend and frontend. Use the helper script `manage.sh` to build the images. Docker is also used to build release images for backend and
You can run locally UXBOX through a docker-compose or by manually running the containers. frontend. Use the helper script `manage.sh` to build the images. You
can run locally UXBOX through a docker-compose or by manually running
the containers.
Complementary to the docker images you can build locally from this repository, you can find additionnal flavors for backend and frontend on external repositories: Complementary to the docker images you can build locally from this
repository, you can find additionnal flavors for backend and frontend
on external repositories:
* [Monogramm/docker-uxbox-frontend](https://github.com/Monogramm/docker-uxbox-frontend) * [Monogramm/docker-uxbox-frontend](https://github.com/Monogramm/docker-uxbox-frontend)
* [Monogramm/docker-uxbox-backend](https://github.com/Monogramm/docker-uxbox-backend) * [Monogramm/docker-uxbox-backend](https://github.com/Monogramm/docker-uxbox-backend)
### Persistent data ### Persistent data
The UXBOX installation and all data are stored in the database (file uploads, etc). The docker daemon will store that data within the docker directory `/var/lib/docker/volumes/...`. That means your data is saved even if the container crashes, is stopped or deleted.
To make your data persistent to upgrading and get access for backups is using named docker volume or mount a host folder. To achieve this you need one volume for your database container. The UXBOX installation and all data are stored in the database (file
uploads, etc). The docker daemon will store that data within the
docker directory `/var/lib/docker/volumes/...`. That means your data
is saved even if the container crashes, is stopped or deleted.
To make your data persistent to upgrading and get access for backups
is using named docker volume or mount a host folder. To achieve this
you need one volume for your database container.
Database: Database:
- `/var/lib/postgresql/data` PostgreSQL Data - `/var/lib/postgresql/data` PostgreSQL Data
@ -49,8 +69,12 @@ $ docker run -d \
postgresql postgresql
``` ```
You also need to persist the UXBOX backend public resources (media and assets) to not lose images uploaded and allow the frontend to expose assets. You also need to persist the UXBOX backend public resources (media and
assets) to not lose images uploaded and allow the frontend to expose
assets.
- `/srv/uxbox/resources/public` UXBOX backend public resources - `/srv/uxbox/resources/public` UXBOX backend public resources
```console ```console
$ docker run -d \ $ docker run -d \
-v db:/srv/uxbox/resources/public \ -v db:/srv/uxbox/resources/public \
@ -59,7 +83,8 @@ $ docker run -d \
### Auto configuration via environment variables ### Auto configuration via environment variables
The following environment variables are also honored for configuring your UXBOX instance: The following environment variables are also honored for configuring
your UXBOX instance:
#### Frontend #### Frontend
@ -103,13 +128,17 @@ Available at runtime:
- `-e UXBOX_REGISTRATION_ENABLED=...` (defaults to `true`) - `-e UXBOX_REGISTRATION_ENABLED=...` (defaults to `true`)
- `-e UXBOX_SECRET="..."` (defaults to `"5qjiAndGY3"`) - `-e UXBOX_SECRET="..."` (defaults to `"5qjiAndGY3"`)
**Important note:** make sure to use quotation marks for string variables or the backend might try to interpret the values as symbols and have weird issues. **Important note:** make sure to use quotation marks for string
variables or the backend might try to interpret the values as symbols
and have weird issues.
## Collections import ## Collections import
You can easily import icons and images as global stores with the backend collection importer: You can easily import icons and images as global stores with the
backend collection importer:
* Create a `media` folder with the following sample structure: * Create a `media` folder with the following sample structure:
``` ```
media media
icons icons
@ -117,8 +146,10 @@ media
images images
my-images-collection my-images-collection
``` ```
* Add some icons (SVG format) and images to your collection * Add some icons (SVG format) and images to your collection
* Create a `config.edn` file with the following content * Create a `config.edn` file with the following content
```clojure ```clojure
{:icons {:icons
[{:name "Generic Icons 1" [{:name "Generic Icons 1"
@ -130,7 +161,9 @@ media
:path "./images/my-images-collection/" :path "./images/my-images-collection/"
:regex #"^.*\.(png|jpg|webp)$"}]} :regex #"^.*\.(png|jpg|webp)$"}]}
``` ```
* Then go to the backend directory and import collections: * Then go to the backend directory and import collections:
```sh ```sh
clojure -Adev -m uxbox.cli.collimp ../media/config.edn clojure -Adev -m uxbox.cli.collimp ../media/config.edn
``` ```
@ -141,7 +174,9 @@ Take a look at the `sample_media` directory for a sample configuration.
**Open to you!** **Open to you!**
We love the open source software community. Contributing is our passion and because of this, we'll be glad if you want to participate and improve UXBOX. All your awesome ideas and code are welcome! We love the open source software community. Contributing is our
passion and because of this, we'll be glad if you want to participate
and improve UXBOX. All your awesome ideas and code are welcome!
Please refer to the [Contributing Guide](./CONTRIBUTING.md) Please refer to the [Contributing Guide](./CONTRIBUTING.md)