We store the global configuration of a MakerKit application in /configuration.ts
.
Within any application file, we can use the path ~/configuration
to
import it from any other file.
You do not need any changes to start developing your application. Feel free to complete the configuration once you want to deploy the app for the first time.
The configuration has the following structure:
import getEnv from '~/core/get-env';
import type { Provider } from '@supabase/gotrue-js/src/lib/types';
const env = getEnv() ?? {};
const production = env.NODE_ENV === 'production';
const configuration = {
site: {
name: 'Awesomely - Your SaaS Title',
description: 'Your SaaS Description',
themeColor: '#ffffff',
themeColorDark: '#0a0a0a',
siteUrl: env.SITE_URL,
siteName: 'Awesomely',
twitterHandle: '',
githubHandle: '',
language: 'en',
convertKitFormId: '',
locale: env.DEFAULT_LOCALE,
},
auth: {
// ensure this is the same as your Supabase project
// by default - it's true in production and false in development
requireEmailConfirmation: production,
// NB: Enable the providers below in the Supabase Console
// in your production project
providers: {
emailPassword: true,
phoneNumber: false,
emailLink: false,
oAuth: ['google'] as Provider[],
},
},
production,
environment: env.ENVIRONMENT,
enableThemeSwitcher: true,
paths: {
signIn: '/auth/sign-in',
signUp: '/auth/sign-up',
signInMfa: '/auth/verify',
signInFromLink: '/auth/link',
onboarding: `/onboarding`,
appHome: '/dashboard',
settings: {
profile: '/settings/profile',
authentication: '/settings/profile/authentication',
email: '/settings/profile/email',
password: '/settings/profile/password',
},
api: {
checkout: `/resources/stripe/checkout`,
billingPortal: `/resources/stripe/portal`,
organizations: {
create: `/resources/organizations/create`,
transferOwnership: `/resources/organizations/transfer-ownership`,
members: `/resources/organizations/members`,
},
},
},
email: {
host: '',
port: 587,
user: '',
password: '',
senderAddress: 'MakerKit Team <info@makerkit.dev>',
},
sentry: {
dsn: env.SENTRY_DSN,
},
stripe: {
products: [
{
name: 'Basic',
description: 'Description of your Basic plan',
badge: `Up to 20 users`,
features: [
'Basic Reporting',
'Up to 20 users',
'1GB for each user',
'Chat Support',
],
plans: [
{
name: 'Monthly',
price: '$9',
stripePriceId: 'basic-plan-mth',
trialPeriodDays: 0,
},
{
name: 'Yearly',
price: '$90',
stripePriceId: 'basic-plan-yr',
},
],
},
{
name: 'Pro',
badge: `Most Popular`,
recommended: true,
description: 'Description of your Pro plan',
features: [
'Advanced Reporting',
'Up to 50 users',
'5GB for each user',
'Chat and Phone Support',
],
plans: [
{
name: 'Monthly',
price: '$29',
stripePriceId: 'pro-plan-mth',
},
{
name: 'Yearly',
price: '$200',
stripePriceId: 'pro-plan-yr',
},
],
},
{
name: 'Premium',
description: 'Description of your Premium plan',
badge: ``,
features: [
'Advanced Reporting',
'Unlimited users',
'50GB for each user',
'Account Manager',
],
plans: [
{
name: '',
price: 'Contact us',
stripePriceId: '',
label: `Contact us`,
href: `/contact`,
},
],
},
],
},
};
export default configuration;
These values are used throughout the application instead of being hardcoded into the codebase.
This file will not be committed (at least not the "secret" variable). So instead, you should define those variables within your favorite CI/CD.
Environment Variables
Makerkit provides templates for configuring your environment variables correctly and the minimum environment variables to run your local environment.
To push your project to production, you must fill these variables by creating your Supabase project and adding the required values.
Development Environment Variables
The development environment variables set your application up for the Supabase environment:
DEFAULT_LOCALE=en
SITE_URL=http://localhost:3000
# SUPABASE
SUPABASE_URL=http://localhost:54321
SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
# STRIPE
STRIPE_WEBHOOK_SECRET=
STRIPE_SECRET_KEY=
# TESTING EMAILS. MAKE AN ACCOUNT ON ETHEREAL AND ADD THE CREDENTIALS BELOW
ETHEREAL_EMAIL=
ETHEREAL_PASSWORD=
# SERCET KEY TO SIGN SECRETS. REPLACE THE BELOW WITH A RANDOM AND COMPLEX STRING. KEEPT IT SAFE.
SECRET_KEY=
Production Environment Variables
When you go to production, ensure you add the required environment variables using your CI or service provider.
Remix does not bundle your ".env" variables when building your application in production mode, so you need to ensure you are providing these variables using your CU or service provider.