Deploying Hi.Events
The recommended deployment method for Hi.Events
is using Docker the Hi.Events Docker images. This allows you to
easily deploy the application on any platform that supports Docker, such as DigitalOcean, AWS, Google Cloud, or your own server.
There are two main components to deploy: the frontend
and the backend
. The frontend is Node React application,
while the backend is a Laravel application.
For convenience, we provide an All-in-One Docker image that contains both the frontend and backend services. This is the easiest way to deploy the application. But for more control and scalability, we recommend using separate images for the frontend and backend services.
Easiest Route: One-Click Deploy
For the simplest deployment experience, you can use one-click deploy buttons:
For production deployments, you will need to configure a mail provider, and if you'd like to charge fees for events, you'll need to configure Stripe.
Production note
The one-click deployments are great for getting started quickly. However, for production deployments, it's recommended to carefully consider the environment variables and configurations to ensure a secure and scalable deployment.
You should also ensure the size of the server and database you are deploying is sufficient for your expected usage.
Configuring Environment Variables
To make your deployment production-worthy, you'll need to configure several environment variables, especially for Mail and Stripe integration. Here are the groups of environment variables you'll need:
Frontend Variables
Variable Name | Description | Example |
---|---|---|
VITE_FRONTEND_URL | Frontend URL | https://your-app.com |
VITE_API_URL_CLIENT | API URL for use in the browser | https://your-app.com/api |
VITE_API_URL_SERVER | API URL for use on server | This is used for server-side rendering. Usually http://localhost:8000/api |
VITE_STRIPE_PUBLISHABLE_KEY | Stripe public key | pk_test_51... |
Backend Variables
Mail Configuration
You can use email providers like Postmark (opens in a new tab), SendGrid (opens in a new tab), or AWS SES (opens in a new tab).
Variable Name | Description | Example |
---|---|---|
MAIL_MAILER | Mail driver | smtp |
MAIL_HOST | Mail server host | smtp.mailtrap.io |
MAIL_PORT | Mail server port | 2525 |
MAIL_USERNAME | Mail server username | your-username |
MAIL_PASSWORD | Mail server password | your-password |
MAIL_FROM_ADDRESS | Mail from address | me@mywebsite.com |
MAIL_FROM_NAME | Mail from name | Your App Name |
For more details on configuring mail settings in Laravel, refer to the Laravel Mail Documentation (opens in a new tab).
Stripe Configuration
For more information on obtaining Stripe API keys, visit the Stripe API Keys Documentation (opens in a new tab).
Variable Name | Description | Example |
---|---|---|
STRIPE_PUBLIC_KEY | Stripe public key | pk_test_51... |
STRIPE_SECRET_KEY | Stripe secret key | sk_test_51... |
STRIPE_WEBHOOK_SECRET | Stripe webhook secret | whsec_... |
Setting up the stripe webhook
For Stripe to work correctly, you need to set up the Stripe webhook in the Stripe dashboard.
You can set the webhook on this Stripe page: https://dashboard.stripe.com/webhooks (opens in a new tab)
The webhook URL should be https://your-app.com/api/public/webhooks/stripe
.
General Configuration
Variable Name | Description | Example |
---|---|---|
APP_KEY | Application key | base64:... |
APP_SAAS_MODE_ENABLED | Enable SaaS mode. | true |
APP_SAAS_STRIPE_APPLICATION_FEE_PERCENT | Stripe application fee percentage. Only relevant in SAAS mode | 1.5 |
APP_FRONTEND_URL | Frontend URL | https://your-app.com |
APP_CDN_URL | CDN URL | https://cdn.your-app.com |
APP_DISABLE_REGISTRATION | Disable registration | Disables people from registering new accounts. Suggested for non-SaaS deployments. |
FILESYSTEM_PUBLIC_DISK | Filesystem disk | Default: s3-public . public if you're using local disk storage |
FILESYSTEM_PRIVATE_DISK | Filesystem disk | Default: s3-private . local if you're using local disk storage |
JWT_SECRET | JWT secret key | base64:... |
LOG_CHANNEL | Log channel | stderr |
The APP_KEY
can be generated using the following command:
echo "base64:$(openssl rand -base64 32)"
AWS Configuration
These variables are required if you'd like to use AWS S3 for file storage. You can also use other s3-compatible services like DigitalOcean Spaces (opens in a new tab).
To avoid losing files during updates or server failures, we highly recommend using cloud file storage for production deployments.
Variable Name | Description | Example |
---|---|---|
AWS_ACCESS_KEY_ID | AWS access key ID | your-access-key-id |
AWS_SECRET_ACCESS_KEY | AWS secret access key | your-secret-access-key |
AWS_DEFAULT_REGION | AWS region | us-west-1 |
AWS_PUBLIC_BUCKET | AWS public bucket name | your-public-bucket |
AWS_PRIVATE_BUCKET | AWS private bucket name | your-private-bucket |
Database Configuration
You can either set individual database configuration variables or use the DATABASE_URL
to simplify the configuration.
Variable Name | Description | Example |
---|---|---|
DB_CONNECTION | Database connection type | pgsql |
DB_HOST | Database host | your-database-host |
DB_PORT | Database port | 5432 |
DB_DATABASE | Database name | your-database-name |
DB_USERNAME | Database username | your-database-username |
DB_PASSWORD | Database password | your-database-password |
DATABASE_URL | Database URL (alternative to individual values) | postgres://user:password@host:port/database |
Redis Configuration
Variable Name | Description | Example |
---|---|---|
REDIS_HOST | Redis host | your-redis-host |
REDIS_PASSWORD | Redis password | your-redis-password |
REDIS_USER | Redis username | your-redis-username |
REDIS_PORT | Redis port | 6379 |
REDIS_URL | Redis URL | redis://user:password@host:port |
Queue Configuration
Variable Name | Description | Example |
---|---|---|
QUEUE_CONNECTION | Queue connection type | Default: sync . Set to redis for production deployments. |
Production note
For convenience, QUEUE_CONNECTION
is set to sync
by default. It is highly recommended to use a queue system
like Redis for production deployments.
Docker Images
For those you prefer to customize the deployment process, you can use the following Docker images:
- All-in-One:
daveearley/hi.events-all-in-one
(opens in a new tab) - Frontend:
daveearley/hi.events-frontend
(opens in a new tab) - Backend:
daveearley/hi.events-backend
(opens in a new tab)
The All-in-One
image contains both the frontend and backend services, while the Frontend and Backend images contain only the respective services.
While the All-in-One
image is convenient and should suffice for simple deployments, it's recommended to use separate images for the frontend and backend services.