Documentation
Local Development

Local Development with Docker

This guide provides detailed instructions for setting up Hi.Events using Docker, including requirements, setup steps, additional configuration, and environment variables.

Requirements

  1. Docker: Docker simplifies the management and deployment of applications. Get Docker (opens in a new tab).
  2. Docker Compose: Ensure Docker Compose is installed. It comes with Docker Desktop for Windows and Mac. Docker Compose Installation Guide (opens in a new tab).
  3. Git: Git must be installed to clone the repository. Git Installation Guide (opens in a new tab).

Setup Instructions

Step 1: Clone the Repository

Clone the Hi.Events GitHub repository to your local machine using Git:

git clone https://github.com/HiEventsDev/hi.events.git

Step 2: Run the Installation Script

Change to the Docker directory in the cloned repository and start the environment:

cd hi.events/docker/development
./start-dev.sh

After starting, access the app at:

  • Frontend: https://localhost:8443
  • Backend/API: https://localhost:8443/api

Additional Configuration

Adjust configurations based on your setup for mail service, object storage, and application settings through environment variables.

Environment Configuration

You can configure Hi.Events using environment variables. The development environment uses a .env file in the docker/development directory. You can adjust the variables in this file to customize the application.

For a breakdown of the available environment variables, refer to the Environment Variables Documentation.

Stripe Webhooks

To test Stripe end-to-end, you'll need to use the Stripe CLI to forward webhooks to your local environment. Follow the instructions in the Stripe CLI Webhooks Documentation (opens in a new tab).

The following command should start the listener locally.

stripe listen --forward-to http://127.0.0.1:8443/api/public/webhooks/stripe

Generating Signed Certificates for Localhost

By default, the ./start-dev.sh command will generate an unsigned SSL certificate for localhost. This is fine for development purposes; however, it results in browsers showing a warning when you first use the app.

If this is an issue for you, you can generate a signed certificate using mkcert (opens in a new tab).

# Install mkcert using instructions from the repository: https://github.com/FiloSottile/mkcert
mkcert -install
./start-dev.sh --cert=signed

Accessing Mail and Database Services

The Docker setup includes configurations for mail and database services. Below is an overview of the services and their configurations:

Mail Service (Mailpit)

Mailpit is included to handle emails during development. It is accessible at:

Database Service (PostgreSQL)

PostgreSQL is used as the database. Below are the connection details:

  • Host: localhost to connect from the host machine, or pgsql to connect from another container.
  • Port: 5432
  • Database: backend
  • Username: username
  • Password: password

By following these instructions and configurations, you will have a fully functional Hi.Events environment running locally with Docker, including mail and database services.