Environment File
The Reservations application requires environment variables to be defined in a.env file at the root of the project. Create this file before running the application:
Required Environment Variables
All environment variables listed below are required for the application to run successfully. The application validates these variables on startup and will fail if any are missing.Application Settings
The port number on which the backend server will listen
The application environment (e.g.,
development, production, staging)Database Configuration
PostgreSQL database host address
PostgreSQL database port (default: 5432)
Name of the PostgreSQL database
PostgreSQL database username
PostgreSQL database password
PostgreSQL schema name (usually
public)JWT Authentication
Secret key for signing JWT access tokens. Use a strong, randomly generated string.
JWT access token expiration time in minutes
Secret key for signing JWT refresh tokens. Use a different strong, randomly generated string.
JWT refresh token expiration time in minutes
10080 minutes equals 7 days
Email Configuration
Resend API key for sending transactional emails. Get your API key from Resend
Enable or disable email sending functionality
OAuth Configuration
Google OAuth 2.0 client ID for Google authentication. Obtain from Google Cloud Console
Google OAuth 2.0 client secret
Facebook OAuth client ID (App ID) for Facebook authentication. Obtain from Facebook Developers
Facebook OAuth client secret (App Secret)
Frontend Configuration
Mapbox access token for map functionality in the frontend. Get your token from Mapbox
This variable is prefixed with
VITE_ to expose it to the Vite frontend buildExample .env File
Here’s a complete example.env file with all required variables:
.env
Validation
The application validates all required environment variables on startup (seebackend/cmd/config/config.go:84-103). If any variables are missing or invalid, the application will fail to start with a clear error message indicating which variable is missing.