Skip to content

🌐 Environment Variables ​

This guide provides an overview of the environment variables used in the JetShip Saas boilerplate. These variables configure various aspects of boilerplate, including application settings, logging, database connections, session management, and more. Below is a detailed explanation of environment variables.

πŸš€ Application Configuration ​

These variables configure the general settings of your application, including its name, environment, and localization preferences.

bash
APP_NAME="JetShip"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://localhost
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database
  • APP_NAME: The name of your application. Default is "JetShip".
  • APP_ENV: Defines the environment in which your application is running. Common values are local, production etc.
  • APP_KEY: The encryption key used by Laravel for secure data encryption. This should be generated and kept secret, as it is crucial for the security of encrypted data in your application.
  • APP_DEBUG: A boolean (true or false) that enables or disables debug mode. When set to true, detailed error messages and stack traces are shown, which is useful during development.
  • APP_TIMEZONE: Specifies the default timezone for your application. The default is UTC, but you can set it to any supported timezone.
  • APP_URL: The base URL of your application. This is used when generating URLs within your application, such as in emails and notifications.
  • APP_LOCALE: The default language locale for your application. For example, en for English.
  • APP_FALLBACK_LOCALE: The locale to be used if the current locale is not available. Typically set to the same value as APP_LOCALE.
  • APP_FAKER_LOCALE: The locale used by Faker for generating fake data during development and testing. This controls how Faker formats data like names, addresses, and phone numbers.
  • APP_MAINTENANCE_DRIVER: Specifies the driver used for managing application maintenance mode. The default value is file.
  • APP_MAINTENANCE_STORE: Determines where maintenance mode data is stored. The options include file or database, depending on your APP_MAINTENANCE_DRIVER setting.

πŸ“œ Logging Configuration ​

Configure how logs are handled in the application. Use these settings to track errors, warnings, and other logs.

bash
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
  • LOG_CHANNEL: The default logging channel used by the application.
  • LOG_STACK: Specifies the stack of log channels to use when LOG_CHANNEL is set to stack. For example, it can include channels like single or daily.
  • LOG_DEPRECATIONS_CHANNEL: Defines the logging channel where deprecation warnings are recorded. Setting this to null will suppress these logs.
  • LOG_LEVEL: Determines the minimum level of severity for logging messages. Common levels include debug, info, warning, error, and critical.

πŸ’Ύ Database Configuration ​

Define the connection settings for your database.

bash
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=jetship_db
DB_USERNAME=root
DB_PASSWORD=
  • DB_CONNECTION: Specifies the type of database connection your application will use.
  • DB_HOST: The hostname or IP address of your database server. For example, 127.0.0.1 for a local server or an external IP for a remote database.
  • DB_PORT: The port number on which your database server is running. Default for MySQL is 3306.
  • DB_DATABASE: The name of the database your application will connect to.
  • DB_USERNAME: The username used to authenticate with your database.
  • DB_PASSWORD: The password used to authenticate with your database.

πŸ’Ό Session Configuration ​

Control how user sessions are managed in the app.

bash
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null
  • SESSION_DRIVER: Specifies the session storage method. Common options include file, cookie, database, redis, and memcached.
  • SESSION_LIFETIME: The number of minutes that a session remains active without user interaction. After this time, the session will expire.
  • SESSION_ENCRYPT: A boolean (true or false) indicating whether session data should be encrypted before storage.
  • SESSION_PATH: Defines the path on the server where the session cookie will be available. The default is /, meaning it is available throughout the entire application.
  • SESSION_DOMAIN: The domain for which the session cookie is available. Setting this to null makes the session cookie available on all subdomains.

🌐 Broadcast, Queue, and Cache Configuration ​

Control real-time broadcasting, background jobs, and caching in the application.

bash
BROADCAST_CONNECTION=log
QUEUE_CONNECTION=database
CACHE_STORE=database
CACHE_PREFIX=jetship_
  • BROADCAST_CONNECTION: The broadcast connection your application will use for real-time event broadcasting. Common options include pusher, redis, log, etc.
  • QUEUE_CONNECTION: Specifies the queue connection your application will use to manage background jobs. Common options are sync, database, redis, sqs, etc.
  • CACHE_STORE: The cache driver used to store cached data. Common drivers include file, database, redis, etc.
  • CACHE_PREFIX: A prefix that will be applied to all cache keys, which is useful in multi-tenant applications to avoid cache key collisions.

πŸ”§ Redis Configuration ​

Configure redis

bash
REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
  • REDIS_CLIENT: Specifies the Redis client to use.
  • REDIS_HOST: The hostname or IP address of your Redis server. For example, 127.0.0.1 for a local Redis instance.
  • REDIS_PASSWORD: The password required to connect to your Redis server. If no password is required, this can be set to null.
  • REDIS_PORT: The port number on which your Redis server is running. Default is 6379.

πŸ“§ Mail Configuration ​

Configure email

bash
MAIL_MAILER=smtp
MAIL_FROM_ADDRESS=no-reply@jetship.com
MAIL_FROM_NAME="${APP_NAME}"
  • MAIL_MAILER: The mailer service your application will use to send emails. Common values are smtp, sendmail, mailgun, postmark, etc.
  • MAIL_FROM_ADDRESS: The default email address from which emails are sent by your application.
  • MAIL_FROM_NAME: The default name that will appear as the sender of emails sent from your application. Often set to the application's name using ${APP_NAME}.

βœ‰οΈ Mail Client Configuration ​

In this section, you need to set the secrets for your default email client.

SMTP ​

bash
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=
  • MAIL_HOST: The SMTP server's hostname (e.g., smtp.mailtrap.io).
  • MAIL_PORT: The port used by the SMTP server (commonly 587 for TLS or 465 for SSL).
  • MAIL_USERNAME: The username for authenticating with the SMTP server.
  • MAIL_PASSWORD: The password for authenticating with the SMTP server.
  • MAIL_ENCRYPTION: The encryption protocol used by the SMTP server (tls or ssl).

Mailgun ​

bash
MAILGUN_DOMAIN=
MAILGUN_SECRET=
  • MAILGUN_DOMAIN: Your Mailgun domain name, used for sending emails.
  • MAILGUN_SECRET: The API key provided by Mailgun for secure access to their email services.

Postmark ​

bash
POSTMARK_TOKEN=
POSTMARK_MESSAGE_STREAM_ID=
POSTMARK_TEST=
  • POSTMARK_TOKEN: The API token provided by Postmark for authenticating API requests.
  • POSTMARK_MESSAGE_STREAM_ID: The ID of the Postmark message stream used for sending emails.
  • POSTMARK_TEST: A flag to enable or disable test mode in Postmark (typically true or false).

SES ​

bash
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=
  • AWS_ACCESS_KEY_ID: Your AWS Access Key ID, used to authenticate your application to AWS services.
  • AWS_SECRET_ACCESS_KEY: The secret key associated with your AWS Access Key.
  • AWS_DEFAULT_REGION: The region where your S3 bucket is located (e.g., us-east-1, eu-west-1).
  • AWS_BUCKET: The name of your S3 bucket where files will be stored.
  • AWS_USE_PATH_STYLE_ENDPOINT: A boolean (true or false) that defines whether to use path-style URLs when accessing your S3 bucket.

For more details regarding configuration of mails in our boilerplate, please refer Mail configuration guide in docs.

πŸ› οΈ Vite Configuration ​

bash
VITE_APP_NAME="${APP_NAME}"
  • VITE_APP_NAME: This variable is used by Vite (a build tool) during the development process, typically to define the application name. It usually mirrors the APP_NAME.

πŸ” OAuth Configuration ​

This section defines the environment variables used for configuring third-party OAuth authentication services in your application.

bash
# Google OAuth Configuration
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URL=

# GitHub OAuth Configuration
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_REDIRECT_URL=

# Facebook OAuth Configuration
FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET=
FACEBOOK_REDIRECT_URL=

# Twitter OAuth Configuration
TWITTER_CLIENT_ID=
TWITTER_CLIENT_SECRET=
TWITTER_REDIRECT_URL=

Google OAuth ​

  • GOOGLE_CLIENT_ID: The Client ID provided by Google.
  • GOOGLE_CLIENT_SECRET: The Client Secret provided by Google.
  • GOOGLE_REDIRECT_URL: The URL to which Google will redirect after authentication.

GitHub OAuth ​

  • GITHUB_CLIENT_ID: The Client ID provided by GitHub.
  • GITHUB_CLIENT_SECRET: The Client Secret provided by GitHub.
  • GITHUB_REDIRECT_URL: The URL to which Github will redirect after authentication.

Facebook OAuth ​

  • FACEBOOK_CLIENT_ID: The Client ID provided by Facebook.
  • FACEBOOK_CLIENT_SECRET: The Client Secret provided by Facebook.
  • FACEBOOK_REDIRECT_URL: The URL to which Facebook will redirect after authentication.

Twitter OAuth ​

  • TWITTER_CLIENT_ID: The Client ID provided by Twitter.
  • TWITTER_CLIENT_SECRET: The Client Secret provided by Twitter.
  • TWITTER_REDIRECT_URL: The URL to which Twitter will redirect after authentication.

For more details regarding OAuth Social Login in our boilerplate, please refer OAuth Social Login guide in docs.

Configure magic link

bash
MAGIC_LINK_EXPIRY=
  • MAGIC_LINK_EXPIRY: This variable is used to configure the expiry time of magic link.

πŸ’° Payment Providers ​

Below are the environment variables used to configure payment processing services for your application

Stripe ​

These variables configure the Stripe payment gateway for processing transactions.

bash
STRIPE_PUBLISHABLE_KEY=
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
  • STRIPE_PUBLISHABLE_KEY: The public API key provided by Stripe.
  • STRIPE_SECRET_KEY: The secret API key provided by Stripe, used for processing payments securely.
  • STRIPE_WEBHOOK_SECRET: The secret key used to verify the authenticity of Stripe webhooks sent to your application.

LemonSqueezy ​

These variables configure the LemonSqueezy service for managing subscriptions and payments.

bash
LEMON_SQUEEZY_API_KEY=
LEMON_SQUEEZY_STORE_ID=
LEMON_SQUEEZY_SIGNING_SECRET=
LEMON_SQUEEZY_IS_TEST_MODE=
  • LEMON_SQUEEZY_API_KEY: The API key provided by LemonSqueezy for authenticating requests to their API.
  • LEMON_SQUEEZY_STORE_ID: The unique identifier for your LemonSqueezy store.
  • LEMON_SQUEEZY_SIGNING_SECRET: The secret key used to verify the integrity of webhook messages from LemonSqueezy.
  • LEMON_SQUEEZY_IS_TEST_MODE: A flag indicating whether the application is running in test mode (true for test mode, false for live mode).

You can easily find these secrets by logging in your providers account.

For more details regarding payment providers in our boilerplate, please refer Payment Providers guide.

πŸ”’ Recaptcha Configuration ​

This section provides details on the environment variables required to configure Google reCAPTCHA for your application. reCAPTCHA is used to protect your website from spam and abuse.

bash
RECAPTCHA_SITE_KEY=
RECAPTCHA_SECRET_KEY=
RECAPTCHA_SITE=
RECAPTCHA_ENABLED=
  • RECAPTCHA_SITE_KEY: The public site key provided by Google reCAPTCHA.
  • RECAPTCHA_SECRET_KEY: The secret key provided by Google reCAPTCHA.
  • RECAPTCHA_SITE: The URL for the reCAPTCHA admin console, where you can manage your reCAPTCHA settings.
  • RECAPTCHA_ENABLED: A boolean (true or false) indicating whether reCAPTCHA is enabled for your application.

πŸ“§ Mailchimp Configuration ​

This section provide details on the environment variables needed to configure Mailchimp for your application. We use mailchimp for managing waitlist and newsletters audience.

bash
MAILCHIMP_SECRET=
MAILCHIMP_LIST_ID=
  • MAILCHIMP_SECRET: The API key provided by Mailchimp, used to authenticate API requests and interact with your Mailchimp account.
  • MAILCHIMP_LIST_ID: The ID of the specific Mailchimp mailing list that your application will interact with, such as for waiting list.