commit ffdb953b88eb1a9828d77c56d1a124514ee20656 Author: mohiit1502 Date: Thu Sep 5 17:17:19 2024 +0530 Added shared configs diff --git a/api-config.ts b/api-config.ts new file mode 100644 index 0000000..7ad5be8 --- /dev/null +++ b/api-config.ts @@ -0,0 +1,30 @@ +import { ApiConfig } from "@armco/types" + +const API_CONFIG: ApiConfig = { + HOST: { + development: "http://localhost:5000/api", + production: "https://api.armco.tech", + }, + STATIC_HOST: { + development: "http://localhost:5001/api", + production: "https://static.armco.tech", + }, + TASKER: { + development: "http://localhost:5002/api", + production: "https://tasks.armco.tech", + }, + CONFIG: { + development: "http://localhost:5003/api", + production: "https://config.armco.tech", + }, + IAM: { + development: "http://localhost:5004/api", + production: "https://iam.armco.tech", + }, + SEER: { + development: "http://localhost:5005/api", + production: "https://telemetry.armco.tech", + }, +} + +export default API_CONFIG diff --git a/constants.ts b/constants.ts new file mode 100644 index 0000000..0c04689 --- /dev/null +++ b/constants.ts @@ -0,0 +1,214 @@ +import moment from "moment" +import { ArWebPageLayout, ObjectType } from "@armco/types" +import API_CONFIG from "./api-config" + +export const ICON_ROOT = `${ + API_CONFIG.STATIC_HOST[process.env.NODE_ENV as "production" | "development"] +}/icon` + +export const SESSION_COOKIE_NAME = "x-access-token" + +export const DEFAULT_LOCALE = { + direction: "ltr", + format: moment.localeData().longDateFormat("L"), + separator: " - ", + applyLabel: "Apply", + cancelLabel: "Cancel", + weekLabel: "W", + customRangeLabel: "Custom Range", + daysOfWeek: moment.weekdaysMin(), + monthNames: moment.monthsShort(), + firstDay: moment.localeData().firstDayOfWeek(), +} + +export const ENDPOINTS = { + STATIC: { + ICON: { + ROOT: "/icon", + PAGE: "/page", + }, + LOTTIE: { + ROOT: "/lottie", + TOMP4: "/to-mp4", + TOGIF: "/to-gif", + TOPNG: "/to-png", + TOSVG: "/to-svg", + }, + FONT: { + ROOT: "/font", + PAGE: "/page", + }, + }, + USERS: { + ROOT: "/secure/users", + ADD: "/add", + UPDATE: "/update", + CHECK: "/check", + }, + AUTH: { + ROOT: "/auth", + LOGIN: "/login", + FORGOT: "/forgot", + SIGNUP: "/register", + LOGOUT: "/logout", + }, + NAMESPACE: { + ROOT: "/secure/namespace", + CREATE: "/", + FETCHALL: "/", + FETCH: "/", + }, + CONFIG: { + ROOT: "/secure/config", + SAVE: "/", + DELETE: "/delete", + }, + TASKER: { + ROOT: "/secure/jobs", + SAVE: "/", + DELETE: "/delete", + RUN: "/run", + FETCHALL: "/", + FETCH: "/", + }, +} + +export const MONTH_INDEX = [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", +] + +export const WebPageLayout: Record = { + [ArWebPageLayout.TWOCOL]: { + variant: ArWebPageLayout.TWOCOL, + gridTemplate: `"ga-a465c242-66be-4693-9a38-466cdb39a1ef ga-f04da199-e496-4607-87b0-55c9a96d09de ga-f04da199-e496-4607-87b0-55c9a96d09de ga-f04da199-e496-4607-87b0-55c9a96d09de" minmax(auto, 1fr) / 1fr 1fr 1fr 1fr`, + gridTemplateColumns: "1fr 3fr", + demoChildCount: 2, + previewChildCount: 2, + shortName: "2-col", + }, + [ArWebPageLayout.THREECOL]: { + variant: ArWebPageLayout.THREECOL, + gridTemplate: `"ga-a465c242-66be-4693-9a38-466cdb39a1ef ga-f04da199-e496-4607-87b0-55c9a96d09de ga-f04da199-e496-4607-87b0-55c9a96d09de ga-f04da199-e496-4607-87b0-55c9a96d09de ga-33a97990-97c8-4b51-83ad-a07b94d7e44f" minmax(auto, 1fr) / 1fr 1fr 1fr 1fr 1fr`, + gridTemplateColumns: "1fr 3fr 1fr", + demoChildCount: 3, + previewChildCount: 3, + shortName: "3-col", + }, + [ArWebPageLayout.GRID]: { + variant: ArWebPageLayout.GRID, + gridTemplate: `"auto" / repeat(auto-fill, minmax(50px, 1fr))`, + gridTemplateColumns: "repeat(auto-fill, minmax(200px, 1fr))", + demoChildCount: 18, + previewChildCount: 2, + gridSize: "20px", + shortName: "Grid", + }, + [ArWebPageLayout.CARD]: { + variant: ArWebPageLayout.CARD, + gridTemplate: `"auto" / repeat(auto-fill, minmax(50px, 1fr))`, + gridTemplateColumns: "repeat(auto-fill, minmax(200px, 1fr))", + demoChildCount: 9, + previewChildCount: 3, + cardSize: "40px", + shortName: "Card", + }, + [ArWebPageLayout.HEROLINEARCONTENTBLOCKS]: { + variant: ArWebPageLayout.HEROLINEARCONTENTBLOCKS, + gridTemplate: `"ga-a465c242-66be-4693-9a38-466cdb39a1ef ga-f04da199-e496-4607-87b0-55c9a96d09de ga-f04da199-e496-4607-87b0-55c9a96d09de ga-f04da199-e496-4607-87b0-55c9a96d09de ga-33a97990-97c8-4b51-83ad-a07b94d7e44f" minmax(auto, 1fr) + "ga-a465c242-66be-4693-9a38-466cdb39a1ef ga-f04da199-e496-4607-87b0-55c9a96d09de ga-f04da199-e496-4607-87b0-55c9a96d09de ga-f04da199-e496-4607-87b0-55c9a96d09de ga-33a97990-97c8-4b51-83ad-a07b94d7e44f" minmax(auto, 1fr) + "ga-a465c242-66be-4693-9a38-466cdb39a1ef ga-f04da199-e496-4607-87b0-55c9a96d09de ga-f04da199-e496-4607-87b0-55c9a96d09de ga-f04da199-e496-4607-87b0-55c9a96d09de ga-33a97990-97c8-4b51-83ad-a07b94d7e44f" minmax(auto, 1fr) / 1fr 1fr 1fr 1fr 1fr`, + gridTemplateColumns: "1fr 5fr 1fr", + alignContent: "start", + demoChildCount: 6, + previewChildCount: 3, + shortName: "Hero", + // gridTemplateRows: "auto auto", + }, + [ArWebPageLayout.HEROSTAGGEREDARCONTENTBLOCKS]: { + variant: ArWebPageLayout.HEROSTAGGEREDARCONTENTBLOCKS, + gridTemplate: `"ga-877ca8ad-616e-4570-9738-06706091b899 ga-88863f4a-1d44-4b9a-ac96-27eb9af1659d ga-88863f4a-1d44-4b9a-ac96-27eb9af1659d ga-11f867b6-77e9-4fc3-95a2-e909e648cd6b ga-b5de21b4-2567-47a2-a27d-3926a46349bc" minmax(auto, 1fr) + "ga-877ca8ad-616e-4570-9738-06706091b899 ga-910a17b5-3d3a-485e-a573-5b123225009f ga-6116aede-0485-45fa-8be9-98b96e40c7e8 ga-6116aede-0485-45fa-8be9-98b96e40c7e8 ga-b5de21b4-2567-47a2-a27d-3926a46349bc" minmax(auto, 1fr) + "ga-877ca8ad-616e-4570-9738-06706091b899 ga-106eb101-9c2a-4b08-a0d6-9055ffb51023 ga-106eb101-9c2a-4b08-a0d6-9055ffb51023 ga-9beb0918-9116-47d2-91a1-15c7d384d05c ga-b5de21b4-2567-47a2-a27d-3926a46349bc" minmax(auto, 1fr) + "ga-877ca8ad-616e-4570-9738-06706091b899 ga-063202aa-fd61-446e-b5f7-3a2875198774 ga-53075af9-6bf2-4ceb-9f59-f383cac18d53 ga-53075af9-6bf2-4ceb-9f59-f383cac18d53 ga-b5de21b4-2567-47a2-a27d-3926a46349bc" minmax(auto, 1fr) / 1fr 1fr 1fr 1fr 1fr`, + gridTemplateColumns: "repeat(7, 1fr)", + demoChildCount: 10, + previewChildCount: 6, + shortName: "Hero Zigzag", + }, + [ArWebPageLayout.HEROSTAGGEREDREVERSEDARCONTENTBLOCKS]: { + variant: ArWebPageLayout.HEROSTAGGEREDREVERSEDARCONTENTBLOCKS, + gridTemplate: `"ga-13ba6339-ef4a-4db6-9712-3792dbf0492f ga-1e9028b9-252d-48d6-b9eb-a9e52e0ce646 ga-41b568a4-e50e-4002-8446-7ae8363d475e ga-41b568a4-e50e-4002-8446-7ae8363d475e ga-ba38cdec-b539-427a-9add-3f30b6a553e8" minmax(auto, 1fr) + "ga-13ba6339-ef4a-4db6-9712-3792dbf0492f ga-2aff911c-85b8-4f14-9a22-3fd2f071a540 ga-2aff911c-85b8-4f14-9a22-3fd2f071a540 ga-9ba1929c-d41d-444e-b35b-8b0976a6e9a7 ga-ba38cdec-b539-427a-9add-3f30b6a553e8" minmax(auto, 1fr) + "ga-13ba6339-ef4a-4db6-9712-3792dbf0492f ga-02c7178d-70d2-4c0f-afe6-a253b6ff4244 ga-251f824d-ca2b-4565-b436-f2478aab3363 ga-251f824d-ca2b-4565-b436-f2478aab3363 ga-ba38cdec-b539-427a-9add-3f30b6a553e8" minmax(auto, 1fr) + "ga-13ba6339-ef4a-4db6-9712-3792dbf0492f ga-876d6c77-61e3-48ec-85ca-5d67bd41841a ga-876d6c77-61e3-48ec-85ca-5d67bd41841a ga-0fb7ad42-3ccf-4247-9b1a-3b018f6e04d1 ga-ba38cdec-b539-427a-9add-3f30b6a553e8" minmax(auto, 1fr) / 1fr 1fr 1fr 1fr 1fr`, + gridTemplateColumns: "repeat(7, 1fr)", + demoChildCount: 10, + previewChildCount: 6, + shortName: "Hero Zigzag 2", + }, + [ArWebPageLayout.STACKED]: { + variant: ArWebPageLayout.STACKED, + gridTemplate: `"ga-cf5bffc2-e070-426b-9ece-68aacc91cc7a" minmax(auto, 1fr) + "ga-376c8c90-41a4-47ab-b19e-2af1794fc114" minmax(auto, 1fr) + "ga-8d2030f4-0aed-40c3-98f2-f6ad7dc306bf" minmax(auto, 1fr) + "ga-0db7a67b-f5ec-414d-b0aa-f70ee107bb28" minmax(auto, 1fr) / 1fr`, + gridTemplateColumns: "1fr", + alignContent: "start", + demoChildCount: 6, + previewChildCount: 3, + shortName: "Stacked", + }, + [ArWebPageLayout.TABBED]: { + variant: ArWebPageLayout.TABBED, + gridTemplate: `"ga-cf5bffc2-e070-426b-9ece-68aacc91cc7a" minmax(auto, 3rem) + "ga-9bf3a112-ff62-49e6-9684-10cc00574a92" minmax(auto, 1fr) / 1fr`, + gridTemplateColumns: "1fr", + gridTemplateRows: "auto 1fr", + alignContent: "start", + demoChildCount: 2, + previewChildCount: 2, + shortName: "Tabbed", + }, + [ArWebPageLayout.FULL]: { + variant: ArWebPageLayout.FULL, + gridTemplate: `"ga-c07d6b3d-ade5-46a9-9b8e-a03971926c2b" minmax(auto, 1fr) / 1fr`, + gridTemplateColumns: "1fr", + demoChildCount: 1, + previewChildCount: 1, + shortName: "Full Screen", + }, + [ArWebPageLayout.SPLIT]: { + variant: ArWebPageLayout.SPLIT, + gridTemplate: `"ga-c07d6b3d-ade5-46a9-9b8e-a03971926c2b ga-df13a62c-ffb5-4d42-8484-920ece1beb36" minmax(auto, 1fr) / 1fr 1fr`, + gridTemplateColumns: "1fr 1fr", + demoChildCount: 2, + previewChildCount: 2, + shortName: "Split Screen", + }, + [ArWebPageLayout.CAROUSEL]: { + variant: ArWebPageLayout.CAROUSEL, + gridTemplate: `"ga-c07d6b3d-ade5-46a9-9b8e-a03971926c2b" minmax(auto, 1fr) / 1fr`, + gridTemplateColumns: "1fr", + demoChildCount: 1, + previewChildCount: 1, + shortName: "Carousel", + }, + [ArWebPageLayout.CUSTOM]: { + variant: ArWebPageLayout.CUSTOM, + gridTemplate: "1fr", + demoChildCount: 1, + previewChildCount: 1, + shortName: "Custom", + }, +} diff --git a/navigator.ts b/navigator.ts new file mode 100644 index 0000000..506bfbf --- /dev/null +++ b/navigator.ts @@ -0,0 +1,91 @@ +import { v4 as uuid } from "uuid" +import { AppNavigatorDataType } from "@armco/types" + +const navigator: Array = [ + { + label: "Playgrounds", + icon: "tb.TbSoccerField", + color: "cornflowerblue", + id: uuid(), + url: "/playground", + items: [ + { + label: "Components", + icon: "cg/CgComponents", + description: [ + "Stuffle's opinionated component library.", + "Save effort by including this component library to your project.", + "Also exists as npm package", + ], + url: "/components", + }, + { + label: "Icon Viewer", + icon: "gr/GrOverview", + url: "/icon", + }, + { + label: "Armory", + icon: "io5/IoLogoWebComponent", + url: "/", + }, + ], + }, + { + label: "Assets", + icon: "fa/FaBuromobelexperte", + color: "darkcyan", + id: uuid(), + url: "/assets", + items: [ + { + label: "Icons", + icon: "fa/FaIcons", + url: "/icons", + }, + { + label: "Fonts", + icon: "bi/BiFontFamily", + url: "/fonts", + }, + ], + }, + { + label: "Tools & Services", + icon: "fc/FcServices", + id: uuid(), + url: "/tools-and-services", + items: [ + { + label: "IAM", + icon: "fi.FiUsers", + url: "/config", + }, + { + label: "Analytics", + icon: "io/IoMdAnalytics", + url: "/config", + }, + { + label: "Confitron", + icon: "fc.FcDataConfiguration", + url: "/config", + }, + { + label: "Tasker", + icon: "ri.RiPlayList2Fill", + url: "/tasks", + }, + { + label: "Png to Svg", + icon: "si/SiConvertio", + }, + { + label: "Svg to Png", + icon: "si/SiConvertio", + }, + ], + }, +] + +export default navigator diff --git a/web-config.ts b/web-config.ts new file mode 100644 index 0000000..db40bb2 --- /dev/null +++ b/web-config.ts @@ -0,0 +1,18 @@ +import { WebConfig } from "@armco/types" + +const WEB_CONFIG: WebConfig = { + ARMORY: { + development: "http://localhost:7992", + production: "https://armco.tech", + }, + IAM: { + development: "http://localhost:3001", + production: "https://iam.notabuck.com", + }, + FORESEER: { + development: "http://localhost:3002", + production: "https://seer.notabuck.com", + }, +} + +export default WEB_CONFIG