Deployment Overview & Configuration
Each service from Basestack is designed to be self-hosted and run independently. This page provides the necessary information to deploy and configure each service. While most configurations are common across all services, specific configurations unique to each service can be found at the end of this page.
Getting up and running is an easy with various options available. Simply ensure you have a Postgres database and a server that can run Node.js. Customize all the settings of the Basestack Platform by referring to the detailed configuration provided below.
App hosting
You have the flexibility to host the platform on any service capable of hosting NextJS ↗ (opens in a new tab) applications with serverless function support. Additionally, you'll need a separate database running elsewhere that the app can connect to. Some app hosting providers that support include Vercel, more coming, all of which offer a free tier option.
Managed databases
Ensure that the PostgreSQL service or instance supports serverless environments. Any traditional instance of PostgreSQL with connection pooling, such as PgBouncer ↗ (opens in a new tab), will work effectively.
Environment Variables
The platform has a straightforward configuration process, requiring a set of essential environment variables to configure the services and run the platform smoothly.
Database Configuration
Property | Description | Required |
---|---|---|
DATABASE_URL | Connection URL to your database using PgBouncer. | true |
DIRECT_DATABASE_URL | Direct connection URL to the database used for migrations | true |
Authentication Configuration
General
For the NEXTAUTH_SECRET
variable you can use openssl rand -base64 32
or generate a random value (opens in a new tab).
Property | Description | Required | Example |
---|---|---|---|
NEXTAUTH_SECRET | Used to encrypt the NextAuth.js JWT, and to hash email verification tokens. | true | generate (opens in a new tab) |
NEXTAUTH_URL | Set to the canonical URL of your site | true | https://your-basestack-instance.com (opens in a new tab) |
Providers
Authentication Providers in the Platform are services that you and your team can use for signing in. To find the list of supported providers, check below:
You can have multiple Auth providers on the platform, providing you with more options. However, it is essential to configure at least one Auth provider for the platform to function properly.
API Configuration
The configurations relevant to the API are associated with the endpoint from the REST API
, which enables tasks like fetching the Flags. On the other hand, services concerning the dashboard, members, and permissions are safeguarded by Authentication and can only be accessed from the same origin (CORS).
CORS Configuration
We highly recommend securing the REST API
requests to ensure they originate from the same domain as your services. You can modify the variables below to align with your product domains.
Property | Description | Required | Example |
---|---|---|---|
API_ACCESS_CONTROL_ALLOW_ORIGIN | Indicates whether the response can be shared with requesting code from the given origin | false | * |
Email Configuration
The Basestack Platform uses SMTP for sending emails. To configure SMTP, set the following environment variables:
You can use any transactional email service, such as SendGrid ↗ (opens in a new tab), Mailgun ↗ (opens in a new tab), or Resend ↗ (opens in a new tab) to send emails.
Property | Description | Required | Example |
---|---|---|---|
EMAIL_FROM | Sender email address used in outgoing emails. | true | Hello. <[email protected]> |
EMAIL_SMTP_HOST | SMTP server hostname or IP address for sending emails. | true | |
EMAIL_SMTP_PORT | SMTP port number used for email transmission. | true | 465 |
EMAIL_SMTP_SECURE | Boolean indicating whether SMTP connection should be secured (e.g., true or false). | true | false |
EMAIL_SMTP_AUTH_USER | SMTP authentication username for authenticating to the SMTP server. | true | |
EMAIL_SMTP_AUTH_PASSWORD | SMTP authentication password for authenticating to the SMTP server. | true |
Platform-Specific Configuration
The above environment variables are common across all platforms. However, there are specific configurations unique to each platform. Below are the configurations for each platform:
No specific configurations are required for Feature Flags.