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
Vercel deploy (#17)
Brad Barbin5292661ce9e5
diff --git a/.env.example b/.env.exampleindex 8f9ddb0456..79e3eab06d 100644--- a/.env.example+++ b/.env.example@@ -3,4 +3,4 @@ SESSION_SECRET="super-duper-s3cret"SUPABASE_ANON_PUBLIC="************"SUPABASE_SERVICE_ROLE="***********"SUPABASE_API_URL="http://localhost:54321"-SERVER_URL="http://localhost:3000"\ No newline at end of file+VERCEL_URL="http://localhost:3000"\ No newline at end of filediff --git a/.github/actions/setup-monorepo/action.yml b/.github/actions/dependencies/action.ymlsimilarity index 100%rename from .github/actions/setup-monorepo/action.ymlrename to .github/actions/dependencies/action.ymldiff --git a/.github/workflows/deploy.yml b/.github/workflows/supabase-prod.ymlsimilarity index 93%rename from .github/workflows/deploy.ymlrename to .github/workflows/supabase-prod.ymlindex 74d55129c6..564df58b63 100644--- a/.github/workflows/deploy.yml+++ b/.github/workflows/supabase-prod.yml@@ -28,7 +28,7 @@ jobs:uses: actions/checkout@v3- name: 📦 Install dependencies- uses: ./.github/actions/setup-monorepo+ uses: ./.github/actions/dependencies- name: 🚀 Sync local database with supabase remoterun: yarn deploydiff --git a/apps/carbon/app/config/env.ts b/apps/carbon/app/config/env.tsindex 40b92f073a..c7ec72a899 100644--- a/apps/carbon/app/config/env.ts+++ b/apps/carbon/app/config/env.ts@@ -14,7 +14,7 @@ declare global {interface ProcessEnv {SUPABASE_URL: string;SUPABASE_SERVICE_ROLE: string;- SERVER_URL: string;+ VERCEL_URL: string;SUPABASE_ANON_PUBLIC: string;SESSION_SECRET: string;SESSION_KEY: string;@@ -50,7 +50,7 @@ function getEnv(/*** Server env*/-export const SERVER_URL = getEnv("SERVER_URL");+export const VERCEL_URL = getEnv("VERCEL_URL");export const SUPABASE_SERVICE_ROLE = getEnv("SUPABASE_SERVICE_ROLE");export const SESSION_SECRET = getEnv("SESSION_SECRET");export const SESSION_KEY = "authenticated";@@ -76,3 +76,7 @@ export function getBrowserEnv() {SUPABASE_ANON_PUBLIC,};}++export function isVercel() {+ return VERCEL_URL.includes("vercel.app");+}diff --git a/apps/carbon/app/lib/bullmq/bullmq.server.ts b/apps/carbon/app/lib/bullmq/bullmq.server.tsindex 2410f64869..f31889c2a7 100644--- a/apps/carbon/app/lib/bullmq/bullmq.server.ts+++ b/apps/carbon/app/lib/bullmq/bullmq.server.ts@@ -1,6 +1,7 @@import { redis } from "@carbon/redis";import type { Processor } from "bullmq";import { Queue as BullQueue, Worker } from "bullmq";+import { isVercel } from "~/config/env";type RegisteredQueue = {queue: BullQueue;@@ -14,10 +15,16 @@ declare global {const registeredQueues =global.__registeredQueues || (global.__registeredQueues = {});+const mockQueue = {+ add: (args: any) => Promise.resolve(),+ addBulk: (args: any) => Promise.resolve(),+};+export const Queue = <Payload>(name: string,handler: Processor<Payload>): BullQueue<Payload> => {+ if (isVercel()) return mockQueue as any;if (registeredQueues[name]) {return registeredQueues[name].queue;}diff --git a/apps/carbon/app/queues/resend-invites.queue.server.ts b/apps/carbon/app/queues/resend-invites.queue.server.tsindex ed8af6880f..3cb1761f68 100644--- a/apps/carbon/app/queues/resend-invites.queue.server.ts+++ b/apps/carbon/app/queues/resend-invites.queue.server.ts@@ -1,3 +1,4 @@+import { isVercel } from "~/config/env";import { Queue } from "~/lib/bullmq";import { getSupabaseServiceRole } from "~/lib/supabase";import { resendInvite } from "~/services/users";@@ -8,9 +9,7 @@ export type ResendInvitesQueueData = {const client = getSupabaseServiceRole();-export const resendInvitesQueue = Queue<ResendInvitesQueueData>(- "resendInvites:v1",- async (job) => {- await resendInvite(client, job.data.id);- }-);+export const resendInvitesQueue = isVercel();+Queue<ResendInvitesQueueData>("resendInvites:v1", async (job) => {+ await resendInvite(client, job.data.id);+});diff --git a/apps/carbon/app/routes/_public.tsx b/apps/carbon/app/routes/_public+/_layout.tsxsimilarity index 100%rename from apps/carbon/app/routes/_public.tsxrename to apps/carbon/app/routes/_public+/_layout.tsxdiff --git a/apps/carbon/app/routes/x.tsx b/apps/carbon/app/routes/x+/_layout.tsxsimilarity index 100%rename from apps/carbon/app/routes/x.tsxrename to apps/carbon/app/routes/x+/_layout.tsxdiff --git a/apps/carbon/app/routes/x+/account.$userId.attribute.tsx b/apps/carbon/app/routes/x+/account+/$userId.attribute.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/account.$userId.attribute.tsxrename to apps/carbon/app/routes/x+/account+/$userId.attribute.tsxdiff --git a/apps/carbon/app/routes/x+/account.$userId.delete.attribute.tsx b/apps/carbon/app/routes/x+/account+/$userId.delete.attribute.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/account.$userId.delete.attribute.tsxrename to apps/carbon/app/routes/x+/account+/$userId.delete.attribute.tsxdiff --git a/apps/carbon/app/routes/x+/account.tsx b/apps/carbon/app/routes/x+/account+/_layout.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/account.tsxrename to apps/carbon/app/routes/x+/account+/_layout.tsxdiff --git a/apps/carbon/app/routes/x+/account.index.tsx b/apps/carbon/app/routes/x+/account+/index.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/account.index.tsxrename to apps/carbon/app/routes/x+/account+/index.tsxdiff --git a/apps/carbon/app/routes/x+/account.password.tsx b/apps/carbon/app/routes/x+/account+/password.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/account.password.tsxrename to apps/carbon/app/routes/x+/account+/password.tsxdiff --git a/apps/carbon/app/routes/x+/account.personal.tsx b/apps/carbon/app/routes/x+/account+/personal.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/account.personal.tsxrename to apps/carbon/app/routes/x+/account+/personal.tsxdiff --git a/apps/carbon/app/routes/x+/account.profile.tsx b/apps/carbon/app/routes/x+/account+/profile.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/account.profile.tsxrename to apps/carbon/app/routes/x+/account+/profile.tsxdiff --git a/apps/carbon/app/routes/x+/account.notifications.tsx b/apps/carbon/app/routes/x+/account.notifications.tsxdeleted file mode 100644index a55ba233d5..0000000000--- a/apps/carbon/app/routes/x+/account.notifications.tsx+++ /dev/null@@ -1,3 +0,0 @@-export default function AccountNotifications() {- return <p>Profile</p>;-}diff --git a/apps/carbon/app/routes/x+/account.security.tsx b/apps/carbon/app/routes/x+/account.security.tsxdeleted file mode 100644index 29e6066521..0000000000--- a/apps/carbon/app/routes/x+/account.security.tsx+++ /dev/null@@ -1,3 +0,0 @@-export default function AccountSecurity() {- return <p>Security</p>;-}diff --git a/apps/carbon/app/routes/x+/account.settings.tsx b/apps/carbon/app/routes/x+/account.settings.tsxdeleted file mode 100644index 5a1040ee4c..0000000000--- a/apps/carbon/app/routes/x+/account.settings.tsx+++ /dev/null@@ -1,3 +0,0 @@-export default function AccountSettings() {- return <p>Settings</p>;-}diff --git a/apps/carbon/app/routes/x+/parts.tsx b/apps/carbon/app/routes/x+/parts+/index.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/parts.tsxrename to apps/carbon/app/routes/x+/parts+/index.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.tsx b/apps/carbon/app/routes/x+/purchasing+/_layout.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.tsxrename to apps/carbon/app/routes/x+/purchasing+/_layout.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.index.tsx b/apps/carbon/app/routes/x+/purchasing+/index.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.index.tsxrename to apps/carbon/app/routes/x+/purchasing+/index.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.supplier-types.$supplierTypeId.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.supplier-types.$supplierTypeId.tsxrename to apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.supplier-types.delete.$supplierTypeId.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.delete.$supplierTypeId.tsxsimilarity index 89%rename from apps/carbon/app/routes/x+/purchasing.supplier-types.delete.$supplierTypeId.tsxrename to apps/carbon/app/routes/x+/purchasing+/supplier-types.delete.$supplierTypeId.tsxindex 30125e971c..3482046980 100644--- a/apps/carbon/app/routes/x+/purchasing.supplier-types.delete.$supplierTypeId.tsx+++ b/apps/carbon/app/routes/x+/purchasing+/supplier-types.delete.$supplierTypeId.tsx@@ -27,7 +27,7 @@ export async function loader({ request, params }: LoaderArgs) {);}- return json(supplierType);+ return json({ supplierType: supplierType.data });}export async function action({ request, params }: ActionArgs) {@@ -65,17 +65,17 @@ export async function action({ request, params }: ActionArgs) {export default function DeleteSupplierTypeRoute() {const { supplierTypeId } = useParams();- const { data } = useLoaderData<typeof loader>();+ const { supplierType } = useLoaderData<typeof loader>();const navigate = useNavigate();- if (!supplierTypeId || !data) return null; // TODO - handle this better (404?)+ if (!supplierTypeId || !supplierType) return null; // TODO - handle this better (404?)const onCancel = () => navigate("/x/purchasing/supplier-types");return (<ConfirmDeleteaction={`/x/purchasing/supplier-types/delete/${supplierTypeId}`}- name={data.name}- text={`Are you sure you want to delete the supplier type: ${data.name}? This cannot be undone.`}+ name={supplierType.name}+ text={`Are you sure you want to delete the supplier type: ${supplierType.name}? This cannot be undone.`}onCancel={onCancel}/>);diff --git a/apps/carbon/app/routes/x+/purchasing.supplier-types.new.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.supplier-types.new.tsxrename to apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.supplier-types.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.supplier-types.tsxrename to apps/carbon/app/routes/x+/purchasing+/supplier-types.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.$supplierContactId.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.$supplierContactId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.$supplierContactId.tsxrename to apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.$supplierContactId.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.delete.$supplierContactId.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.delete.$supplierContactId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.delete.$supplierContactId.tsxrename to apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.delete.$supplierContactId.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.new.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.new.tsxrename to apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.contact.new.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.$supplierLocationId.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.$supplierLocationId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.$supplierLocationId.tsxrename to apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.$supplierLocationId.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.delete.$supplierLocationId.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.delete.$supplierLocationId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.delete.$supplierLocationId.tsxrename to apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.delete.$supplierLocationId.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.new.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.new.tsxrename to apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.location.new.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.tsxrename to apps/carbon/app/routes/x+/purchasing+/suppliers.$supplierId.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.suppliers.new.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.suppliers.new.tsxrename to apps/carbon/app/routes/x+/purchasing+/suppliers.new.tsxdiff --git a/apps/carbon/app/routes/x+/purchasing.suppliers.tsx b/apps/carbon/app/routes/x+/purchasing+/suppliers.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/purchasing.suppliers.tsxrename to apps/carbon/app/routes/x+/purchasing+/suppliers.tsxdiff --git a/apps/carbon/app/routes/x+/resources.tsx b/apps/carbon/app/routes/x+/resources+/_layout.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.tsxrename to apps/carbon/app/routes/x+/resources+/_layout.tsxdiff --git a/apps/carbon/app/routes/x+/resources.abilities.delete.$abilityId.tsx b/apps/carbon/app/routes/x+/resources+/abilities.delete.$abilityId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.abilities.delete.$abilityId.tsxrename to apps/carbon/app/routes/x+/resources+/abilities.delete.$abilityId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.abilities.new.tsx b/apps/carbon/app/routes/x+/resources+/abilities.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.abilities.new.tsxrename to apps/carbon/app/routes/x+/resources+/abilities.new.tsxdiff --git a/apps/carbon/app/routes/x+/resources.abilities.tsx b/apps/carbon/app/routes/x+/resources+/abilities.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.abilities.tsxrename to apps/carbon/app/routes/x+/resources+/abilities.tsxdiff --git a/apps/carbon/app/routes/x+/resources.ability.$abilityId.employee.$id.tsx b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.$id.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.ability.$abilityId.employee.$id.tsxrename to apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.$id.tsxdiff --git a/apps/carbon/app/routes/x+/resources.ability.$abilityId.employee.delete.$id.tsx b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.delete.$id.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.ability.$abilityId.employee.delete.$id.tsxrename to apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.delete.$id.tsxdiff --git a/apps/carbon/app/routes/x+/resources.ability.$abilityId.employee.new.tsx b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.ability.$abilityId.employee.new.tsxrename to apps/carbon/app/routes/x+/resources+/ability.$abilityId.employee.new.tsxdiff --git a/apps/carbon/app/routes/x+/resources.ability.$abilityId.tsx b/apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.ability.$abilityId.tsxrename to apps/carbon/app/routes/x+/resources+/ability.$abilityId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.attribute.$attributeId.tsx b/apps/carbon/app/routes/x+/resources+/attribute.$attributeId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.attribute.$attributeId.tsxrename to apps/carbon/app/routes/x+/resources+/attribute.$attributeId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.attribute.delete.$attributeId.tsx b/apps/carbon/app/routes/x+/resources+/attribute.delete.$attributeId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.attribute.delete.$attributeId.tsxrename to apps/carbon/app/routes/x+/resources+/attribute.delete.$attributeId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.attribute.new.tsx b/apps/carbon/app/routes/x+/resources+/attribute.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.attribute.new.tsxrename to apps/carbon/app/routes/x+/resources+/attribute.new.tsxdiff --git a/apps/carbon/app/routes/x+/resources.attributes.$categoryId.tsx b/apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.attributes.$categoryId.tsxrename to apps/carbon/app/routes/x+/resources+/attributes.$categoryId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.attributes.delete.$categoryId.tsx b/apps/carbon/app/routes/x+/resources+/attributes.delete.$categoryId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.attributes.delete.$categoryId.tsxrename to apps/carbon/app/routes/x+/resources+/attributes.delete.$categoryId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.attributes.list.$categoryId.$attributeId.tsx b/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.$attributeId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.attributes.list.$categoryId.$attributeId.tsxrename to apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.$attributeId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.attributes.list.$categoryId.new.tsx b/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.attributes.list.$categoryId.new.tsxrename to apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.new.tsxdiff --git a/apps/carbon/app/routes/x+/resources.attributes.list.$categoryId.tsx b/apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.attributes.list.$categoryId.tsxrename to apps/carbon/app/routes/x+/resources+/attributes.list.$categoryId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.attributes.new.tsx b/apps/carbon/app/routes/x+/resources+/attributes.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.attributes.new.tsxrename to apps/carbon/app/routes/x+/resources+/attributes.new.tsxdiff --git a/apps/carbon/app/routes/x+/resources.attributes.tsx b/apps/carbon/app/routes/x+/resources+/attributes.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.attributes.tsxrename to apps/carbon/app/routes/x+/resources+/attributes.tsxdiff --git a/apps/carbon/app/routes/x+/resources.index.tsx b/apps/carbon/app/routes/x+/resources+/index.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.index.tsxrename to apps/carbon/app/routes/x+/resources+/index.tsxdiff --git a/apps/carbon/app/routes/x+/resources.locations.$locationId.tsx b/apps/carbon/app/routes/x+/resources+/locations.$locationId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.locations.$locationId.tsxrename to apps/carbon/app/routes/x+/resources+/locations.$locationId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.locations.delete.$locationId.tsx b/apps/carbon/app/routes/x+/resources+/locations.delete.$locationId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.locations.delete.$locationId.tsxrename to apps/carbon/app/routes/x+/resources+/locations.delete.$locationId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.locations.new.tsx b/apps/carbon/app/routes/x+/resources+/locations.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.locations.new.tsxrename to apps/carbon/app/routes/x+/resources+/locations.new.tsxdiff --git a/apps/carbon/app/routes/x+/resources.locations.tsx b/apps/carbon/app/routes/x+/resources+/locations.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.locations.tsxrename to apps/carbon/app/routes/x+/resources+/locations.tsxdiff --git a/apps/carbon/app/routes/x+/resources.people.tsx b/apps/carbon/app/routes/x+/resources+/people.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.people.tsxrename to apps/carbon/app/routes/x+/resources+/people.tsxdiff --git a/apps/carbon/app/routes/x+/resources.person.$personId.notes.delete.$noteId.tsx b/apps/carbon/app/routes/x+/resources+/person.$personId.notes.delete.$noteId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.person.$personId.notes.delete.$noteId.tsxrename to apps/carbon/app/routes/x+/resources+/person.$personId.notes.delete.$noteId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.person.$personId.notes.new.tsx b/apps/carbon/app/routes/x+/resources+/person.$personId.notes.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.person.$personId.notes.new.tsxrename to apps/carbon/app/routes/x+/resources+/person.$personId.notes.new.tsxdiff --git a/apps/carbon/app/routes/x+/resources.person.$personId.tsx b/apps/carbon/app/routes/x+/resources+/person.$personId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.person.$personId.tsxrename to apps/carbon/app/routes/x+/resources+/person.$personId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.shifts.$shiftId.tsx b/apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.shifts.$shiftId.tsxrename to apps/carbon/app/routes/x+/resources+/shifts.$shiftId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.shifts.delete.$shiftId.tsx b/apps/carbon/app/routes/x+/resources+/shifts.delete.$shiftId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.shifts.delete.$shiftId.tsxrename to apps/carbon/app/routes/x+/resources+/shifts.delete.$shiftId.tsxdiff --git a/apps/carbon/app/routes/x+/resources.shifts.new.tsx b/apps/carbon/app/routes/x+/resources+/shifts.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.shifts.new.tsxrename to apps/carbon/app/routes/x+/resources+/shifts.new.tsxdiff --git a/apps/carbon/app/routes/x+/resources.shifts.tsx b/apps/carbon/app/routes/x+/resources+/shifts.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/resources.shifts.tsxrename to apps/carbon/app/routes/x+/resources+/shifts.tsxdiff --git a/apps/carbon/app/routes/x+/sales.tsx b/apps/carbon/app/routes/x+/sales+/_layout.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.tsxrename to apps/carbon/app/routes/x+/sales+/_layout.tsxdiff --git a/apps/carbon/app/routes/x+/sales.customer-types.$customerTypeId.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.customer-types.$customerTypeId.tsxrename to apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsxdiff --git a/apps/carbon/app/routes/x+/sales.customer-types.delete.$customerTypeId.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.delete.$customerTypeId.tsxsimilarity index 88%rename from apps/carbon/app/routes/x+/sales.customer-types.delete.$customerTypeId.tsxrename to apps/carbon/app/routes/x+/sales+/customer-types.delete.$customerTypeId.tsxindex f142ba3add..22165e99c1 100644--- a/apps/carbon/app/routes/x+/sales.customer-types.delete.$customerTypeId.tsx+++ b/apps/carbon/app/routes/x+/sales+/customer-types.delete.$customerTypeId.tsx@@ -26,7 +26,7 @@ export async function loader({ request, params }: LoaderArgs) {);}- return json(customerType);+ return json({ customerType: customerType.data });}export async function action({ request, params }: ActionArgs) {@@ -64,18 +64,18 @@ export async function action({ request, params }: ActionArgs) {export default function DeleteCustomerTypeRoute() {const { customerTypeId } = useParams();- const { data } = useLoaderData<typeof loader>();+ const { customerType } = useLoaderData<typeof loader>();const navigate = useNavigate();- if (!customerTypeId || !data) return null; // TODO - handle this better (404?)+ if (!customerTypeId || !customerType) return null; // TODO - handle this better (404?)const onCancel = () => navigate("/x/sales/customer-types");return (<ConfirmDeleteaction={`/x/sales/customer-types/delete/${customerTypeId}`}- name={data.name}- text={`Are you sure you want to delete the customer type: ${data.name}? This cannot be undone.`}+ name={customerType.name}+ text={`Are you sure you want to delete the customer type: ${customerType.name}? This cannot be undone.`}onCancel={onCancel}/>);diff --git a/apps/carbon/app/routes/x+/sales.customer-types.new.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.customer-types.new.tsxrename to apps/carbon/app/routes/x+/sales+/customer-types.new.tsxdiff --git a/apps/carbon/app/routes/x+/sales.customer-types.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.customer-types.tsxrename to apps/carbon/app/routes/x+/sales+/customer-types.tsxdiff --git a/apps/carbon/app/routes/x+/sales.customers.$customerId.contact.$customerContactId.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.$customerContactId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.customers.$customerId.contact.$customerContactId.tsxrename to apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.$customerContactId.tsxdiff --git a/apps/carbon/app/routes/x+/sales.customers.$customerId.contact.delete.$customerContactId.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.delete.$customerContactId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.customers.$customerId.contact.delete.$customerContactId.tsxrename to apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.delete.$customerContactId.tsxdiff --git a/apps/carbon/app/routes/x+/sales.customers.$customerId.contact.new.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.customers.$customerId.contact.new.tsxrename to apps/carbon/app/routes/x+/sales+/customers.$customerId.contact.new.tsxdiff --git a/apps/carbon/app/routes/x+/sales.customers.$customerId.location.$customerLocationId.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.$customerLocationId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.customers.$customerId.location.$customerLocationId.tsxrename to apps/carbon/app/routes/x+/sales+/customers.$customerId.location.$customerLocationId.tsxdiff --git a/apps/carbon/app/routes/x+/sales.customers.$customerId.location.delete.$customerLocationId.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.delete.$customerLocationId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.customers.$customerId.location.delete.$customerLocationId.tsxrename to apps/carbon/app/routes/x+/sales+/customers.$customerId.location.delete.$customerLocationId.tsxdiff --git a/apps/carbon/app/routes/x+/sales.customers.$customerId.location.new.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.location.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.customers.$customerId.location.new.tsxrename to apps/carbon/app/routes/x+/sales+/customers.$customerId.location.new.tsxdiff --git a/apps/carbon/app/routes/x+/sales.customers.$customerId.tsx b/apps/carbon/app/routes/x+/sales+/customers.$customerId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.customers.$customerId.tsxrename to apps/carbon/app/routes/x+/sales+/customers.$customerId.tsxdiff --git a/apps/carbon/app/routes/x+/sales.customers.new.tsx b/apps/carbon/app/routes/x+/sales+/customers.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.customers.new.tsxrename to apps/carbon/app/routes/x+/sales+/customers.new.tsxdiff --git a/apps/carbon/app/routes/x+/sales.customers.tsx b/apps/carbon/app/routes/x+/sales+/customers.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.customers.tsxrename to apps/carbon/app/routes/x+/sales+/customers.tsxdiff --git a/apps/carbon/app/routes/x+/sales.index.tsx b/apps/carbon/app/routes/x+/sales+/index.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/sales.index.tsxrename to apps/carbon/app/routes/x+/sales+/index.tsxdiff --git a/apps/carbon/app/routes/x+/users.tsx b/apps/carbon/app/routes/x+/users+/_layout.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.tsxrename to apps/carbon/app/routes/x+/users+/_layout.tsxdiff --git a/apps/carbon/app/routes/x+/users.bulk-edit-permissions.tsx b/apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.bulk-edit-permissions.tsxrename to apps/carbon/app/routes/x+/users+/bulk-edit-permissions.tsxdiff --git a/apps/carbon/app/routes/x+/users.customers.new.tsx b/apps/carbon/app/routes/x+/users+/customers.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.customers.new.tsxrename to apps/carbon/app/routes/x+/users+/customers.new.tsxdiff --git a/apps/carbon/app/routes/x+/users.customers.tsx b/apps/carbon/app/routes/x+/users+/customers.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.customers.tsxrename to apps/carbon/app/routes/x+/users+/customers.tsxdiff --git a/apps/carbon/app/routes/x+/users.deactivate.tsx b/apps/carbon/app/routes/x+/users+/deactivate.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.deactivate.tsxrename to apps/carbon/app/routes/x+/users+/deactivate.tsxdiff --git a/apps/carbon/app/routes/x+/users.employee-types.$employeeTypeId.tsx b/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.employee-types.$employeeTypeId.tsxrename to apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsxdiff --git a/apps/carbon/app/routes/x+/users.employee-types.delete.$employeeTypeId.tsx b/apps/carbon/app/routes/x+/users+/employee-types.delete.$employeeTypeId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.employee-types.delete.$employeeTypeId.tsxrename to apps/carbon/app/routes/x+/users+/employee-types.delete.$employeeTypeId.tsxdiff --git a/apps/carbon/app/routes/x+/users.employee-types.new.tsx b/apps/carbon/app/routes/x+/users+/employee-types.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.employee-types.new.tsxrename to apps/carbon/app/routes/x+/users+/employee-types.new.tsxdiff --git a/apps/carbon/app/routes/x+/users.employee-types.tsx b/apps/carbon/app/routes/x+/users+/employee-types.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.employee-types.tsxrename to apps/carbon/app/routes/x+/users+/employee-types.tsxdiff --git a/apps/carbon/app/routes/x+/users.employees.$employeeId.tsx b/apps/carbon/app/routes/x+/users+/employees.$employeeId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.employees.$employeeId.tsxrename to apps/carbon/app/routes/x+/users+/employees.$employeeId.tsxdiff --git a/apps/carbon/app/routes/x+/users.employees.new.tsx b/apps/carbon/app/routes/x+/users+/employees.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.employees.new.tsxrename to apps/carbon/app/routes/x+/users+/employees.new.tsxdiff --git a/apps/carbon/app/routes/x+/users.employees.tsx b/apps/carbon/app/routes/x+/users+/employees.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.employees.tsxrename to apps/carbon/app/routes/x+/users+/employees.tsxdiff --git a/apps/carbon/app/routes/x+/users.groups.$groupId.tsx b/apps/carbon/app/routes/x+/users+/groups.$groupId.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.groups.$groupId.tsxrename to apps/carbon/app/routes/x+/users+/groups.$groupId.tsxdiff --git a/apps/carbon/app/routes/x+/users.groups.delete.$groupId.tsx b/apps/carbon/app/routes/x+/users+/groups.delete.$groupId.tsxsimilarity index 87%rename from apps/carbon/app/routes/x+/users.groups.delete.$groupId.tsxrename to apps/carbon/app/routes/x+/users+/groups.delete.$groupId.tsxindex f1ad912fc9..c9d7eba715 100644--- a/apps/carbon/app/routes/x+/users.groups.delete.$groupId.tsx+++ b/apps/carbon/app/routes/x+/users+/groups.delete.$groupId.tsx@@ -25,7 +25,7 @@ export async function loader({ request, params }: LoaderArgs) {);}- return json(group);+ return json({ group: group.data });}export async function action({ request, params }: ActionArgs) {@@ -57,18 +57,18 @@ export async function action({ request, params }: ActionArgs) {export default function DeleteEmployeeTypeRoute() {const { groupId } = useParams();- const { data } = useLoaderData<typeof loader>();+ const { group } = useLoaderData<typeof loader>();const navigate = useNavigate();- if (!groupId || !data) return null; // TODO - handle this better (404?)+ if (!groupId || !group) return null; // TODO - handle this better (404?)const onCancel = () => navigate("/x/users/groups");return (<ConfirmDeleteaction={`/x/users/groups/delete/${groupId}`}- name={data.name}- text={`Are you sure you want to delete the group: ${data.name}? This cannot be undone.`}+ name={group.name}+ text={`Are you sure you want to delete the group: ${group.name}? This cannot be undone.`}onCancel={onCancel}/>);diff --git a/apps/carbon/app/routes/x+/users.groups.new.tsx b/apps/carbon/app/routes/x+/users+/groups.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.groups.new.tsxrename to apps/carbon/app/routes/x+/users+/groups.new.tsxdiff --git a/apps/carbon/app/routes/x+/users.groups.tsx b/apps/carbon/app/routes/x+/users+/groups.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.groups.tsxrename to apps/carbon/app/routes/x+/users+/groups.tsxdiff --git a/apps/carbon/app/routes/x+/users.index.tsx b/apps/carbon/app/routes/x+/users+/index.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.index.tsxrename to apps/carbon/app/routes/x+/users+/index.tsxdiff --git a/apps/carbon/app/routes/x+/users.resend-invite.tsx b/apps/carbon/app/routes/x+/users+/resend-invite.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.resend-invite.tsxrename to apps/carbon/app/routes/x+/users+/resend-invite.tsxdiff --git a/apps/carbon/app/routes/x+/users.suppliers.new.tsx b/apps/carbon/app/routes/x+/users+/suppliers.new.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.suppliers.new.tsxrename to apps/carbon/app/routes/x+/users+/suppliers.new.tsxdiff --git a/apps/carbon/app/routes/x+/users.suppliers.tsx b/apps/carbon/app/routes/x+/users+/suppliers.tsxsimilarity index 100%rename from apps/carbon/app/routes/x+/users.suppliers.tsxrename to apps/carbon/app/routes/x+/users+/suppliers.tsxdiff --git a/apps/carbon/app/services/auth/auth.server.ts b/apps/carbon/app/services/auth/auth.server.tsindex 60d329a970..b86ecd49bb 100644--- a/apps/carbon/app/services/auth/auth.server.ts+++ b/apps/carbon/app/services/auth/auth.server.ts@@ -4,7 +4,7 @@ import type {AuthSession as SupabaseAuthSession,SupabaseClient,} from "@supabase/supabase-js";-import { SERVER_URL } from "~/config/env";+import { VERCEL_URL } from "~/config/env";import { REFRESH_ACCESS_TOKEN_THRESHOLD } from "~/config/env";import { getSupabase, getSupabaseServiceRole } from "~/lib/supabase";import { requireAuthSession, flash } from "~/services/session";@@ -145,7 +145,7 @@ export async function sendInviteByEmail(data?: Record<string, unknown>) {return getSupabaseServiceRole().auth.admin.inviteUserByEmail(email, {- redirectTo: `${SERVER_URL}/callback`,+ redirectTo: `${VERCEL_URL}/callback`,data,});}@@ -154,7 +154,7 @@ export async function sendMagicLink(email: string) {return getSupabaseServiceRole().auth.signInWithOtp({email,options: {- emailRedirectTo: `${SERVER_URL}/callback`,+ emailRedirectTo: `${VERCEL_URL}/callback`,},});}diff --git a/apps/carbon/package.json b/apps/carbon/package.jsonindex bc4aca6a4a..346ad4768f 100644--- a/apps/carbon/package.json+++ b/apps/carbon/package.json@@ -14,6 +14,7 @@"@carbon/database": "*","@carbon/logger": "*","@carbon/react": "*",+ "@carbon/redis": "*","@carbon/utils": "*","@chakra-ui/react": "^2.5.1","@chakra-ui/skip-nav": "^2.0.13",diff --git a/apps/carbon/remix.config.js b/apps/carbon/remix.config.jsindex 4a4f6736de..279c2f6c8f 100644--- a/apps/carbon/remix.config.js+++ b/apps/carbon/remix.config.js@@ -1,5 +1,14 @@+const path = require("node:path");const { flatRoutes } = require("remix-flat-routes");-const { getDependenciesToBundle } = require("@remix-run/dev");+const glob = require("glob");++const packages = glob+ .sync("packages/**/package.json", {+ cwd: path.join(__dirname, "..", ".."),+ ignore: ["**/node_modules/**"],+ absolute: true,+ })+ .map((pkg) => path.dirname(pkg));module.exports = {serverBuildTarget: "vercel",@@ -11,9 +20,7 @@ module.exports = {assetsBuildDirectory: "public/build",routes: async (defineRoutes) => {return flatRoutes("routes", defineRoutes, {- basePath: "/", // optional base path (defaults to /)- paramPrefixChar: "$", // optional specify param prefix- ignoredRouteFiles: [], // same as remix config+ appDir: path.resolve(__dirname, "app"),});},serverDependenciesToBundle: [@@ -22,12 +29,5 @@ module.exports = {"@carbon/react","@carbon/utils",],- watchPaths: async () => {- return [- "../../packages/carbon-react/src/**/*",- "../../packages/carbon-database/src/**/*",- "../../packages/carbon-logger/src/**/*",- "../../packages/carbon-utils/src/**/*",- ];- },+ watchPaths: packages,};diff --git a/packages/carbon-database/package.json b/packages/carbon-database/package.jsonindex 0a69d755e2..5165518426 100644--- a/packages/carbon-database/package.json+++ b/packages/carbon-database/package.json@@ -1,5 +1,5 @@{- "version": "1.0.0",+ "version": "0.0.1","name": "@carbon/database","private": true,"license": "MIT",diff --git a/packages/carbon-database/src/seed/admin.ts b/packages/carbon-database/src/seed/admin.tsindex f7234e89f1..57061e0b3f 100644--- a/packages/carbon-database/src/seed/admin.ts+++ b/packages/carbon-database/src/seed/admin.ts@@ -1,7 +1,7 @@import { possibleFeatures } from "./features";const admin = {- email: "[email protected]",+ email: "[email protected]",password: "carbon",firstName: "Carbon",lastName: "Admin",diff --git a/turbo.json b/turbo.jsonindex 90ed35ddae..b44608ac01 100644--- a/turbo.json+++ b/turbo.json@@ -5,6 +5,10 @@"outputs": ["dist/**", "build/**", "api/**", "public/build/**"],"dependsOn": ["^build"]},+ "carbon#build": {+ "dependsOn": ["^build"],+ "outputs": ["api/index.js", "api/build/**", "public/build/**"]+ },"test": {"outputs": ["coverage/**"],"dependsOn": []