From 28e115c6cbb7fd3e08554d5fad75588e782f16d4 Mon Sep 17 00:00:00 2001 From: behnam Date: Mon, 21 Apr 2025 10:30:55 +0300 Subject: [PATCH] feature: Add configs --- src/bootstrap/configs/common-configs.ts | 6 ++++++ src/bootstrap/configs/route-configs.ts | 26 +++++++++++++++++++++++++ src/bootstrap/configs/server-configs.ts | 18 +++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 src/bootstrap/configs/common-configs.ts create mode 100644 src/bootstrap/configs/route-configs.ts create mode 100644 src/bootstrap/configs/server-configs.ts diff --git a/src/bootstrap/configs/common-configs.ts b/src/bootstrap/configs/common-configs.ts new file mode 100644 index 0000000..740cd05 --- /dev/null +++ b/src/bootstrap/configs/common-configs.ts @@ -0,0 +1,6 @@ +const commonConfigs = { + appName: process.env.APP_NAME ?? "NEXT_BOILERPLATE", + toastTimeout: 3000, +}; + +export default commonConfigs; diff --git a/src/bootstrap/configs/route-configs.ts b/src/bootstrap/configs/route-configs.ts new file mode 100644 index 0000000..7718646 --- /dev/null +++ b/src/bootstrap/configs/route-configs.ts @@ -0,0 +1,26 @@ +import HomeIcon from "@/app/components/icons/home"; +import langKey from "@/bootstrap/i18n/dictionaries/lang-key"; +import { DocumentIcon } from "@heroicons/react/24/outline"; + +type RouteItem = { + langKey: string; + icon?: + | ((props: { className?: string } & Record) => JSX.Element) + | typeof DocumentIcon; + path: string; +}; + +const routeConfig: Record = { + home: { + langKey: langKey.global.home, + path: "/", + icon: HomeIcon, + }, + dashboard: { + langKey: langKey.global.dashboard, + path: "/dashboard", + icon: DocumentIcon, + }, +}; + +export default routeConfig; diff --git a/src/bootstrap/configs/server-configs.ts b/src/bootstrap/configs/server-configs.ts new file mode 100644 index 0000000..0c15b0e --- /dev/null +++ b/src/bootstrap/configs/server-configs.ts @@ -0,0 +1,18 @@ +import "server-only"; + +/** + * You can put all configs which shouldn't be mapped to the client side. + */ +const serverConfigs = { + env: { + backendApi: { + url: process.env.BACKEND_BASE_HOST as string, + }, + }, + cookies: { + authToken: "auth-token", + authProfile: "auth-profile", + }, +}; + +export default serverConfigs;