Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
Delete shared app
Brad Barbind00da462ff3b
diff --git a/shared/.env.example b/shared/.env.exampledeleted file mode 100644index 657abebf53..0000000000--- a/shared/.env.example+++ /dev/null@@ -1,7 +0,0 @@-EXCHANGE_RATES_API_KEY="************"-EXCHANGE_RATES_API_URL="http://api.exchangeratesapi.io/v1/latest"-GLOBAL_SUPABASE_URL="https://*********.supabase.co"-GLOBAL_SUPABASE_SERVICE_ROLE_KEY="************"-TRIGGER_API_KEY="************"-TRIGGER_API_URL="https://api.trigger.dev"-TRIGGER_PUBLIC_API_KEY="************"\ No newline at end of filediff --git a/shared/.eslintrc.js b/shared/.eslintrc.jsdeleted file mode 100644index d6be4cb1c8..0000000000--- a/shared/.eslintrc.js+++ /dev/null@@ -1,3 +0,0 @@-module.exports = {- extends: ["carbon"],-};diff --git a/shared/.gitignore b/shared/.gitignoredeleted file mode 100644index 4a02fe5c58..0000000000--- a/shared/.gitignore+++ /dev/null@@ -1,10 +0,0 @@-node_modules--.cache-.vercel-.output--build-public/build-api/index.js*-api/_assets*diff --git a/shared/app/jobs/get-exchange-rates.server.ts b/shared/app/jobs/get-exchange-rates.server.tsdeleted file mode 100644index fc45b54bbf..0000000000--- a/shared/app/jobs/get-exchange-rates.server.ts+++ /dev/null@@ -1,39 +0,0 @@-import { intervalTrigger } from "@trigger.dev/sdk";-import { exchangeRatesClient } from "~/lib/fx.server";-import { supabaseClient } from "~/lib/supabase.server";-import { triggerClient } from "~/lib/trigger.server";--export const job = triggerClient.defineJob({- id: "get-exchange-rates",- name: "Update Currency Exchange Rates",- version: "0.0.1",- trigger: intervalTrigger({- seconds: 60 * 60 * 8, // thrice per day- }),- run: async (payload, io, ctx) => {- await io.logger.info(`💵 Exchange Rates Job: ${payload.lastTimestamp}`);- await io.logger.info(JSON.stringify(exchangeRatesClient.getMetaData()));-- try {- const rates = await exchangeRatesClient.getExchangeRates();- await io.logger.info(JSON.stringify(rates));- const { error } = await supabaseClient- .from("currencyExchangeRate")- .insert(- Object.entries(rates).map(([currency, exchangeRate]) => ({- currency,- exchangeRate,- }))- );- if (error) {- await io.logger.error(JSON.stringify(error));- return;- }-- io.logger.log("Success");- } catch (err) {- // TODO: notify SRE- await io.logger.error(JSON.stringify(err));- }- },-});diff --git a/shared/app/lib/fx.server.ts b/shared/app/lib/fx.server.tsdeleted file mode 100644index 22e43107b5..0000000000--- a/shared/app/lib/fx.server.ts+++ /dev/null@@ -1,393 +0,0 @@-import axios from "axios";--type ExchangeClientOptions = {- apiKey?: string;- apiUrl?: string;- baseCurrency: Currency;-};--type Currency =- | "AFN"- | "AFA"- | "ALL"- | "ALK"- | "DZD"- | "ADP"- | "AOA"- | "AOK"- | "AON"- | "AOR"- | "ARA"- | "ARS"- | "ARM"- | "ARP"- | "ARL"- | "AMD"- | "AWG"- | "AUD"- | "ATS"- | "AZN"- | "AZM"- | "BSD"- | "BHD"- | "BDT"- | "BBD"- | "BYN"- | "BYB"- | "BYR"- | "BEF"- | "BEC"- | "BEL"- | "BZD"- | "BMD"- | "BTN"- | "BOB"- | "BOL"- | "BOV"- | "BOP"- | "BAM"- | "BAD"- | "BAN"- | "BWP"- | "BRC"- | "BRZ"- | "BRE"- | "BRR"- | "BRN"- | "BRB"- | "BRL"- | "GBP"- | "BND"- | "BGL"- | "BGN"- | "BGO"- | "BGM"- | "BUK"- | "BIF"- | "XPF"- | "KHR"- | "CAD"- | "CVE"- | "KYD"- | "XAF"- | "CLE"- | "CLP"- | "CLF"- | "CNX"- | "CNY"- | "CNH"- | "COP"- | "COU"- | "KMF"- | "CDF"- | "CRC"- | "HRD"- | "HRK"- | "CUC"- | "CUP"- | "CYP"- | "CZK"- | "CSK"- | "DKK"- | "DJF"- | "DOP"- | "NLG"- | "XCD"- | "DDM"- | "ECS"- | "ECV"- | "EGP"- | "GQE"- | "ERN"- | "EEK"- | "ETB"- | "EUR"- | "XBA"- | "XEU"- | "XBB"- | "XBC"- | "XBD"- | "FKP"- | "FJD"- | "FIM"- | "FRF"- | "XFO"- | "XFU"- | "GMD"- | "GEK"- | "GEL"- | "DEM"- | "GHS"- | "GHC"- | "GIP"- | "XAU"- | "GRD"- | "GTQ"- | "GWP"- | "GNF"- | "GNS"- | "GYD"- | "HTG"- | "HNL"- | "HKD"- | "HUF"- | "IMP"- | "ISK"- | "ISJ"- | "INR"- | "IDR"- | "IRR"- | "IQD"- | "IEP"- | "ILS"- | "ILP"- | "ILR"- | "ITL"- | "JMD"- | "JPY"- | "JOD"- | "KZT"- | "KES"- | "KWD"- | "KGS"- | "LAK"- | "LVL"- | "LVR"- | "LBP"- | "LSL"- | "LRD"- | "LYD"- | "LTL"- | "LTT"- | "LUL"- | "LUC"- | "LUF"- | "MOP"- | "MKD"- | "MKN"- | "MGA"- | "MGF"- | "MWK"- | "MYR"- | "MVR"- | "MVP"- | "MLF"- | "MTL"- | "MTP"- | "MRU"- | "MRO"- | "MUR"- | "MXV"- | "MXN"- | "MXP"- | "MDC"- | "MDL"- | "MCF"- | "MNT"- | "MAD"- | "MAF"- | "MZE"- | "MZN"- | "MZM"- | "MMK"- | "NAD"- | "NPR"- | "ANG"- | "TWD"- | "NZD"- | "NIO"- | "NIC"- | "NGN"- | "KPW"- | "NOK"- | "OMR"- | "PKR"- | "XPD"- | "PAB"- | "PGK"- | "PYG"- | "PEI"- | "PEN"- | "PES"- | "PHP"- | "XPT"- | "PLN"- | "PLZ"- | "PTE"- | "GWE"- | "QAR"- | "XRE"- | "RHD"- | "RON"- | "ROL"- | "RUB"- | "RUR"- | "RWF"- | "SVC"- | "WST"- | "SAR"- | "RSD"- | "CSD"- | "SCR"- | "SLL"- | "XAG"- | "SGD"- | "SKK"- | "SIT"- | "SBD"- | "SOS"- | "ZAR"- | "ZAL"- | "KRH"- | "KRW"- | "KRO"- | "SSP"- | "SUR"- | "ESP"- | "ESA"- | "ESB"- | "XDR"- | "LKR"- | "SHP"- | "XSU"- | "SDD"- | "SDG"- | "SDP"- | "SRD"- | "SRG"- | "SZL"- | "SEK"- | "CHF"- | "SYP"- | "STN"- | "STD"- | "TVD"- | "TJR"- | "TJS"- | "TZS"- | "XTS"- | "THB"- | "XXX"- | "TPE"- | "TOP"- | "TTD"- | "TND"- | "TRY"- | "TRL"- | "TMT"- | "TMM"- | "USD"- | "USN"- | "USS"- | "UGX"- | "UGS"- | "UAH"- | "UAK"- | "AED"- | "UYW"- | "UYU"- | "UYP"- | "UYI"- | "UZS"- | "VUV"- | "VES"- | "VEB"- | "VEF"- | "VND"- | "VNN"- | "CHE"- | "CHW"- | "XOF"- | "YDD"- | "YER"- | "YUN"- | "YUD"- | "YUM"- | "YUR"- | "ZWN"- | "ZRN"- | "ZRZ"- | "ZMW"- | "ZMK"- | "ZWD"- | "ZWR"- | "ZWL"- | "XUA";--type Rates = { [key in Currency]?: number };--type ExchangeRatesSuccessResponse = {- success: boolean;- timestamp: number;- base: Currency;- date: string;- rates: Rates;-};--type ExchangeRatesErrorResponse = {- error: {- code: string;- message: string;- };-};--type ExchangeRatesResponse =- | ExchangeRatesErrorResponse- | ExchangeRatesSuccessResponse;--export class ExchangeRatesClient {- #apiKey: string;- #apiUrl: string;- #baseCurrency: Currency;-- constructor(options: ExchangeClientOptions) {- if (!options.apiKey) throw new Error("EXCHANGE_RATES_API_KEY not set");- if (!options.apiUrl) throw new Error("EXCHANGE_RATES_API_URL not set");- this.#apiKey = options.apiKey;- this.#apiUrl = options.apiUrl;- this.#baseCurrency = options.baseCurrency ?? "USD";- }-- getMetaData() {- return {- apiUrl: this.#apiUrl,- baseCurrency: this.#baseCurrency,- };- }-- async getExchangeRates(base?: Currency): Promise<Rates> {- const { data } = await axios.get<ExchangeRatesResponse>(- `${this.#apiUrl}?access_key=${this.#apiKey}`- );-- if ("success" in data && data.success === true) {- const baseRate = data.rates[base ?? this.#baseCurrency];- if (!baseRate) throw new Error("Base rate not found in response");-- const convertedRates = Object.entries(data.rates).reduce<Rates>(- (acc, [currency, value]) => {- return {- ...acc,- [currency]: value / baseRate,- };- },- {- [data.base]: 1,- }- );-- return convertedRates;- }-- throw new Error("Unrecognized response from exchange rates server");- }-}--const apiKey = process.env.EXCHANGE_RATES_API_KEY;-const apiUrl = process.env.EXCHANGE_RATES_API_URL;--export const exchangeRatesClient = new ExchangeRatesClient({- apiKey,- apiUrl,- baseCurrency: "USD",-});diff --git a/shared/app/lib/logger.server.ts b/shared/app/lib/logger.server.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/shared/app/lib/supabase.server.ts b/shared/app/lib/supabase.server.tsdeleted file mode 100644index d60eecd980..0000000000--- a/shared/app/lib/supabase.server.ts+++ /dev/null@@ -1,10 +0,0 @@-import { createClient } from "@supabase/supabase-js";--const supabaseUrl = process.env.GLOBAL_SUPABASE_URL;-const supabaseServiceRoleKey = process.env.GLOBAL_SUPABASE_SERVICE_ROLE_KEY;--if (!supabaseUrl) throw new Error("GLOBAL_SUPABASE_URL not set");-if (!supabaseServiceRoleKey)- throw new Error("GLOBAL_SUPABASE_SERVICE_ROLE not set");--export const supabaseClient = createClient(supabaseUrl, supabaseServiceRoleKey);diff --git a/shared/app/lib/trigger.server.ts b/shared/app/lib/trigger.server.tsdeleted file mode 100644index 87518f1b59..0000000000--- a/shared/app/lib/trigger.server.ts+++ /dev/null@@ -1,7 +0,0 @@-import { TriggerClient } from "@trigger.dev/sdk";--export const triggerClient = new TriggerClient({- id: "carbon-erp-wzkF",- apiKey: process.env.TRIGGER_API_KEY,- apiUrl: process.env.TRIGGER_API_URL,-});diff --git a/shared/app/root.tsx b/shared/app/root.tsxdeleted file mode 100644index a256b6190b..0000000000--- a/shared/app/root.tsx+++ /dev/null@@ -1,40 +0,0 @@-import type { MetaFunction } from "@remix-run/node";-import {- Links,- LiveReload,- Meta,- Outlet,- Scripts,- ScrollRestoration,-} from "@remix-run/react";--export const meta: MetaFunction = () => {- return [- {- charset: "utf-8",- },- {- title: "Carbon Shared",- },- {- viewport: "width=device-width",- },- ];-};--export default function App() {- return (- <html lang="en">- <head>- <Meta />- <Links />- </head>- <body>- <Outlet />- <ScrollRestoration />- <LiveReload />- <Scripts />- </body>- </html>- );-}diff --git a/shared/app/routes/api.trigger.ts b/shared/app/routes/api.trigger.tsdeleted file mode 100644index 948910b58b..0000000000--- a/shared/app/routes/api.trigger.ts+++ /dev/null@@ -1,8 +0,0 @@-import { createRemixRoute } from "@trigger.dev/remix";-import { triggerClient } from "~/lib/trigger.server";--// Remix will automatically strip files with side effects-// So we need to *export* our Job definitions like this:-export * from "~/jobs/get-exchange-rates.server";--export const { action } = createRemixRoute(triggerClient);diff --git a/shared/package.json b/shared/package.jsondeleted file mode 100644index ec336826a3..0000000000--- a/shared/package.json+++ /dev/null@@ -1,49 +0,0 @@-{- "name": "shared",- "private": true,- "license": "Apache-2.0",- "sideEffects": false,- "scripts": {- "build": "remix build",- "dev": "PORT=3000 run-p dev:*",- "dev:remix": "remix dev",- "dev:trigger": "npx @trigger.dev/cli@latest dev",- "start": "remix-serve ./build/index.js",- "clean": "rimraf .cache .turbo node_modules dist build",- "lint": "TIMING=1 eslint \"app/**/*.ts*\"",- "types": "tsc"- },- "dependencies": {- "@carbon/logger": "*",- "@remix-run/dev": "~2.2.0",- "@remix-run/eslint-config": "~2.2.0",- "@remix-run/node": "~2.2.0",- "@remix-run/react": "~2.2.0",- "@remix-run/serve": "~2.2.0",- "@supabase/supabase-js": "^2.38.4",- "@trigger.dev/react": "^2.2.2",- "@trigger.dev/remix": "^2.2.2",- "@trigger.dev/sdk": "^2.2.2",- "@vercel/analytics": "^1.0.2",- "@vercel/remix": "2.2.0",- "axios": "^1.6.5",- "isbot": "latest",- "remix-flat-routes": "^0.5.10",- "remix-validated-form": "^5.0.2",- "zod": "^3.21.4"- },- "devDependencies": {- "@carbon/tsconfig": "*",- "@types/react": "^18.2.17",- "@types/react-dom": "^18.2.7",- "cross-env": "7.0.3",- "nodemon": "^3.0.1",- "typescript": "^5.2.2"- },- "engines": {- "node": ">=18"- },- "trigger.dev": {- "endpointId": "carbon-erp-wzkF"- }-}diff --git a/shared/public/android-chrome-192x192.png b/shared/public/android-chrome-192x192.pngdeleted file mode 100644index 777cc381ef..0000000000Binary files a/shared/public/android-chrome-192x192.png and /dev/null differdiff --git a/shared/public/android-chrome-512x512.png b/shared/public/android-chrome-512x512.pngdeleted file mode 100644index bd3fb48e59..0000000000Binary files a/shared/public/android-chrome-512x512.png and /dev/null differdiff --git a/shared/public/apple-touch-icon.png b/shared/public/apple-touch-icon.pngdeleted file mode 100644index 4f8712f2c1..0000000000Binary files a/shared/public/apple-touch-icon.png and /dev/null differdiff --git a/shared/public/carbon-logo-dark.png b/shared/public/carbon-logo-dark.pngdeleted file mode 100644index 75399c8d11..0000000000Binary files a/shared/public/carbon-logo-dark.png and /dev/null differdiff --git a/shared/public/carbon-logo-light.png b/shared/public/carbon-logo-light.pngdeleted file mode 100644index c0f93e6fe2..0000000000Binary files a/shared/public/carbon-logo-light.png and /dev/null differdiff --git a/shared/public/favicon-16x16.png b/shared/public/favicon-16x16.pngdeleted file mode 100644index eb216e453f..0000000000Binary files a/shared/public/favicon-16x16.png and /dev/null differdiff --git a/shared/public/favicon-32x32.png b/shared/public/favicon-32x32.pngdeleted file mode 100644index a7064d2122..0000000000Binary files a/shared/public/favicon-32x32.png and /dev/null differdiff --git a/shared/public/favicon.ico b/shared/public/favicon.icodeleted file mode 100644index ce92de6710..0000000000Binary files a/shared/public/favicon.ico and /dev/null differdiff --git a/shared/public/site.webmanifest b/shared/public/site.webmanifestdeleted file mode 100644index 4e209ea8a1..0000000000--- a/shared/public/site.webmanifest+++ /dev/null@@ -1,19 +0,0 @@-{- "name": "Carbon",- "short_name": "Carbon",- "icons": [- {- "src": "/android-chrome-192x192.png",- "sizes": "192x192",- "type": "image/png"- },- {- "src": "/android-chrome-512x512.png",- "sizes": "512x512",- "type": "image/png"- }- ],- "theme_color": "#ffffff",- "background_color": "#ffffff",- "display": "standalone"-}diff --git a/shared/public/static/grid.svg b/shared/public/static/grid.svgdeleted file mode 100644index 76e3b29f0d..0000000000--- a/shared/public/static/grid.svg+++ /dev/null@@ -1,5 +0,0 @@--<svg id="download" xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">- <path id="Path_3" data-name="Path 3" d="M96,95h4v1H96v4H95V96H86v4H85V96H76v4H75V96H66v4H65V96H56v4H55V96H46v4H45V96H36v4H35V96H26v4H25V96H16v4H15V96H0V95H15V86H0V85H15V76H0V75H15V66H0V65H15V56H0V55H15V46H0V45H15V36H0V35H15V26H0V25H15V16H0V15H15V0h1V15h9V0h1V15h9V0h1V15h9V0h1V15h9V0h1V15h9V0h1V15h9V0h1V15h9V0h1V15h9V0h1V15h4v1H96v9h4v1H96v9h4v1H96v9h4v1H96v9h4v1H96v9h4v1H96v9h4v1H96v9h4v1H96Zm-1,0V86H86v9ZM85,95V86H76v9ZM75,95V86H66v9ZM65,95V86H56v9ZM55,95V86H46v9ZM45,95V86H36v9ZM35,95V86H26v9ZM25,95V86H16v9ZM16,85h9V76H16Zm10,0h9V76H26Zm10,0h9V76H36Zm10,0h9V76H46Zm10,0h9V76H56Zm10,0h9V76H66Zm10,0h9V76H76Zm10,0h9V76H86Zm9-10V66H86v9ZM85,75V66H76v9ZM75,75V66H66v9ZM65,75V66H56v9ZM55,75V66H46v9ZM45,75V66H36v9ZM35,75V66H26v9ZM25,75V66H16v9ZM16,65h9V56H16Zm10,0h9V56H26Zm10,0h9V56H36Zm10,0h9V56H46Zm10,0h9V56H56Zm10,0h9V56H66Zm10,0h9V56H76Zm10,0h9V56H86Zm9-10V46H86v9ZM85,55V46H76v9ZM75,55V46H66v9ZM65,55V46H56v9ZM55,55V46H46v9ZM45,55V46H36v9ZM35,55V46H26v9ZM25,55V46H16v9ZM16,45h9V36H16Zm10,0h9V36H26Zm10,0h9V36H36Zm10,0h9V36H46Zm10,0h9V36H56Zm10,0h9V36H66Zm10,0h9V36H76Zm10,0h9V36H86Zm9-10V26H86v9ZM85,35V26H76v9ZM75,35V26H66v9ZM65,35V26H56v9ZM55,35V26H46v9ZM45,35V26H36v9ZM35,35V26H26v9ZM25,35V26H16v9ZM16,25h9V16H16Zm10,0h9V16H26Zm10,0h9V16H36Zm10,0h9V16H46Zm10,0h9V16H56Zm10,0h9V16H66Zm10,0h9V16H76Zm10,0h9V16H86Z" fill="rgba(255,255,255,0.1)" fill-rule="evenodd" opacity="0.5"/>- <path id="Path_4" data-name="Path 4" d="M6,5V0H5V5H0V6H5v94H6V6h94V5Z" fill="rgba(255,255,255,0.1)" fill-rule="evenodd"/>-</svg>diff --git a/shared/remix.config.js b/shared/remix.config.jsdeleted file mode 100644index 510a2963db..0000000000--- a/shared/remix.config.js+++ /dev/null@@ -1,36 +0,0 @@-const path = require("node:path");-const { flatRoutes } = require("remix-flat-routes");--/** @type {import('@remix-run/dev').AppConfig} */--module.exports = {- // appDirectory: "app",- // assetsBuildDirectory: "public/build",- // publicPath: "/build/",- // serverBuildPath: "build/index.js",- future: {},- ignoredRouteFiles: ["**/.*"],- serverModuleFormat: "cjs",- serverPlatform: "node",- serverMinify: false,- routes: async (defineRoutes) => {- return flatRoutes("routes", defineRoutes, {- // eslint-disable-next-line no-undef- appDir: path.resolve(__dirname, "app"),- });- },- serverDependenciesToBundle: [- "@carbon/logger",- "@carbon/react",- "@carbon/utils",- "nanostores",- "@nanostores/react",- ],- watchPaths: async () => {- return [- "../../packages/react/src/**/*",- "../../packages/logger/src/**/*",- "../../packages/utils/src/**/*",- ];- },-};diff --git a/shared/remix.env.d.ts b/shared/remix.env.d.tsdeleted file mode 100644index 14a1152eb2..0000000000--- a/shared/remix.env.d.ts+++ /dev/null@@ -1,3 +0,0 @@-/// <reference types="@remix-run/dev" />-/// <reference types="@remix-run/node/globals" />-/// <reference types="@vercel/remix" />diff --git a/shared/tsconfig.json b/shared/tsconfig.jsondeleted file mode 100644index dd6ade907b..0000000000--- a/shared/tsconfig.json+++ /dev/null@@ -1,21 +0,0 @@-{- "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],- "compilerOptions": {- "lib": ["dom", "dom.iterable", "ES2019"],- "esModuleInterop": true,- "jsx": "react-jsx",- "moduleResolution": "node",- "resolveJsonModule": true,- "target": "ES2019",- "strict": true,- "forceConsistentCasingInFileNames": true,- "allowJs": true,- "baseUrl": ".",- "paths": {- "~/*": ["./app/*"]- },- "noEmit": true,- "isolatedModules": true,- "skipLibCheck": true- }-}