Files
myeasycms-v2/apps/web/config/app.config.ts
giancarlo f93af31009 Refactor billing schema for increased flexibility
The billing schema has been revamped to allow more flexible billing setups, supporting multiple line items per plan. Changes extend to related app and UI components for a seamless experience. As a result, the previously used 'line-items-mapper.ts' is no longer needed and has been removed.
2024-03-30 00:59:06 +08:00

46 lines
1.3 KiB
TypeScript

import { z } from 'zod';
const production = process.env.NODE_ENV === 'production';
const AppConfigSchema = z.object({
name: z
.string({
description: `This is the name of your SaaS. Ex. "Makerkit"`,
})
.min(1),
title: z
.string({
description: `This is the default title tag of your SaaS.`,
})
.min(1),
description: z.string({
description: `This is the default description of your SaaS.`,
}),
url: z.string().url({
message: `Please provide a valid URL. Example: 'https://example.com'`,
}),
locale: z
.string({
description: `This is the default locale of your SaaS.`,
})
.default('en'),
theme: z.enum(['light', 'dark', 'system']),
production: z.boolean(),
themeColor: z.string(),
themeColorDark: z.string(),
});
const appConfig = AppConfigSchema.parse({
name: process.env.NEXT_PUBLIC_PRODUCT_NAME,
title: process.env.NEXT_PUBLIC_SITE_TITLE,
description: process.env.NEXT_PUBLIC_SITE_DESCRIPTION,
url: process.env.NEXT_PUBLIC_SITE_URL,
locale: process.env.NEXT_PUBLIC_DEFAULT_LOCALE,
theme: process.env.NEXT_PUBLIC_DEFAULT_THEME_MODE,
themeColor: process.env.NEXT_PUBLIC_THEME_COLOR,
themeColorDark: process.env.NEXT_PUBLIC_THEME_COLOR_DARK,
production,
});
export default appConfig;