Skip to content

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.

refactor: move domain to carbon.ms

Brad Barbin114ae184660a
diff --git a/apps/erp/app/hooks/useFlags.tsx b/apps/erp/app/hooks/useFlags.tsx
index 5bcf28aee6..37d20de891 100644
--- a/apps/erp/app/hooks/useFlags.tsx
+++ b/apps/erp/app/hooks/useFlags.tsx
@@ -5,7 +5,7 @@ import { useUser } from "./useUser";
export function useFlags() {
const user = useUser();
const edition = useEdition();
- const isInternal = ["carbon.us.org", "carbonos.dev", "blackcatlabs.xyz"].some(
+ const isInternal = ["@carbon.us.org", "@carbonos.dev", "@carbon.ms"].some(
(email) => user.email.includes(email)
);
diff --git a/apps/erp/app/routes/onboarding+/plan.tsx b/apps/erp/app/routes/onboarding+/plan.tsx
index 736a1dbc2b..208390b6a8 100644
--- a/apps/erp/app/routes/onboarding+/plan.tsx
+++ b/apps/erp/app/routes/onboarding+/plan.tsx
@@ -217,7 +217,7 @@ export default function OnboardingPlan() {
asChild
>
<a
- href="https://learn.carbonos.dev"
+ href="https://learn.carbon.ms"
target="_blank"
rel="noreferrer"
>
diff --git a/apps/erp/app/routes/x+/_layout.tsx b/apps/erp/app/routes/x+/_layout.tsx
index ce68a3a350..0732f1141c 100644
--- a/apps/erp/app/routes/x+/_layout.tsx
+++ b/apps/erp/app/routes/x+/_layout.tsx
@@ -191,7 +191,7 @@ function UniversityBanner() {
<input
type="hidden"
name="redirectTo"
- value="https://learn.carbonos.dev"
+ value="https://learn.carbon.ms"
/>
<Button
type="submit"
diff --git a/apps/erp/app/utils/path.ts b/apps/erp/app/utils/path.ts
index c668c47d55..3cba623416 100644
--- a/apps/erp/app/utils/path.ts
+++ b/apps/erp/app/utils/path.ts
@@ -7,7 +7,7 @@ const file = "/file"; // from ~/routes/file+ folder
const onboarding = "/onboarding"; // from ~/routes/onboarding+ folder
const mes = SUPABASE_URL.includes("localhost")
? "http://localhost:3001"
- : "https://mes.carbonos.dev";
+ : "https://mes.carbon.ms";
export const path = {
to: {
@@ -271,8 +271,8 @@ export const path = {
quote: (id: string) => generatePath(`${file}/quote/${id}.pdf`),
},
legal: {
- termsAndConditions: "https://carbonos.dev/terms",
- privacyPolicy: "https://carbonos.dev/privacy",
+ termsAndConditions: "https://carbon.ms/terms",
+ privacyPolicy: "https://carbon.ms/privacy",
},
onboarding: {
company: `${onboarding}/company`,
diff --git a/apps/university/app/utils/path.ts b/apps/university/app/utils/path.ts
index 6c4a413df3..72d950621e 100644
--- a/apps/university/app/utils/path.ts
+++ b/apps/university/app/utils/path.ts
@@ -7,7 +7,7 @@ const lesson = "/lesson"; // from ~/routes/lesson+ folder
const ERP_URL = SUPABASE_URL.includes("localhost")
? "http://localhost:3000"
- : "https://app.carbonos.dev";
+ : "https://app.carbon.ms";
export const path = {
to: {
diff --git a/llm/cache/billing-system.md b/llm/cache/billing-system.md
index 5330b72d2f..392884d82e 100644
--- a/llm/cache/billing-system.md
+++ b/llm/cache/billing-system.md
@@ -17,16 +17,20 @@ Carbon has three editions defined in `packages/utils/src/types.ts`:
The system supports multiple subscription plans defined in the database:
### Public Plans
+
- **STARTER** (`price_1RgUYhFV6ecOa0XvD37hQOhK`) - Cloud Starter plan with user-based pricing
- **BUSINESS** (`price_1RjLE1FV6ecOa0Xv0kmTHWPu`) - Cloud Business plan with user-based pricing
### Private Plans (Design Partners)
+
- **PARTNER-400** (`price_1RgXMSFV6ecOa0XvLQtlhQr0`) - Flat fee pricing
- **PARTNER-300** (`price_1Rj20jFV6ecOa0Xvk4WV6b7l`) - Flat fee pricing
- **PARTNER-500** (`price_1Rj21OFV6ecOa0XvCTdELYdv`) - Flat fee pricing
### Plan Features
+
Each plan includes:
+
- `tasksLimit` - Maximum number of tasks (default: 10,000)
- `aiTokensLimit` - Maximum AI tokens (default: 1,000,000)
- `stripeTrialPeriodDays` - Trial period length (default: 7-30 days)
@@ -37,17 +41,20 @@ Each plan includes:
### Core Tables
**plan** table:
+
- Stores plan definitions with Stripe price IDs
- Includes limits for tasks, AI tokens, and trial periods
- Supports both user-based and flat fee pricing models
**companyPlan** table:
+
- Links companies to their active plans
- Stores Stripe customer and subscription IDs
- Tracks subscription status and dates
- Includes usage limits inherited from the plan
**companyUsage** table:
+
- Tracks actual usage of users, tasks, and AI tokens
- Includes reset date for usage periods
- Used for enforcing plan limits
@@ -57,12 +64,15 @@ Each plan includes:
Located in `/packages/stripe/`, the integration provides:
### Key Features
+
1. **Customer Management**
+
- Automatic customer creation during checkout
- Customer ID stored in Redis KV store
- Metadata linking to userId and companyId
2. **Subscription Management**
+
- Checkout session creation with multiple payment methods
- Subscription status syncing via webhooks
- Automatic quantity updates for user-based pricing
@@ -73,12 +83,15 @@ Located in `/packages/stripe/`, the integration provides:
- Plan changes and cancellations
### Webhook Events
+
The system handles various Stripe webhook events:
+
- `checkout.session.completed` - Triggers onboarding flow
- `customer.subscription.*` - Updates subscription status
- `invoice.*` - Payment processing events
### Environment Variables
+
- `STRIPE_SECRET_KEY` - Stripe API key
- `STRIPE_WEBHOOK_SECRET` - Webhook signature verification
- `STRIPE_BYPASS_COMPANY_IDS` - Comma-separated list of companies to bypass billing
@@ -86,13 +99,17 @@ The system handles various Stripe webhook events:
## Usage Tracking
### User-Based Pricing
+
For plans with `userBasedPricing = true`:
+
- Counts active users per company (excluding @carbonos.dev emails)
- Automatically updates Stripe subscription quantity
- Triggered when users are added/removed from companies
### Usage Limits
+
The system tracks:
+
- Number of active users
- Task usage
- AI token consumption
@@ -100,10 +117,12 @@ The system tracks:
## Frontend Integration
### Hooks
+
- `usePlan()` - Returns the current company's plan
- `useEdition()` - Returns the Carbon edition (Cloud/Enterprise/Community)
### Routes
+
- `/api/webhook/stripe` - Stripe webhook endpoint
- Checkout flow redirects to Stripe hosted checkout
- Billing portal accessible from company settings
@@ -118,6 +137,7 @@ The system tracks:
## Bypass Mechanism
For development and special cases:
+
- Companies listed in `STRIPE_BYPASS_COMPANY_IDS` environment variable
- Receive mock "Partner" plan with unlimited usage
- No actual Stripe integration required
@@ -125,6 +145,7 @@ For development and special cases:
## Integration with Authentication
The billing system integrates with the authentication flow:
+
1. User signs up and selects a plan
2. Redirected to Stripe checkout
3. Upon successful payment, webhook triggers:
@@ -132,4 +153,4 @@ The billing system integrates with the authentication flow:
- Onboarding email sequence
- User activation
-This billing system provides a complete solution for SaaS monetization while maintaining flexibility for enterprise and community editions.
\ No newline at end of file
+This billing system provides a complete solution for SaaS monetization while maintaining flexibility for enterprise and community editions.
diff --git a/llm/cache/environment-configuration.md b/llm/cache/environment-configuration.md
index 4258750473..a415412f23 100644
--- a/llm/cache/environment-configuration.md
+++ b/llm/cache/environment-configuration.md
@@ -105,7 +105,7 @@ Some services access `process.env` directly:
- Development: Uses `http://localhost:3000` and local Supabase instance
- Preview: Uses Vercel preview URLs
-- Production: Uses `https://app.carbonos.dev` and production services
+- Production: Uses `https://app.carbon.ms` and production services
## Adding New Environment Variables
diff --git a/package.json b/package.json
index 9530b163ef..bbfdcf78f3 100755
--- a/package.json
+++ b/package.json
@@ -58,7 +58,7 @@
"generate:swagger": "tsx scripts/generate-swagger-docs.ts && npx prettier --write ./packages/database/src/swagger-docs-schema.ts ",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"lint": "turbo run lint",
- "novu:sync": "npx novu@latest sync --bridge-url https://app.carbonos.dev/api/novu --secret-key $NOVU_SECRET_KEY --api-url https://api.novu.co",
+ "novu:sync": "npx novu@latest sync --bridge-url https://app.carbon.ms/api/novu --secret-key $NOVU_SECRET_KEY --api-url https://api.novu.co",
"predb:build": "tsx scripts/setup-env-files.ts",
"postdb:build": "run-s generate:types generate:swagger",
"prepare": "npx husky install",
diff --git a/packages/auth/src/config/env.ts b/packages/auth/src/config/env.ts
index 27cb90211a..a9263ccb8f 100644
--- a/packages/auth/src/config/env.ts
+++ b/packages/auth/src/config/env.ts
@@ -163,7 +163,7 @@ export const CLOUDFLARE_TURNSTILE_SECRET_KEY = getEnv(
export function getAppUrl() {
if (VERCEL_ENV === "production" || NODE_ENV === "production") {
- return "https://app.carbonos.dev";
+ return "https://app.carbon.ms";
}
if (VERCEL_ENV === "preview") {
diff --git a/packages/auth/src/services/session.server.ts b/packages/auth/src/services/session.server.ts
index a4b0f9d232..02fcdc0bf4 100644
--- a/packages/auth/src/services/session.server.ts
+++ b/packages/auth/src/services/session.server.ts
@@ -39,7 +39,7 @@ const sessionStorage = createCookieSessionStorage({
sameSite: "lax",
secrets: [SESSION_SECRET],
secure: VERCEL_ENV === "production",
- domain: VERCEL_ENV === "production" ? DOMAIN : undefined, // eg. carbonos.dev
+ domain: VERCEL_ENV === "production" ? DOMAIN : undefined, // eg. carbon.ms
},
});
diff --git a/packages/documents/src/email/GetStartedEmail.tsx b/packages/documents/src/email/GetStartedEmail.tsx
index 23e92a87c6..0ee2857b65 100644
--- a/packages/documents/src/email/GetStartedEmail.tsx
+++ b/packages/documents/src/email/GetStartedEmail.tsx
@@ -19,7 +19,7 @@ interface Props {
export const GetStartedEmail = ({
firstName = "Huckleberry",
- universityUrl = "https://learn.carbonos.dev",
+ universityUrl = "https://learn.carbon.ms",
}: Props) => {
const text = `Hi ${firstName}, Just checking in to help you get started. Here are a few things you can try today.`;
const themeClasses = getEmailThemeClasses();
diff --git a/packages/documents/src/email/InviteEmail.tsx b/packages/documents/src/email/InviteEmail.tsx
index 4ceb485f43..ed300ced22 100644
--- a/packages/documents/src/email/InviteEmail.tsx
+++ b/packages/documents/src/email/InviteEmail.tsx
@@ -30,7 +30,7 @@ export const InviteEmail = ({
invitedByName = "Tom Sawyer",
email = "[email protected]",
companyName = "Tombstone",
- inviteLink = "https://carbonos.dev/invite/1234567890",
+ inviteLink = "https://carbon.ms/invite/1234567890",
ip = "38.38.38.38",
location = "Tombstone, AZ",
}: Props) => {
diff --git a/packages/documents/src/email/QuoteEmail.tsx b/packages/documents/src/email/QuoteEmail.tsx
index 832274614c..efc6656b1f 100644
--- a/packages/documents/src/email/QuoteEmail.tsx
+++ b/packages/documents/src/email/QuoteEmail.tsx
@@ -31,7 +31,7 @@ const QuoteEmail = ({
}: QuoteEmailProps) => {
const digitalQuoteUrl =
companySettings.digitalQuoteEnabled && !!quote.externalLinkId
- ? `https://app.carbonos.dev/share/quote/${quote.externalLinkId}` // the VERCEL_URL variable was giving us a preview branch
+ ? `https://app.carbon.ms/share/quote/${quote.externalLinkId}` // the VERCEL_URL variable was giving us a preview branch
: undefined;
const preview = <Preview>{`${quote.quoteId} from ${company.name}`}</Preview>;
diff --git a/packages/documents/src/email/WelcomeEmail.tsx b/packages/documents/src/email/WelcomeEmail.tsx
index 7fc1bdd808..a42bc749b2 100644
--- a/packages/documents/src/email/WelcomeEmail.tsx
+++ b/packages/documents/src/email/WelcomeEmail.tsx
@@ -76,12 +76,12 @@ export const WelcomeEmail = ({ firstName = "Huckleberry" }: Props) => {
<br />
<br />
In the meantime, you can start by exploring{" "}
- <Link href="https://learn.carbonos.dev">Carbon University</Link> to
- get a feel for the platform.
+ <Link href="https://learn.carbon.ms">Carbon University</Link> to get
+ a feel for the platform.
</Text>
<Section className="text-center mt-[50px] mb-[50px]">
- <Button href="https://learn.carbonos.dev">Get started</Button>
+ <Button href="https://learn.carbon.ms">Get started</Button>
</Section>
</Container>
</Body>
diff --git a/packages/documents/src/email/components/Logo.tsx b/packages/documents/src/email/components/Logo.tsx
index eb84d13bc1..e9b8824a58 100644
--- a/packages/documents/src/email/components/Logo.tsx
+++ b/packages/documents/src/email/components/Logo.tsx
@@ -4,7 +4,7 @@ export function Logo() {
return (
<Section className="mt-[32px]">
<Img
- src="https://app.carbonos.dev/carbon-word-light.png"
+ src="https://app.carbon.ms/carbon-word-light.png"
width="auto"
height="45"
alt="Carbon"
diff --git a/packages/documents/src/pdf/JobTravelerPDF.tsx b/packages/documents/src/pdf/JobTravelerPDF.tsx
index 86d8227686..543e57ee6c 100644
--- a/packages/documents/src/pdf/JobTravelerPDF.tsx
+++ b/packages/documents/src/pdf/JobTravelerPDF.tsx
@@ -18,11 +18,11 @@ interface JobTravelerProps extends PDF {
}
function getStartPath(operationId: string) {
- return `https://mes.carbonos.dev/x/start/${operationId}`;
+ return `https://mes.carbon.ms/x/start/${operationId}`;
}
function getEndPath(operationId: string) {
- return `https://mes.carbonos.dev/x/end/${operationId}`;
+ return `https://mes.carbon.ms/x/end/${operationId}`;
}
// Initialize tailwind-styled-components
diff --git a/packages/jobs/trigger/onboard.ts b/packages/jobs/trigger/onboard.ts
index ffb51e872a..bc6ca6147e 100644
--- a/packages/jobs/trigger/onboard.ts
+++ b/packages/jobs/trigger/onboard.ts
@@ -64,7 +64,7 @@ export const onboardTask = task({
html: render(
GetStartedEmail({
firstName: user.data.firstName,
- universityUrl: "https://learn.carbonos.dev",
+ universityUrl: "https://learn.carbon.ms",
})
),
});
diff --git a/packages/stripe/stripe.register.ts b/packages/stripe/stripe.register.ts
index f58398c667..c940da2a64 100644
--- a/packages/stripe/stripe.register.ts
+++ b/packages/stripe/stripe.register.ts
@@ -44,7 +44,7 @@ const events: Stripe.WebhookEndpointCreateParams.EnabledEvent[] = [
];
// const webhookUrl = `https://${VERCEL_URL}/api/webhook/stripe`;
-const webhookUrl = `https://app.carbonos.dev/api/webhook/stripe`;
+const webhookUrl = `https://app.carbon.ms/api/webhook/stripe`;
if (webhookUrl.includes("localhost")) {
throw new Error("Cannot register webhook in local development mode");
}