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.

docs: add fancy text to home page

Brad Barbind82a2111a6e9
diff --git a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceHeader/PurchaseInvoiceHeader.tsx b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceHeader/PurchaseInvoiceHeader.tsx
index 433884af83..4041b50e4b 100644
--- a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceHeader/PurchaseInvoiceHeader.tsx
+++ b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceHeader/PurchaseInvoiceHeader.tsx
@@ -19,10 +19,11 @@ import {
useDisclosure,
} from "@chakra-ui/react";
import { Form, useParams } from "@remix-run/react";
-import { useMemo } from "react";
+import { useMemo, useState } from "react";
import { FaHistory } from "react-icons/fa";
import { usePermissions, useRouteData } from "~/hooks";
-import type { PurchaseInvoice } from "~/modules/invoicing";
+import { useSupabase } from "~/lib/supabase";
+import type { PurchaseInvoice, PurchaseInvoiceLine } from "~/modules/invoicing";
import {
PurchaseInvoicingStatus,
usePurchaseInvoiceTotals,
@@ -34,6 +35,9 @@ const PurchaseInvoiceHeader = () => {
const { invoiceId } = useParams();
const postingModal = useDisclosure();
+ const { supabase } = useSupabase();
+ const [lines, setLines] = useState<PurchaseInvoiceLine[]>([]);
+
if (!invoiceId) throw new Error("invoiceId not found");
const routeData = useRouteData<{ purchaseInvoice: PurchaseInvoice }>(
@@ -54,6 +58,20 @@ const PurchaseInvoiceHeader = () => {
[]
);
+ const showPostModal = async () => {
+ if (!supabase) throw new Error("supabase not found");
+ const { data, error } = await supabase
+ .from("purchaseInvoiceLine")
+ .select("*")
+ .eq("invoiceId", invoiceId);
+
+ if (error) throw new Error(error.message);
+ if (!data) return;
+
+ setLines(data);
+ postingModal.onOpen();
+ };
+
return (
<>
<VStack w="full" alignItems="start" spacing={2}>
@@ -61,7 +79,7 @@ const PurchaseInvoiceHeader = () => {
<Menubar>
<MenubarItem
isDisabled={!permissions.can("update", "invoicing") || isPosted}
- onClick={postingModal.onOpen}
+ onClick={showPostModal}
>
Post
</MenubarItem>
@@ -122,6 +140,7 @@ const PurchaseInvoiceHeader = () => {
<ModalCloseButton />
<ModalBody>
Are you sure you want to post this invoice? This cannot be undone.
+ {JSON.stringify(lines)}
</ModalBody>
<ModalFooter>
diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.post.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.post.tsx
index 65ffcc2422..890e461590 100644
--- a/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.post.tsx
+++ b/apps/carbon/app/routes/x+/purchase-invoice+/$invoiceId.post.tsx
@@ -1,11 +1,31 @@
import type { ActionFunctionArgs } from "@remix-run/node";
-import { redirect } from "@remix-run/node";
-import { postingQueue, PostingQueueType } from "~/queues";
+import { json, redirect } from "@remix-run/node";
+import { getPurchaseInvoiceLines } from "~/modules/invoicing";
+import { PostingQueueType, postingQueue } from "~/queues";
import { requirePermissions } from "~/services/auth";
import { flash } from "~/services/session";
import { path } from "~/utils/path";
import { error } from "~/utils/result";
+export async function loader({ request, params }: ActionFunctionArgs) {
+ const { client } = await requirePermissions(request, {
+ update: "inventory",
+ });
+
+ const { invoiceId } = params;
+ if (!invoiceId) throw new Error("invoiceId not found");
+
+ const purchaseInvoiceLines = await getPurchaseInvoiceLines(client, invoiceId);
+ if (purchaseInvoiceLines.error) {
+ return redirect(
+ path.to.purchaseInvoiceDetails(invoiceId),
+ await flash(request, error(purchaseInvoiceLines.error))
+ );
+ }
+
+ return json({ purchaseInvoiceLines: purchaseInvoiceLines.data ?? [] });
+}
+
export async function action({ request, params }: ActionFunctionArgs) {
const { client } = await requirePermissions(request, {
update: "invoicing",
diff --git a/www/components/features.tsx b/www/components/features.tsx
index 684c73f9f6..f1784a0fa4 100644
--- a/www/components/features.tsx
+++ b/www/components/features.tsx
@@ -35,10 +35,10 @@ const features = [
function Features() {
return (
<>
- <div className="grid grid-cols-2 gap-6 my-12 sm:grid-cols-3 ">
+ <div className="grid grid-cols-1 gap-6 my-12 sm:grid-cols-2 md:grid-cols-3 ">
{features.map(({ icon: Icon, ...feature }, i) => (
<div
- className="flex items-center p-8 space-x-4 bg-black/[0.07] hover:bg-black/10 dark:bg-zinc-900 dark:hover:bg-zinc-800/50 sm:-inset-x-6 sm:rounded"
+ className="backdrop-blur-sm flex items-center p-8 space-x-4 bg-black/[0.03] hover:bg-black/[0.05] dark:bg-zinc-900 dark:hover:bg-zinc-800/50 sm:-inset-x-6 rounded-md shadow-lg"
key={feature.name.split(" ").join("-")}
>
<div>
diff --git a/www/components/pages/Home.tsx b/www/components/pages/Home.tsx
index cc38b1fd81..73948f7d98 100644
--- a/www/components/pages/Home.tsx
+++ b/www/components/pages/Home.tsx
@@ -1,8 +1,8 @@
"use client";
-import { clamp, motion } from "framer-motion";
+import { clamp, motion, useMotionValueEvent, useScroll } from "framer-motion";
import Head from "next/head";
-import React from "react";
+import React, { useState } from "react";
import { useWindowSize } from "../../hooks/useWindowSize";
import Features from "../features";
import Sticky from "../sticky";
@@ -18,89 +18,137 @@ const fadeIn = {
},
};
+function Gradient() {
+ const { scrollYProgress } = useScroll();
+
+ const [progress, setProgress] = useState(0);
+ useMotionValueEvent(scrollYProgress, "change", (latest) => {
+ setProgress(latest);
+ });
+
+ const style = {
+ opacity: clamp(0, 1, progress * 4),
+ };
+
+ return (
+ <div className="background" style={style}>
+ <div className="gradient" />
+ </div>
+ );
+}
+
function Hero() {
const { height } = useWindowSize();
if (!height) return null;
return (
- <Sticky
- cover
- height={height}
- render={({ progress }) => {
- const blur = {
- filter: `blur(${progress * 5}px)`,
- opacity: 1 - progress,
- };
+ <section>
+ <Sticky
+ cover
+ height={height}
+ render={({ progress }) => {
+ const blur = {
+ filter: `blur(${progress * 3}px)`,
+ opacity: 1 - progress * 1.4,
+ };
- const scale = {
- transform: `scale(${clamp(0.9, 1.1, 1.1 - progress * 0.3)})`,
- };
+ const scale = {
+ transform: `scale(${clamp(0.9, 1.1, 1.1 - progress * 0.3)})`,
+ };
- return (
- <div className="flex flex-col justify-between text-center">
- <div style={blur}>
- <motion.h1
- initial={{
- opacity: 0,
- scale: 1.2,
- }}
- animate={{
- opacity: 1,
- scale: 1,
- }}
- transition={{
- duration: 2.5,
- ease: "easeInOut",
- }}
- className="max-w-5xl mx-auto nx-text-6xl font-extrabold tracking-tighter leading-[1.1] text-6xl sm:text-7xl lg:nx-text-8xl xl:nx-text-8xl"
- >
- ERP for the builders
- </motion.h1>
- <motion.p
- {...fadeIn}
- transition={{
- duration: 0.5,
- delay: 2.6,
- ease: "easeInOut",
- }}
- className="mt-6 nx-text-xl font-medium leading-tight text-black/60 dark:text-white/60 sm:nx-text-2xl md:nx-text-3xl lg:nx-text-4xl"
+ return (
+ <div className="flex flex-col justify-between text-center">
+ <div style={blur}>
+ <motion.h1
+ initial={{
+ filter: "blur(3px)",
+ opacity: 0,
+ scale: 1.2,
+ }}
+ animate={{
+ filter: "blur(0px)",
+ opacity: 1,
+ scale: 1,
+ }}
+ transition={{
+ duration: 2.5,
+ ease: "easeInOut",
+ }}
+ className="max-w-5xl mx-auto nx-text-6xl font-extrabold tracking-tighter leading-[1.1] text-6xl sm:text-7xl lg:nx-text-8xl xl:nx-text-8xl"
+ >
+ ERP for{" "}
+ <span className="bg-gradient-to-r from-amber-500 via-orange-600 to-yellow-500 dark:from-purple-100 dark:via-purple-200 dark:to-orange-200 bg-clip-text text-transparent">
+ the builders
+ </span>
+ </motion.h1>
+ <motion.p
+ {...fadeIn}
+ transition={{
+ duration: 0.5,
+ delay: 2.6,
+ ease: "easeInOut",
+ }}
+ className="mt-6 nx-text-xl font-medium leading-tight text-black/60 dark:text-white/60 sm:nx-text-2xl md:nx-text-3xl lg:nx-text-4xl"
+ >
+ Carbon is an open-source starting point for business
+ </motion.p>
+ </div>
+ <div
+ className="flex fix-flex-col h-32 mt-4 md:mt-0 mb-6 md:mb-0 items-center justify-center gap-3 md:flex-row xl:flex-row"
+ style={scale}
>
- Carbon ERP is an open-source ERP starting point
- </motion.p>
+ <motion.a
+ {...fadeIn}
+ transition={{
+ duration: 0.5,
+ delay: 3.0,
+ ease: "easeInOut",
+ }}
+ className="flex items-center justify-center w-full px-8 py-3 text-base font-medium text-black no-underline bg-zinc-200 border border-transparent rounded-md dark:bg-zinc-800 dark:text-white betterhover:dark:hover:bg-gray-800 betterhover:hover:bg-zinc-300 md:py-3 md:text-lg md:px-10 md:leading-6 fix-width-auto xl:w-auto"
+ href="/learn/introduction"
+ >
+ Learn
+ </motion.a>
+ <motion.a
+ {...fadeIn}
+ transition={{
+ duration: 0.5,
+ delay: 3.2,
+ ease: "easeInOut",
+ }}
+ className="flex items-center justify-center w-full px-8 py-3 text-base font-medium text-white no-underline bg-zinc-800 border border-transparent rounded-md dark:bg-zinc-100 dark:text-black betterhover:dark:hover:bg-gray-300 betterhover:hover:bg-gray-700 md:py-3 md:text-lg md:px-10 md:leading-6 fix-width-auto xl:w-auto"
+ href="/develop/getting-started"
+ >
+ Develop
+ </motion.a>
+ </div>
</div>
- <div
- className="flex fix-flex-col h-32 mt-4 md:mt-0 mb-6 md:mb-0 items-center justify-center gap-3 md:flex-row xl:flex-row"
- style={scale}
- >
- <motion.a
- {...fadeIn}
- transition={{
- duration: 0.5,
- delay: 3.0,
- ease: "easeInOut",
- }}
- className="flex items-center justify-center w-full px-8 py-3 text-base font-medium text-black no-underline bg-zinc-200 border border-transparent rounded-md dark:bg-zinc-800 dark:text-white betterhover:dark:hover:bg-gray-800 betterhover:hover:bg-zinc-300 md:py-3 md:text-lg md:px-10 md:leading-6 fix-width-auto xl:w-auto"
- href="/learn/introduction"
- >
- Learn
- </motion.a>
- <motion.a
- {...fadeIn}
- transition={{
- duration: 0.5,
- delay: 3.2,
- ease: "easeInOut",
- }}
- className="flex items-center justify-center w-full px-8 py-3 text-base font-medium text-white no-underline bg-zinc-800 border border-transparent rounded-md dark:bg-zinc-100 dark:text-black betterhover:dark:hover:bg-gray-300 betterhover:hover:bg-gray-700 md:py-3 md:text-lg md:px-10 md:leading-6 fix-width-auto xl:w-auto"
- href="/develop/getting-started"
- >
- Develop
- </motion.a>
- </div>
- </div>
- );
- }}
- />
+ );
+ }}
+ />
+ </section>
+ );
+}
+
+function Overview() {
+ return (
+ <motion.section id="overview" className="relative" {...fadeIn}>
+ <div className="px-4 py-16 mx-auto sm:pt-20 sm:pb-24 lg:max-w-7xl lg:pt-24">
+ <h2 className="nx-text-4xl font-extrabold tracking-tight lg:nx-text-5xl xl:nx-text-6xl lg:text-center dark:text-white">
+ The{" "}
+ <span className="bg-gradient-to-r from-purple-600 to-pink-600 dark:from-purple-100 dark:via-purple-200 dark:to-orange-200 bg-clip-text text-transparent">
+ open core
+ </span>{" "}
+ for your digital operations
+ </h2>
+ <p className="mx-auto mt-4 text-lg font-medium text-black/60 dark:text-white/60 lg:max-w-3xl lg:text-xl lg:text-center">
+ Every business is unique. Carbon gives you the basic building blocks
+ to build your own proprietary business systems with the best in
+ modern, open-source software.
+ </p>
+ <Features />
+ </div>
+ </motion.section>
);
}
@@ -115,45 +163,11 @@ export default function Home() {
/>
</Head>
- <div>
- {/* <Gradient /> */}
+ <section>
+ <Gradient />
<Hero />
-
- <motion.div
- initial={{
- opacity: 0,
- }}
- animate={{
- opacity: 1,
- }}
- transition={{
- duration: 0.5,
- ease: "easeInOut",
- delay: 2.5,
- }}
- className="relative"
- >
- <div className="px-4 py-16 mx-auto sm:pt-20 sm:pb-24 lg:max-w-7xl lg:pt-24">
- <h2 className="nx-text-4xl font-extrabold tracking-tight lg:nx-text-5xl xl:nx-text-6xl lg:text-center dark:text-white">
- Fully customizable and extensible
- </h2>
- <p className="mx-auto mt-4 text-lg font-medium text-black/60 dark:text-white/60 lg:max-w-3xl lg:text-xl lg:text-center">
- We've taken the best of modern, open-source technology and
- combined it into a lightning-fast, easy-to-use, open-source ERP
- system.
- </p>
- <Features />
- </div>
- </motion.div>
- </div>
+ <Overview />
+ </section>
</>
);
}
-
-// function Gradient() {
-// return (
-// <div className="background">
-// <div className="gradient" />
-// </div>
-// );
-// }
diff --git a/www/pages/develop/index.mdx b/www/pages/develop/index.mdx
index c14530f4cc..a11cd9e6c4 100644
--- a/www/pages/develop/index.mdx
+++ b/www/pages/develop/index.mdx
@@ -13,11 +13,11 @@ Carbon ERP is a high permformance, [open-source](https://github.com/barbinbrad/c
### High Performance
-We've tried to take the best of modern, open-source technology and combine it into a lightning-fast, easy-to-use ERP system. Our pages load quickly, tasks can be completed in seconds, and features can be added in hours instead of years. Our [serverless architecture](/docs/core-concepts/serverless) scales to support business of any size.
+We've tried to take the best of modern, open-source technology and combine it into a lightning-fast, easy-to-use ERP system. Our pages load quickly, tasks can be completed in seconds, and features can be added in hours instead of years. Our [serverless architecture](/develop/core-concepts/serverless) scales to support business of any size.
### Open Source
-For us, open source means [honesty](/developprinciples#openness). We've seen too many companies get locked into expensive, proprietary software that doesn't meet their needs, after being promised that it would.
+For us, open source means [honesty](/develop/principles#openness). We've seen too many companies get locked into expensive, proprietary software that doesn't meet their needs, after being promised that it would.
We think being in business is hard enough, and we'd love it if we could help make it easier. That's why we've licensed Carbon ERP under the permissive [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license. This means that you can use Carbon ERP for free, and you can modify it to meet your needs.
@@ -27,7 +27,7 @@ Unlike most cloud-based ERP systems, Carbon ERP is designed to be a single-tenan
### Realtime
-We have first-class [support for realtime](/docs/core-concepts/realtime) data updates on any data in the system. While realtime is not the default, it can be added anywhere.
+We have first-class [support for realtime](/develop/core-concepts/realtime) data updates on any data in the system. While realtime is not the default, it can be added anywhere.
### Manufacturing
diff --git a/www/public/grid.svg b/www/public/grid.svg
new file mode 100644
index 0000000000..76e3b29f0d
--- /dev/null
+++ b/www/public/grid.svg
@@ -0,0 +1,5 @@
+
+<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/www/styles.css b/www/styles.css
index c2dec90eba..dae4e83c01 100644
--- a/www/styles.css
+++ b/www/styles.css
@@ -100,8 +100,16 @@ code[data-language="sh"] {
);
}
-.nextra-nav-container.nx-sticky {
- position: relative;
+.nextra-nav-container {
+ position: fixed;
+}
+
+article {
+ padding-top: 70px;
+}
+
+aside {
+ padding-top: 15px;
}
/* Credit: https://cmdk.paco.me/ */
@@ -139,7 +147,7 @@ code[data-language="sh"] {
.background:after {
content: "";
- background-image: url("/static/grid.svg");
+ background-image: url("/grid.svg");
z-index: 1;
position: absolute;
width: 100%;