Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Document the shadcn registry for users and contributors

Jerome0b7a5cfd8c1a
diff --git a/README.md b/README.md
index be971823..5897a015 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,7 @@ Atomic CRM is free and open-source. You can test it online at <https://marmelab.
- πŸ“œ **Track Activity History**: View all interactions in aggregated activity logs.
- πŸ”— **Integrate via API**: Connect seamlessly with other systems using our API.
- πŸ› οΈ **Customize Everything**: Add custom fields, change the theme, and replace any component to fit your needs.
+- πŸ“¦ **Stay Up To Date**: Pull the latest component updates into your fork via the Atomic CRM shadcn registry.
## Installation
@@ -89,20 +90,29 @@ npx playwright test --ui
You can add your own unit tests powered by Jest anywhere in the `src` directory. The test files should be named `*.test.tsx` or `*.test.ts`.
And you can also add your own e2e test. The e2e test files should be placed inside the `./e2e` folder
-## Getting Updates
+## Shadcn Registry
-Atomic CRM components are published as a Shadcn Registry file. This means you can update your installation by calling the following command:
+Atomic CRM components are published as a [shadcn registry](https://marmelab.com/atomic-crm/r/atomic-crm.json). This registry can't be used to bootstrap a new CRM app (use [Installation](#installation) for that), but it's a convenient way to keep the components you forked in sync with upstream.
+
+### For Users: Getting Updates
+
+Once you've forked and customized Atomic CRM, periodically run the following command to pull in the latest component updates:
```sh
-npx shadcn add https://marmelab.com/atomic-crm/r/atomic-crm.json -o
+npx shadcn add https://marmelab.com/atomic-crm/r/atomic-crm.json -o -y
```
-## Registry
+- `-o` overwrites the files that changed upstream
+- `-y` skips the confirmation prompt (prefer this over piping `yes |` into the command)
+
+Commit your work before running this command so you can review the diff and resolve any conflict with your own customizations. See the [Getting Updates](https://marmelab.com/atomic-crm/doc/developers/getting-updates/) chapter of the documentation for details.
+
+### For Contributors: How The Registry Is Built
-The Registry file is kept au to date when files are added or removed:
+The registry file is kept up to date automatically:
-- The `registry.json` file is automatically generated by the `scripts/generate-registry.mjs` script as a pre-commit hook.
-- The `http://marmelab.com/atomic-crm/r/atomic-crm.json` file is automatically published by the CI/CD pipeline
+- The `registry.json` file is automatically generated by the `scripts/generate-registry.mjs` script as a pre-commit hook (`make registry-gen`).
+- The `https://marmelab.com/atomic-crm/r/atomic-crm.json` file is automatically built and published by the CI/CD pipeline (`make registry-build`, `make registry-deploy`).
> [!WARNING]
> If the `registry.json` misses some changes you made, you MUST update the `scripts/generate-registry.mjs` to include those changes.
diff --git a/doc/src/content/docs/developers/getting-updates.mdx b/doc/src/content/docs/developers/getting-updates.mdx
new file mode 100644
index 00000000..be152e8b
--- /dev/null
+++ b/doc/src/content/docs/developers/getting-updates.mdx
@@ -0,0 +1,43 @@
+---
+title: Getting Updates
+description: How to keep a forked Atomic CRM installation up to date using the shadcn registry.
+---
+
+Atomic CRM is meant to be forked and customized: there is no npm package to install as a dependency and upgrade. Instead, Atomic CRM components, hooks, and lib files are published as a [shadcn registry](https://marmelab.com/atomic-crm/r/atomic-crm.json), which you can use to pull upstream changes into your fork.
+
+This registry is not meant to bootstrap a new project. If you're starting a new CRM, follow the [Installation](https://github.com/marmelab/atomic-crm#installation) instructions instead. The registry is only useful once you already have a running fork and want to catch up with upstream improvements (bug fixes, new features, dependency bumps in `src/components/admin` and `src/components/ui`).
+
+## Refreshing Your Fork
+
+Commit or stash any pending work first, this command overwrites files, and you'll want a clean diff to review the changes:
+
+```sh
+npx shadcn add https://marmelab.com/atomic-crm/r/atomic-crm.json -o -y
+```
+
+- `-o` (`--overwrite`) replaces local files with the upstream version.
+- `-y` (`--yes`) skips the interactive confirmation prompt. Prefer this flag over piping `yes |` into the command: it's the option the CLI provides for non-interactive use, and it fails loudly if the CLI ever changes its prompts instead of silently answering "yes" to whatever comes up.
+
+Once the command completes, review the diff:
+
+```sh
+git diff
+```
+
+Resolve any conflict with your own customizations, run the test suite (`make test`, `make test-e2e`), then commit.
+
+## What Gets Updated
+
+The registry mirrors the files tracked by `scripts/generate-registry.mjs`: everything under `src/components/atomic-crm`, `src/components/supabase`, most of `src/hooks`, and most of `src/lib`. It does not touch your Supabase schema, your `docs/project-context.json` configuration, or any file you added outside those directories.
+
+## Keeping Your Own Fork's Registry Up To Date
+
+If you maintain your own fork long-term (for example to distribute your customized CRM to several deployments), regenerate and republish the registry the same way Atomic CRM's CI does:
+
+```sh
+make registry-gen # regenerates registry.json from the current source tree
+make registry-build # builds the distributable registry file
+make registry-deploy # publishes it (wraps registry-build)
+```
+
+See the main [README](https://github.com/marmelab/atomic-crm#shadcn-registry) for how these targets fit into the CI/CD pipeline.