mirror of
https://github.com/penpot/penpot.git
synced 2025-03-10 14:51:37 -05:00
📚 Update documentation.
This commit is contained in:
parent
8caa5c6a65
commit
34d15e4192
4 changed files with 76 additions and 95 deletions
56
docs/00-Getting-Started.md
Normal file
56
docs/00-Getting-Started.md
Normal file
|
@ -0,0 +1,56 @@
|
|||
# Getting Started ##
|
||||
|
||||
This documentation intends to explain how to get penpot application and run it locally.
|
||||
|
||||
The simplest approach is using docker and docker-compose.
|
||||
|
||||
## Install Docker ##
|
||||
|
||||
Skip this section if you alreasdy have docker installed, up and running.
|
||||
|
||||
You can install docker and its dependencies from your distribution
|
||||
repositores with:
|
||||
|
||||
```bash
|
||||
sudo apt-get install docker docker-compose
|
||||
```
|
||||
|
||||
Or follow installation instructions from docker.com; (for debian
|
||||
https://docs.docker.com/engine/install/debian/).
|
||||
|
||||
Ensure that the docker is started and optionally enable it to start
|
||||
with the system:
|
||||
|
||||
```bash
|
||||
sudo systemctl start docker
|
||||
sudo systemctl enable docker
|
||||
```
|
||||
|
||||
And finally, add your user to the docker group:
|
||||
|
||||
```basb
|
||||
sudo usermod -aG docker $USER
|
||||
```
|
||||
|
||||
This will make use the docker without `sudo` command all the time.
|
||||
|
||||
NOTE: probably you will need to relogin again to make this change
|
||||
take effect.
|
||||
|
||||
|
||||
## Start penpot application ##
|
||||
|
||||
You can create it from scratch or take a base from the [penpot
|
||||
repository][1]
|
||||
|
||||
[1]: https://raw.githubusercontent.com/penpot/penpot/develop/docker/images/docker-compose.yaml
|
||||
|
||||
```bash
|
||||
wget https://raw.githubusercontent.com/penpot/penpot/develop/docker/images/docker-compose.yaml
|
||||
```
|
||||
|
||||
And then:
|
||||
|
||||
```bash
|
||||
docker-compose -p penpotest -f docker-compose.yaml up
|
||||
```
|
|
@ -54,12 +54,13 @@ development environment.**
|
|||
For start it, staying in this repository, execute:
|
||||
|
||||
```bash
|
||||
./manage.sh pull-devenv
|
||||
./manage.sh run-devenv
|
||||
```
|
||||
|
||||
This will do the following:
|
||||
|
||||
- Build the images if it is not done before.
|
||||
- Pulls the latest devenv image.
|
||||
- Starts all the containers in the background.
|
||||
- Attaches to the **devenv** container and executes the tmux session.
|
||||
- The tmux session automatically starts all the necessary services.
|
||||
|
@ -67,7 +68,7 @@ This will do the following:
|
|||
You can execute the individual steps manully if you want:
|
||||
|
||||
```bash
|
||||
./manage.sh build-devenv # builds the devenv docker image
|
||||
./manage.sh build-devenv # builds the devenv docker image (not necessary in normal sircumstances)
|
||||
./manage.sh start-devenv # starts background running containers
|
||||
./manage.sh run-devenv # enters to new tmux session inside of one of the running containers
|
||||
./manage.sh stop-devenv # stops background running containers
|
||||
|
@ -143,47 +144,3 @@ If some exception is raised when code is reloaded, just use
|
|||
later use `(restart)` again.
|
||||
|
||||
For more information, please refer to: `03-Backend-Guide.md`.
|
||||
|
||||
|
||||
## Start the testenv ##
|
||||
|
||||
The purpose of the testenv (Test Environment) is provide an easy way
|
||||
to get Penpot running in local pc without getting into the full
|
||||
development environment.
|
||||
|
||||
As first step we still need to build devenv image because that image
|
||||
is used to produce the production-like bundle of the application:
|
||||
|
||||
```bash
|
||||
./manage.sh build-devenv
|
||||
```
|
||||
|
||||
Once the image is build, you no longer need to rebuilt it until the
|
||||
devenv image is changed and this happens we make some structural
|
||||
changes or upgrading some dependencies.
|
||||
|
||||
Them, let's proceed to build the bundle (a directory that contains all
|
||||
the sources and dependencies of the platform ready to be deployed):
|
||||
|
||||
```bash
|
||||
./manage.sh build-bundle
|
||||
```
|
||||
|
||||
This will generate on current directory one file and one
|
||||
directory. The most important is the file like
|
||||
`uxbox-2020.09.09-1343.tar.xz`.
|
||||
|
||||
Then, let's proceed to build the docker images with the bundle
|
||||
generated from the previous step.
|
||||
|
||||
```bash
|
||||
./manage.sh build-testenv ./uxbox-2020.09.09-1343.tar.xz
|
||||
```
|
||||
|
||||
This will generate the necessary docker images ready to be executed.
|
||||
|
||||
And finally, start the docker-compose:
|
||||
|
||||
```bash
|
||||
./manage.sh start-testenv
|
||||
```
|
||||
|
|
|
@ -13,7 +13,6 @@ Backend accepts a bunch of configuration parameters (detailed above),
|
|||
that can be passed in different ways. The preferred one is using
|
||||
environment variables.
|
||||
|
||||
|
||||
This is a probably incomplete list of available options (with
|
||||
respective defaults):
|
||||
|
||||
|
@ -21,20 +20,19 @@ respective defaults):
|
|||
- `APP_PUBLIC_URI=http://localhost:3449`
|
||||
- `APP_DATABASE_USERNAME=` (default undefined, used from uri)
|
||||
- `APP_DATABASE_PASSWORD=` (default undefined, used from uri)
|
||||
- `APP_DATABASE_URI=postgresql://127.0.0.1/app`
|
||||
- `APP_DATABASE_URI=postgresql://127.0.0.1/penpot`
|
||||
- `APP_MEDIA_DIRECTORY=resources/public/media`
|
||||
- `APP_MEDIA_URI=http://localhost:6060/media/`
|
||||
- `APP_ASSETS_DIRECTORY=resources/public/static`
|
||||
- `APP_ASSETS_URI=ehttp://localhost:6060/static/`
|
||||
- `APP_SENDMAIL_BACKEND=console`
|
||||
- `APP_SENDMAIL_REPLY_TO=no-reply@nodomain.com`
|
||||
- `APP_SENDMAIL_FROM=no-reply@nodomain.com`
|
||||
- `APP_SMTP_DEFAULT_REPLY_TO=no-reply@example.com`
|
||||
- `APP_SMTP_DEFAULT_FROM=no-reply@example.com`
|
||||
- `APP_SMTP_ENABLED=` (default false, prints to console)
|
||||
- `APP_SMTP_HOST=` (default undefined)
|
||||
- `APP_SMTP_PORT=` (default undefined)
|
||||
- `APP_SMTP_USER=` (default undefined)
|
||||
- `APP_SMTP_PASSWORD=` (default undefined)
|
||||
- `APP_SMTP_SSL=` (default to `false`)
|
||||
- `APP_SMTP_TLS=` (default to `false`)
|
||||
- `APP_REDIS_URI=redis://localhost/0`
|
||||
- `APP_REGISTRATION_ENABLED=true`
|
||||
- `APP_REGISTRATION_DOMAIN_WHITELIST=""` (comma-separated domains, defaults to `""` which means that all domains are allowed)
|
||||
- `APP_DEBUG_HUMANIZE_TRANSIT=true`
|
||||
|
@ -57,6 +55,7 @@ respective defaults):
|
|||
- `APP_GITLAB_CLIENT_SECRET=` (default undefined)
|
||||
- `APP_GITLAB_BASE_URI=` (default https://gitlab.com)
|
||||
|
||||
|
||||
## REPL ##
|
||||
|
||||
The production environment by default starts a server REPL where you
|
||||
|
@ -64,43 +63,6 @@ can connect and perform diagnosis operations. For this you will need
|
|||
`netcat` or `telnet` installed in the server.
|
||||
|
||||
```bash
|
||||
$ rlwrap netcat localhost 5555
|
||||
$ rlwrap netcat localhost 6062
|
||||
user=>
|
||||
```
|
||||
|
||||
|
||||
## Import collections ##
|
||||
|
||||
This is the way we can preload default collections of images and icons to the
|
||||
running platform.
|
||||
|
||||
First of that, you need to have a configuration file (edn format) like
|
||||
this:
|
||||
|
||||
```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)$"}]}
|
||||
```
|
||||
|
||||
You can found a real example in `sample_media/config.edn` (that also
|
||||
has all the material design icon collections).
|
||||
|
||||
Then, you need to execute:
|
||||
|
||||
```bash
|
||||
clojure -Adev -X:fn-media-loader :path ../path/to/config.edn
|
||||
```
|
||||
|
||||
If you have a REPL access to the running process, you can execute it from there:
|
||||
|
||||
```clojure
|
||||
(require 'app.cli.media-loader)
|
||||
(uxbox.media-loader/run* "/path/to/config.edn")
|
||||
```
|
||||
|
|
|
@ -30,10 +30,16 @@ Frontend tests have to be compiled first, and then run with node.
|
|||
npx shadow-cljs compile tests && node target/tests.js
|
||||
```
|
||||
|
||||
## Linter
|
||||
|
||||
We can execute the linter for the whole codebase with the following command
|
||||
Or run the watch (that automatically runs the test):
|
||||
|
||||
```bash
|
||||
npx clj-kondo --lint common:backend/src:frontend/src
|
||||
npx shadow-cljs watch tests
|
||||
```
|
||||
|
||||
## Linter
|
||||
|
||||
We can execute the linter for the whole codebase with the following command:
|
||||
|
||||
```bash
|
||||
clj-kondo --lint common:backend/src:frontend/src
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue