Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Quick notes

The Quick notes application, is an application to take quick notes -Forgive the
redundancy :sweat_smile:- on small cards, organizedby colors and tags. It allows
a basic rich text as **Bold**, *italic*, and numbered or bullet list to improve
the notes. Also it allows attaching files, and the notes can be shared as
read-only to other users.
The Quick notes application is a tool to take quick notes (forgive the
redundancy :sweat_smile:) on small cards, organized by colors and tags. It
supports basic rich text formatting such as **bold**, *italic*, and numbered or
bullet lists to enhance your notes. It also allows attaching files, and the
notes can be shared as read-only with other users.

![Screenshot of Quick notes](/doc/quicknotes-grid-view.jpeg "App screenshot")

## :heart: Support

If you'd like to support the creation and maintenance of this software, consider
donating.
If you'd like to support the creation and maintenance of this software, please
consider donating.

[![Donate](https://img.shields.io/badge/Donate-PayPal-blue)](https://github.com/matiasdelellis/quicknotes/wiki/Donate)
[![Donate](https://img.shields.io/badge/Donate-Bitcoin-orange)](https://github.com/matiasdelellis/quicknotes/wiki/Donate)
Expand All @@ -20,25 +20,31 @@ donating.
## :rocket: Installation

Quick notes is available in the Nextcloud App Store and can be installed
directly from your Nextcloud installation looking in the category Office.
directly from your Nextcloud instance by browsing to the Office category.

Nextcloud will notify you about possible updates. Please have a look at
Nextcloud will notify you about available updates. Please have a look at
[CHANGELOG.md](CHANGELOG.md) for details about changes.

## :exclamation: Bugs

Before reporting bugs:

* Get the newest version of the Quick notes app
* Please consider also installing the [latest development version](https://github.com/matiasdelellis/quicknotes.git)
* [Check if they have already been reported](https://github.com/matiasdelellis/quicknotes/issues)
* Make sure you are running the latest version of the Quick notes app.
* Consider also installing the [latest development version](https://github.com/matiasdelellis/quicknotes.git).
* [Check whether the issue has already been reported](https://github.com/matiasdelellis/quicknotes/issues).

## Building the app

1. Clone this into your `apps` folder of your Nextcloud: `git clone https://github.com/matiasdelellis/quicknotes.git`
2. In a terminal, just run the command `make` to install the dependencies and build the aplication.
3. Enable the app through the app management of your Nextcloud.
1. Clone this repository into your Nextcloud `apps` folder: `git clone https://github.com/matiasdelellis/quicknotes.git`.
2. In a terminal, run `make` to install the dependencies and build the application.
3. Enable the app from the Apps management page of your Nextcloud instance.

## Local development with Docker

A self-contained Docker environment is provided under the [`docker/`](docker/)
folder. See [docker/README.md](docker/README.md) for details on how to spin up
a Nextcloud + MariaDB stack with this app mounted as `custom_apps/quicknotes`.

## Translating

Join project on https://www.transifex.com/matias/quicknotes/
Join the project on https://www.transifex.com/matias/quicknotes/
10 changes: 10 additions & 0 deletions docker/.env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
# Copy this file to `../.env` and adjust the values to your needs.
# All variables are consumed by docker-compose.yml.

# --- MariaDB ---------------------------------------------------------------
MARIADB_ROOT_PASSWORD=changeme-root
MARIADB_DATABASE=nextcloud
MARIADB_USER=nextcloud
MARIADB_PASSWORD=changeme-db

# --- Nextcloud HTTP port ---------------------------------------------------
# Host port mapped to the container's port 80.
NEXTCLOUD_HTTP_PORT=8080

# --- Nextcloud admin account ----------------------------------------------
NEXTCLOUD_ADMIN_USER=admin
NEXTCLOUD_ADMIN_PASSWORD=changeme-admin

# Comma-separated list of hostnames/IPs that Nextcloud should trust.
NEXTCLOUD_TRUSTED_DOMAINS=localhost:8080
# Use "http" for plain local development; switch to "https" behind a reverse proxy.
NEXTCLOUD_OVERWRITEPROTOCOL=http
124 changes: 64 additions & 60 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Entorno de desarrollo local (Docker)
# Local development environment (Docker)

Levanta un Nextcloud 32 + MariaDB y monta este repositorio dentro de
`custom_apps/quicknotes` para poder probar la app sin instalar Nextcloud
a mano.
Spins up a Nextcloud 32 + MariaDB stack and mounts this repository into
`custom_apps/quicknotes`, so you can try the app without installing
Nextcloud manually.

Todo lo necesario para el entorno vive en este directorio:
Everything required for the environment lives in this directory:

```
docker/
Expand All @@ -15,100 +15,104 @@ docker/
│ ├── down.sh
│ ├── build.sh
│ └── enable-app.sh
└── README.md ← este archivo
└── README.md ← this file
```

## Requisitos
## Requirements

- Docker 20.10+ y Docker Compose v2 (o `docker-compose` v1.29+)
- ~2 GB de RAM libres
- Puertos: `8080` (configurable en `.env`)
- Docker 20.10+ and Docker Compose v2 (or `docker-compose` v1.29+)
- ~2 GB of free RAM
- Port: `8080` (configurable in `.env`)

## Arranque rápido
## Quick start

```bash
# 1) Configurar credenciales (la primera vez)
# 1) Configure credentials (only the first time)
cp .env.example .env
# editar .env si querés cambiar puertos/contraseñas
# edit .env if you want to change ports/passwords

# 2) Levantar y habilitar la app
# 2) Bring the stack up and enable the app
./docker/scripts/up.sh
```

> Nota: el `.env` se mantiene en la raíz del repo para que `docker
> compose` (que busca `.env` relativo al compose) lo encuentre. Si
> preferís tenerlo todo dentro de `docker/`, mové `.env` también a esa
> carpeta y borrá el `--env-file` que pasa `up.sh`.
> Note: the `.env` file is kept at the repository root so that
> `docker compose` (which looks for `.env` relative to the compose file)
> can find it. If you prefer to keep everything inside `docker/`, move
> `.env` into that folder as well and drop the `--env-file` flag that
> `up.sh` passes.

El script:
1. Levanta MariaDB y Nextcloud.
2. **Si faltan assets compilados** (`js/templates.js`, `js/vendor/`,
`js/quicknotes-*.js`), corre `./docker/scripts/build.sh`
automáticamente usando el servicio `builder` (Node 20) de
docker-compose.
3. Espera a que Nextcloud termine el primer arranque.
4. Pregunta si querés habilitar Quick notes (responde `s`).
The script:

Una vez listo, abrí <http://localhost:8080> y entrá con las credenciales
definidas en `.env` (`NEXTCLOUD_ADMIN_USER` / `NEXTCLOUD_ADMIN_PASSWORD`).
1. Brings MariaDB and Nextcloud up.
2. **If compiled assets are missing** (`js/templates.js`, `js/vendor/`,
`js/quicknotes-*.js`), it automatically runs `./docker/scripts/build.sh`
using the `builder` service (Node 20) from the compose file.
3. Waits for Nextcloud to finish its first-time setup.
4. Asks whether you want to enable Quick notes (answer `y`).

## Compilar assets manualmente
Once everything is ready, open <http://localhost:8080> and sign in with the
credentials defined in `.env` (`NEXTCLOUD_ADMIN_USER` /
`NEXTCLOUD_ADMIN_PASSWORD`).

Si tocás un `.vue` en `src/components/`, un template Handlebars en
`js/templates/` o un `.js` en `js/`, hay que re-compilar:
## Building assets manually

If you edit a `.vue` file in `src/components/`, a Handlebars template in
`js/templates/`, or any other JS file, you need to re-build:

```bash
./docker/scripts/build.sh
```

El build se hace dentro del contenedor `quicknotes-builder` (Node 20)
y escribe los artefactos en el host, que ya están montados en
`custom_apps/quicknotes` dentro de Nextcloud. Para que el navegador
tome los cambios, refrescá con Ctrl+Shift+R (Nextcloud cachea JS
agresivamente).
The build runs inside the `quicknotes-builder` container (Node 20) and
writes the artifacts to the host, where they are already mounted into
`custom_apps/quicknotes` inside Nextcloud. For the browser to pick up
the changes, hard-reload with Ctrl+Shift+R (Nextcloud caches JS
aggressively).

## Comandos útiles
## Useful commands

```bash
# Re-habilitar la app luego de cambios de código PHP/templates
# Re-enable the app after PHP/templates changes
./docker/scripts/enable-app.sh

# Re-compilar assets luego de tocar .vue, .handlebars, .js
# Re-build assets after editing .vue, .handlebars or .js files
./docker/scripts/build.sh

# Entrar al contenedor de Nextcloud
# Open a shell inside the Nextcloud container
docker exec -it -u www-data quicknotes-app bash

# Ver logs de Nextcloud
# Tail the Nextcloud logs
docker logs -f quicknotes-app

# Ver logs de la DB
# Tail the database logs
docker logs -f quicknotes-db

# Bajar los contenedores (conservando los datos)
# Stop the containers (preserving data)
./docker/scripts/down.sh

# Bajar y borrar TODO (DB + archivos de Nextcloud + caché de npm)
# Stop the containers and wipe EVERYTHING (DB + Nextcloud files + npm cache)
./docker/scripts/down.sh --purge
```

## Cómo funciona
## How it works

- `docker-compose.yml` define tres servicios: `db` (MariaDB 11.4),
`app` (Nextcloud 32) y `builder` (Node 20, para compilar assets).
- El directorio raíz del repo se monta como volumen en
`/var/www/html/custom_apps/quicknotes` (los volúmenes del compose
usan `../` para salir de `docker/` y montar el proyecto completo).
- Los datos persistentes (DB + `data/`, `config/`, `apps/` no montados)
viven en los volúmenes `quicknotes_db`, `quicknotes_nc` y
`quicknotes_npm_cache`.
- `docker-compose.yml` defines three services: `db` (MariaDB 11.4),
`app` (Nextcloud 32) and `builder` (Node 20, used to build assets).
- The repository root is bind-mounted into
`/var/www/html/custom_apps/quicknotes` (the compose volumes use
`../` to step out of `docker/` and mount the whole project).
- Persistent data (database + `data/`, `config/`, unmounted `apps/`)
lives in the `quicknotes_db`, `quicknotes_nc` and `quicknotes_npm_cache`
volumes.

## Limitaciones
## Limitations

- El `info.xml` declara la app para Nextcloud 32. Si necesitás otra
versión, cambiá el tag de la imagen en `docker-compose.yml` (p. ej.
- `info.xml` declares the app for Nextcloud 32. If you need a different
version, change the image tag in `docker-compose.yml` (e.g.
`nextcloud:31`).
- SELinux en Enforcing requiere el sufijo `:z` en el bind mount (ya
está configurado). Si tu distro no usa SELinux podés sacarlo.
- El bundle Vue de dashboard pesa ~3 MB (warning de webpack). Es
tamaño aceptable para dev; la app oficial lo reduce con code-split.
- SELinux in Enforcing mode requires the `:z` suffix on the bind mounts
(already configured). If your distribution does not use SELinux, you
can remove it.
- The dashboard Vue bundle is ~3 MB (webpack warning). That is
acceptable for development; the shipped app reduces it with
code-splitting.
15 changes: 15 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Local development stack for the Quick notes Nextcloud app.
# See ../docker/README.md for usage instructions.
name: quicknotes

services:
# MariaDB 11.4 — backing store for Nextcloud.
db:
image: mariadb:11.4
container_name: quicknotes-db
restart: unless-stopped
# READ-COMMITTED + ROW-based binlog are the settings recommended by Nextcloud
# for use with MariaDB / MySQL.
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
environment:
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
Expand All @@ -19,6 +24,9 @@ services:
timeout: 5s
retries: 10

# Nextcloud 32 — the application server. The repository is bind-mounted into
# custom_apps/quicknotes so changes to the code are picked up live. The
# `:z` SELinux relabeling option is required when SELinux is in Enforcing mode.
app:
image: nextcloud:32
container_name: quicknotes-app
Expand All @@ -39,13 +47,20 @@ services:
NEXTCLOUD_OVERWRITEPROTOCOL: ${NEXTCLOUD_OVERWRITEPROTOCOL}
volumes:
- nc:/var/www/html
# Mount the parent directory (the repository root) into the Nextcloud
# custom_apps folder. The leading `../` steps out of this `docker/`
# directory so the whole project ends up in the right place.
- ../:/var/www/html/custom_apps/quicknotes:z
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost/status.php"]
interval: 30s
timeout: 10s
retries: 5

# Node 20 — used solely to build the front-end assets. Trigger the build
# with `docker/scripts/build.sh`. The container stays idle (`sleep infinity`)
# between builds; dependencies and the npm cache are persisted via the
# `npm_cache` volume.
builder:
image: node:20-bookworm
container_name: quicknotes-builder
Expand Down
16 changes: 8 additions & 8 deletions docker/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env bash
# Compila los assets de la app (vendors JS, templates Handlebars, bundles Vue).
# Requiere el servicio `builder` del docker-compose (node:20).
# Builds the app assets (JS vendors, precompiled Handlebars templates, Vue bundles).
# Requires the `builder` service from docker-compose (node:20).
set -euo pipefail

cd "$(dirname "$0")/.." # -> docker/

if ! docker compose ps builder --status running >/dev/null 2>&1; then
echo ">> El servicio 'builder' no está corriendo. Levantando..."
echo ">> The 'builder' service is not running. Starting it..."
docker compose up -d builder
echo ">> Esperando a que 'builder' esté listo..."
echo ">> Waiting for 'builder' to be ready..."
for i in {1..30}; do
if docker compose ps builder --status running >/dev/null 2>&1; then
break
Expand All @@ -17,15 +17,15 @@ if ! docker compose ps builder --status running >/dev/null 2>&1; then
done
fi

echo ">> Ejecutando make build dentro del contenedor builder..."
echo ">> Running the build inside the builder container..."
docker compose exec -T builder sh -c '
set -e
cd /app

echo "[1/3] npm install (puede tardar varios minutos la primera vez)..."
echo "[1/3] npm install (may take several minutes the first time)..."
npm ci --no-audit --no-fund || npm install --no-audit --no-fund

echo "[2/3] copy deps (depsmin) + precompilar templates handlebars..."
echo "[2/3] Copy vendors (depsmin) + precompile Handlebars templates..."
mkdir -p vendor js/vendor css/vendor
rm -rf js/vendor/*
cp node_modules/handlebars/dist/handlebars.min.js js/vendor/handlebars.js
Expand All @@ -37,7 +37,7 @@ docker compose exec -T builder sh -c '

node_modules/.bin/handlebars js/templates -f js/templates.js

echo "[3/3] webpack build (vue + js principal)..."
echo "[3/3] Webpack build (Vue + main JS)..."
npm run build

echo ""
Expand Down
6 changes: 3 additions & 3 deletions docker/scripts/down.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
# Baja los contenedores y opcionalmente borra volúmenes.
# Stops the containers and (optionally) wipes their volumes.
set -euo pipefail

cd "$(dirname "$0")/.." # -> docker/

if [[ "${1:-}" == "--purge" || "${1:-}" == "-p" ]]; then
echo ">> Bajando contenedores y borrando volúmenes..."
echo ">> Stopping containers and removing volumes..."
docker compose down -v
else
echo ">> Bajando contenedores (los volúmenes se conservan)..."
echo ">> Stopping containers (volumes are preserved)..."
docker compose down
fi
Loading
Loading