travel-journal/travel-journal

A simple solution to create your own little travel journal

Maintainers

Package info

codeberg.org/travel-journal/travel-journal

Type:project

pkg:composer/travel-journal/travel-journal

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

v1.0.1 2026-05-23 21:34 UTC

This package is auto-updated.

Last update: 2026-05-23 21:37:27 UTC


README

A simple solution to create your own little travel book.

(c) 2026 Anna-Lena Schwarz & Thomas Artmann

Released under the GNU General Public License, version 3 (or later). See the LICENSE and NOTICE files for details.

Installation

Requirements: Docker and Docker Compose, Composer, Make.

  1. Create the project:

    composer create-project travel-journal/travel-journal my-travel-journal
    cd my-travel-journal
    
  2. Run the one-time setup (starts containers, installs PHP and frontend dependencies, builds assets, runs migrations, imports map data and loads dev fixtures):

    make setup
    
  3. Open the app in your browser (default: http://localhost:3001). Log in with the dev user:

    • Email: admin@example.com
    • Password: admin

To change the port, set APPLICATION_PORT in .env (e.g. APPLICATION_PORT=8080) before running make setup, or adjust and run make start again.

Configuration (environment variables)

Configure the app by editing .env (or .env.local for local overrides). After make setup, .env is created from .env.dist; adjust values as needed.

Required / core

VariableDescription
APP_SECRETSecret used for cookies, CSRF, etc. Set to a random string in production.
DATABASE_URLPostgreSQL connection URL. Default in .env.dist uses POSTGRES_* for Docker.
MESSENGER_TRANSPORT_DSNMessenger transport (e.g. amqp://... for RabbitMQ). Default uses RABBITMQ_USER / RABBITMQ_PASSWORD.
MAILER_DSNMailer DSN (e.g. smtp://... or null:// to disable). Dev default: smtp://mailpit:1025.
DEFAULT_URIBase URL of the app (e.g. http://localhost:3001). Used for absolute URLs in mails and links.

Application

VariableDescription
APPLICATION_PORTPort the web container exposes (default: 3001).
TIMEZONEApplication timezone (e.g. UTC, Europe/Berlin).
IS_PREVIEW_SYSTEMSet to 1 or true to enable preview/system mode (e.g. hides certain UI).
TRUSTED_PROXIESComma-separated list of trusted proxy IPs (or REMOTE_ADDR). Required when behind a reverse proxy.

Optional

VariableDescription
MAILER_FROM_NAMESender name used for outgoing emails.
MAILER_FROM_ADDRESSSender email address for outgoing emails.
ALLOW_FORCE_RESETSet to true to allow force-reset behaviour (e.g. in staging).
CREATE_MOCK_JOURNEYSSet to 1 when loading fixtures to create mock journeys (dev/testing).

Docker / Compose

These are used by compose.yaml and by the DATABASE_URL / MESSENGER_TRANSPORT_DSN defaults in .env.dist:

VariableDescription
POSTGRES_VERSIONPostgreSQL image version (default: 16).
POSTGRES_DBDatabase name.
POSTGRES_USERDatabase user.
POSTGRES_PASSWORDDatabase password.
RABBITMQ_USERRabbitMQ user.
RABBITMQ_PASSWORDRabbitMQ password.

Development only

VariableDescription
VAR_DUMPER_SERVERSymfony dump server (e.g. clone for the browser client).

Deployment

The project includes a script deploy.sh that deploys a branch to a server via SSH: it ensures the server has the repo (clone or pull), creates .env from .env.dist if missing, checks that APPLICATION_PORT is free, then runs make restart-prod on the server (build, composer install --no-dev, frontend build, migrations, cache warmup).

Prerequisites

On the server:

  • SSH access (key-based or password) for the user you deploy as.
  • Git installed.
  • Docker and Docker Compose (v2: docker compose) installed.
  • The Git repository must be reachable from the server (e.g. public HTTPS clone URL, or SSH URL if the server has the right keys).
  • The deploy path must exist and be writable by that user (the script can create the directory if it does not exist).
  • The port you use for the app (APPLICATION_PORT in .env) must be free on the server (no other service listening).

On your machine (where you run ./deploy.sh):

  • Bash, Git, SSH client.
  • A .deploy.env file in the project root (see below). Do not commit this file; it contains server and path details.

Configure .deploy.env

Create .deploy.env in the project root and set:

VariableDescription
REPOSITORY_URLGit repository URL (HTTPS or SSH) the server will clone/pull from.
INSTALLATION_PATHBase path on the server. The branch name is appended (e.g. main$INSTALLATION_PATH/main).
SSH_USERSSH user on the server.
SSH_HOSTServer hostname or IP.
SSH_PORTSSH port (default: 22).

Example:

REPOSITORY_URL="https://codeberg.org/your-org/travel-journal.git"
INSTALLATION_PATH="/var/www/vhosts/travel-journal"
SSH_USER="deploy"
SSH_HOST="travel-journal.example.com"
SSH_PORT="22"

The script sources .deploy.env, so the same variable names as in deploy.sh (e.g. REPOSITORY_URL) must be set there.

Run a deployment

From the project root:

./deploy.sh [branch]

If you omit branch, it defaults to main. The app is deployed to $INSTALLATION_PATH/$branch.

First-time setup and aftercare on the server

  1. First deploy
    Run ./deploy.sh (or ./deploy.sh main). The script will clone the repo, create .env from .env.dist if needed, then run make restart-prod. The app will be available once the containers are up.

  2. Configure production .env
    After the first deployment, SSH into the server and edit .env in the release directory (e.g. $INSTALLATION_PATH/main/.env). Set at least:

    • APP_SECRET – random string for production.
    • DATABASE_URL – correct for your server (the default uses Docker service names; keep as-is if you use the same Compose setup).
    • DEFAULT_URI – public URL of the app (e.g. https://travel-journal.example.com).
    • MAILER_DSN – your SMTP or mailer DSN (or null:// to disable mail).
    • Optionally: MAILER_FROM_NAME, MAILER_FROM_ADDRESS, TRUSTED_PROXIES (if behind a reverse proxy), TIMEZONE, IS_PREVIEW_SYSTEM, etc.

    Then restart so the app picks up the new values:

    cd $INSTALLATION_PATH/main   # or your branch path
    make restart-prod
    
  3. Admin user
    The default setup does not load dev fixtures in production. Create an admin user (e.g. via a custom command or by loading a production-safe fixture) and ensure the app is not left with default or example credentials.

  4. Ongoing deploys
    For later deployments, ./deploy.sh will pull the latest code and run make restart-prod again. Existing .env is left unchanged. Run migrations and cache warmup as part of restart-prod; no extra steps are required unless you change env vars (then edit .env and run make restart-prod on the server again).

Optional deployment hooks

You can add scripts that run during deployment:

ScriptWhen it runs
deployment/hooks/pre-deployment.shBefore clone/pull (on your machine).
deployment/hooks/post-deployment.shAfter make restart-prod (on your machine).
deployment/hooks/on-error.shWhen the script exits due to an error (on your machine).

Create these files if you need to run custom steps (e.g. notifications, backups). Logs are written to deployment/logs/deploy-YYYY-MM-DD-HH-MM-SS.log.

Further readings

Acknowledgements

  • Original idea by Anna-Lena Schwarz

Support

If you have any questions, suggestions, or need support, please feel free to contact us: