2018-10-24 15:55:29 -05:00
2018-11-25 07:36:46 -05:00
[uri_license]: https://www.mozilla.org/en-US/MPL/2.0
[uri_license_image]: https://img.shields.io/badge/MPL-2.0-blue.svg
[![License: MPL-2.0][uri_license_image]][uri_license]
2019-08-10 17:20:39 -05:00
[![Managed with Taiga.io ](https://img.shields.io/badge/managed%20with-TAIGA.io-709f14.svg )](https://tree.taiga.io/project/uxbox/ "Managed with Taiga.io")
2019-07-02 12:06:37 -05:00
[![Build Status ](https://travis-ci.org/uxbox/uxbox.svg )](https://travis-ci.org/uxbox/uxbox)
2018-10-24 15:55:29 -05:00
2016-11-20 14:08:24 -05:00
# UXBOX #
2017-03-01 04:58:57 -05:00
![UXBOX ](https://piweek.com/images/projects/uxbox.jpg )
2017-03-01 04:54:37 -05:00
2019-08-21 11:51:56 -05:00
2016-11-20 14:08:24 -05:00
## Introduction ##
2019-08-21 11:51:56 -05:00
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!
2017-03-01 04:54:37 -05:00
[See SVG specification ](https://www.w3.org/Graphics/SVG/ )
2019-12-09 10:28:15 -05:00
2017-03-01 04:54:37 -05:00
## SVG based ##
2016-11-20 14:08:24 -05:00
2019-08-21 11:51:56 -05:00
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.
2016-11-20 14:08:24 -05:00
2019-12-09 10:28:15 -05:00
2019-07-03 04:02:38 -05:00
## Development ##
2019-08-22 13:07:58 -05:00
### Introduction ###
2019-08-21 11:51:56 -05:00
2019-09-21 07:02:32 -05:00
The main development environment consists in a docker compose
configuration that starts the external services and the development
container (called **devenv** ).
We use tmux script in order to multiplex the signle terminal and run
both the backend and frontend in the same container.
2019-07-03 04:02:38 -05:00
2019-08-22 13:07:58 -05:00
### System requirements ###
2019-09-21 07:02:32 -05:00
You should have `docker` and `docker-compose` installed in your system
in order to set up properly the uxbox development enviroment.
2019-08-22 13:07:58 -05:00
In debian like linux distributions you can install it executing:
```bash
2019-09-21 07:02:32 -05:00
sudo apt-get install docker docker-compose
2019-08-22 13:07:58 -05:00
```
2019-09-21 07:02:32 -05:00
### Start the devenv ###
2019-08-22 13:07:58 -05:00
**Requires a minimum knowledge of tmux usage in order to use that
development environment.**
For start it, staying in this repository, execute:
```bash
./manage.sh run-devenv
```
This will do the following:
2019-09-21 07:02:32 -05:00
- Build the images if it is not done before.
- Starts all the containers in the background.
- Attaches to the **devenv** container and executes the tmux session.
2019-08-22 13:07:58 -05:00
### 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 ####
2019-09-21 07:02:32 -05:00
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.
2019-08-22 13:07:58 -05:00
#### Backend ####
2019-09-21 07:02:32 -05:00
The backend related environment is located in the **window 2** , and
you can go directly to it using `ctrl+b 2` shortcut.
2019-08-22 13:07:58 -05:00
2019-09-21 07:02:32 -05:00
By default the clojure repl will be executed, waiting you to run
commands or start the http server.
2019-08-22 13:07:58 -05:00
Then use `(start)` to start all the environment, `(stop)` for stoping
it and `(reset)` for restart with code reloading. If some exception is
2019-09-21 07:02:32 -05:00
raised when code is reloaded, just use `(repl/refresh)` in order to finish
2019-08-22 13:07:58 -05:00
correctly the code swaping and later use `(reset)` again.
2019-09-21 07:02:32 -05:00
If this is your first run, you maybe want to load fixtures first. Then
you can done this in two ways:
- In the same repl, require the `uxbox.fixtures` namespace and execute
`(uxbox.fixtures/-main [])` .
- Stop the repl with `Ctrl+c` and then execute `clojure -Adev -m
uxbox.fixtures`; then start the repl again with `clojure -Adev:repl` .
2019-08-22 13:07:58 -05:00
## Production (Docker)
2019-02-17 09:35:28 -05:00
2019-08-21 11:51:56 -05:00
Docker is also used to build release images for backend and
2019-09-21 07:02:32 -05:00
frontend. Use the helper script `manage.sh` to build the images. You
2019-08-21 11:51:56 -05:00
can run locally UXBOX through a docker-compose or by manually running
the containers.
2019-07-03 04:02:38 -05:00
2019-08-21 11:51:56 -05:00
Complementary to the docker images you can build locally from this
repository, you can find additionnal flavors for backend and frontend
on external repositories:
2019-07-03 04:02:38 -05:00
* [Monogramm/docker-uxbox-frontend ](https://github.com/Monogramm/docker-uxbox-frontend )
* [Monogramm/docker-uxbox-backend ](https://github.com/Monogramm/docker-uxbox-backend )
2019-02-17 09:35:28 -05:00
### Persistent data
2019-02-14 07:07:13 -05:00
2019-08-21 11:51:56 -05:00
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.
2019-09-21 07:02:32 -05:00
The default production docker-compose already handles it for you,
but if you. So check the `docker/docker-compose.yml` file.
2019-02-14 07:07:13 -05:00
2019-07-03 04:02:38 -05:00
2020-01-14 04:35:43 -05:00
### Configuration via environment variables
2019-02-15 18:59:31 -05:00
2019-08-21 11:51:56 -05:00
The following environment variables are also honored for configuring
your UXBOX instance:
2019-02-15 18:59:31 -05:00
2019-09-21 07:02:32 -05:00
2019-02-17 09:35:28 -05:00
#### Frontend
2019-02-20 10:46:07 -05:00
**Only available at build time!**
2019-07-03 04:02:38 -05:00
- `-e UXBOX_API_URL=...` (defaults to `/api` )
- `-e UXBOX_VIEW_URL=...` (defaults to `/view/` )
2020-01-14 04:35:43 -05:00
- `-e UXBOX_DEMO_WARNING=...` (not defined, setting any value will activate demo mode)
2019-02-20 10:46:07 -05:00
Available at runtime:
2019-07-03 04:02:38 -05:00
- `-e LANG=...` (defaults to `en_US.UTF-8` )
- `-e LC_ALL=...` (defaults to `C.UTF-8` )
2019-02-15 18:59:31 -05:00
2019-02-17 09:35:28 -05:00
#### Backend
2019-02-20 10:46:07 -05:00
Available at runtime:
2019-07-03 04:02:38 -05:00
- `-e LANG=...` (defaults to `en_US.UTF-8` )
- `-e LC_ALL=...` (defaults to `C.UTF-8` )
- `-e UXBOX_HTTP_SERVER_PORT=...` (defaults to `6060` )
- `-e UXBOX_HTTP_SERVER_DEBUG=...` (defaults to `true` )
2019-08-09 09:49:01 -05:00
- `-e UXBOX_HTTP_SERVER_CORS=...` (defaults to `http://localhost:3449` )
2019-07-03 04:02:38 -05:00
- `-e UXBOX_DATABASE_USERNAME="..."` (defaults to `nil` )
- `-e UXBOX_DATABASE_PASSWORD="..."` (defaults to `nil` )
2019-07-19 07:36:23 -05:00
- `-e UXBOX_DATABASE_URI="..."` (defaults to ` ` , will be computed based on other DATABASE parameters if empty)
2019-07-03 04:02:38 -05:00
- `-e UXBOX_DATABASE_NAME="..."` (defaults to `"uxbox"` )
- `-e UXBOX_DATABASE_SERVER="..."` (defaults to `"localhost"` )
- `-e UXBOX_DATABASE_PORT=...` (defaults to `5432` )
- `-e UXBOX_MEDIA_DIRECTORY=...` (defaults to `resources/public/media` )
- `-e UXBOX_MEDIA_URI=...` (defaults to `http://localhost:6060/media/` )
- `-e UXBOX_ASSETS_DIRECTORY=...` (defaults to `resources/public/static` )
- `-e UXBOX_ASSETS_URI=...` (defaults to `http://localhost:6060/static/` )
- `-e UXBOX_EMAIL_REPLY_TO="..."` (defaults to `no-reply@uxbox.io` )
- `-e UXBOX_EMAIL_FROM="..."` (defaults to `no-reply@uxbox.io` )
- `-e UXBOX_SUPPORT_EMAIL="..."` (defaults to `support@uxbox.io` )
- `-e UXBOX_SMTP_HOST="..."` (defaults to `"localhost"` )
- `-e UXBOX_SMTP_PORT=...` (defaults to `25` )
- `-e UXBOX_SMTP_USER="..."` (defaults to `nil` )
- `-e UXBOX_SMTP_PASSWORD="..."` (defaults to `nil` )
- `-e UXBOX_SMTP_SSL=...` (defaults to `false` )
- `-e UXBOX_SMTP_TLS=...` (defaults to `false` )
- `-e UXBOX_SMTP_ENABLED=...` (defaults to `false` )
- `-e UXBOX_REGISTRATION_ENABLED=...` (defaults to `true` )
- `-e UXBOX_SECRET="..."` (defaults to `"5qjiAndGY3"` )
2019-02-17 09:35:28 -05:00
2019-08-21 11:51:56 -05:00
**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.
2019-02-15 18:59:31 -05:00
2019-09-21 07:02:32 -05:00
2019-07-19 07:03:21 -05:00
## Collections import
2019-08-21 11:51:56 -05:00
You can easily import icons and images as global stores with the
backend collection importer:
2019-07-19 07:03:21 -05:00
* Create a `media` folder with the following sample structure:
2019-08-21 11:51:56 -05:00
2019-07-19 07:03:21 -05:00
```
media
icons
my-icons-collection
images
my-images-collection
```
2019-08-21 11:51:56 -05:00
2019-07-19 07:03:21 -05:00
* Add some icons (SVG format) and images to your collection
* Create a `config.edn` file with the following content
2019-08-21 11:51:56 -05:00
2019-07-19 07:03:21 -05:00
```clojure
{:icons
[{:name "Generic Icons 1"
:path "./icons/my-icons-collection/"
:regex #"^.*_48px\.svg$"}
]
:images
[{:name "Generic Images 1"
:path "./images/my-images-collection/"
:regex #"^.*\.(png|jpg|webp)$"}]}
```
2019-08-21 11:51:56 -05:00
2019-07-19 07:03:21 -05:00
* Then go to the backend directory and import collections:
2019-08-21 11:51:56 -05:00
2019-07-19 07:03:21 -05:00
```sh
clojure -Adev -m uxbox.cli.collimp ../media/config.edn
```
Take a look at the `sample_media` directory for a sample configuration.
2019-09-21 07:02:32 -05:00
2017-02-24 13:25:11 -05:00
## Contributing ##
2016-11-20 14:08:24 -05:00
2017-03-01 04:54:37 -05:00
**Open to you!**
2019-08-21 11:51:56 -05:00
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!
2017-03-01 04:54:37 -05:00
Please refer to the [Contributing Guide ](./CONTRIBUTING.md )
2016-11-20 14:08:24 -05:00
2019-09-21 07:02:32 -05:00
2016-11-20 14:08:24 -05:00
## License ##
```
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
```