Getting Started

Installation

Deploy BookYourPTO with Docker in minutes.

BookYourPTO can be deployed in minutes using Docker and Docker Compose. This guide walks you through cloning the repository, configuring environment variables, and starting your application.

Prerequisites

Before you begin, ensure you have the following installed on your system:

  • Docker Engine
  • Docker Compose
  • Git

If you need to install Docker, visit the official Docker installation guide.

Quick Start

Step 1: Clone the Repository

Clone the BookYourPTO repository from GitHub:

git clone https://github.com/anhourtec/BookYourPTO.git
cd BookYourPTO

Step 2: Update PostgreSQL Password

Important: Before deployment, change the default PostgreSQL password in docker-compose.yml:

Open docker-compose.yml and locate the postgres service:

postgres:
  environment:
    POSTGRES_USER: postgres
    POSTGRES_PASSWORD: postgres123  # Change this to a strong password
    POSTGRES_DB: bookyourpto

Change postgres123 to a strong, unique password. You'll need this password in the next step.

Step 3: Configure Environment Variables

Create a .env file in the root directory with your configuration:

# Database connection - Update password to match docker-compose.yml
DATABASE_URL="postgresql://postgres:YOUR_STRONG_PASSWORD@postgres:5432/bookyourpto"

# JWT Secrets - CHANGE THESE!
JWT_SECRET="production-jwt-secret-minimum-32-characters-change-me"
REFRESH_SECRET="production-refresh-secret-different-from-jwt-also-32-chars"

# Application environment
NODE_ENV="production"

Important Security Notes:

  • Replace YOUR_STRONG_PASSWORD with the same password you set in docker-compose.yml
  • Change JWT_SECRET and REFRESH_SECRET to unique, random strings of at least 32 characters
  • Never commit these secrets to version control
  • Consider using a password generator for strong credentials

Also update the DATABASE_URL in two places in docker-compose.yml:

app:
  build:
    args:
      DATABASE_URL: postgresql://postgres:YOUR_STRONG_PASSWORD@postgres:5432/bookyourpto
  environment:
    DATABASE_URL: postgresql://postgres:YOUR_STRONG_PASSWORD@postgres:5432/bookyourpto

Step 4: Build the Application

Build the Docker images:

docker-compose build

This command compiles the application and prepares all dependencies inside Docker containers.

Step 5: Start the Application

Launch the application stack with Docker Compose:

docker-compose up -d

The -d flag runs containers in detached mode (background). Docker Compose will start two services:

  • bookyourpto-app: The Nuxt application server (port 3010)
  • bookyourpto-postgres: The PostgreSQL database

Step 6: Verify Deployment

Check that both containers are running:

docker-compose ps

You should see output similar to:

       Name                 Command             State              Ports       
--------------------------------------------------------------------------------
bookyourpto-app        docker-entrypoint.sh   Up             0.0.0.0:3010->
                       npm r ...                             3000/tcp
bookyourpto-postgres   docker-entrypoint.sh   Up (healthy)   5432/tcp

View Application Logs

Monitor real-time logs from both containers:

docker-compose logs -f

A successful deployment will show:

✓ Database is ready!
✓ Database initialization completed successfully!
✓ Application is ready to start.
Listening on http://0.0.0.0:3000

Press Ctrl+C to exit log viewing (containers will keep running).

Access Your Application

Once deployed, BookYourPTO will be available at:

http://localhost:3010

The application runs on port 3000 inside the container but is mapped to port 3010 on your host machine.

Configuration Summary

After completing the installation, you should have updated:

  1. docker-compose.yml: PostgreSQL password in three locations (POSTGRES_PASSWORD, build args, runtime environment)
  2. .env file: DATABASE_URL with matching password, JWT secrets

Next Steps

Now that BookYourPTO is running, you can:

  • Create your first organization
  • Set up SMTP Configuration
  • Set up Timezones and Departments
  • Manage users and roles

Production Deployment Tips

For production environments:

  • Use strong, randomly generated passwords for PostgreSQL
  • Consider using Docker secrets instead of environment variables for sensitive data
  • Set up regular database backups of the postgres_data volume
  • Configure SSL/TLS certificates for HTTPS access
  • Review and harden your firewall rules
  • Monitor logs regularly for security events