A full-featured CRM built with React, Vite+, shadcn-admin-kit/Base UI, and a Cloudflare-native backend.
atomic-crm.mp4
Atomic CRM is free and open-source. You can test it online at https://marmelab.com/atomic-crm-demo.
- ๐ Organize Contacts: Keep all your contacts in one easily accessible place.
- โฐ Create Tasks & Set Reminders: Never miss a follow-up or deadline.
- ๐ Take Notes: Capture important details and insights effortlessly.
- โ๏ธ Capture Emails: CC Atomic CRM to automatically save communications as notes.
- ๐ Manage Deals: Visualize and track your sales pipeline in a Kanban board.
- ๐ Import & Export Data: Easily transfer contacts in and out of the system.
- ๐ Control Access: Log in with Google, Azure, Keycloak, and Auth0.
- ๐ 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.
To run this project locally, you will need the following tools installed on your computer:
- Make
- Node 22 LTS
- Docker (optional; only needed for unrelated local tooling)
Fork the marmelab/atomic-crm repository to your user/organization, then clone it locally:
git clone https://github.com/[username]/atomic-crm.gitInstall dependencies with Vite+:
cd atomic-crm
make installThis will install the dependencies for the frontend and the backend, for the Cloudflare Worker and local D1.
Start the Cloudflare-backed app locally:
make startThis starts the Vite frontend and Cloudflare Worker against local D1.
You can then access the app via http://localhost:5173/. You will be prompted to create the first user.
For the demo provider, use vp run dev:demo. To run the Cloudflare-native frontend, Worker, and MCP server together, use vp run dev:all or vp run dev:cloudflare. Cloudflare D1 and Better Auth are the only application backend; FakeRest is available for demos.
If you need debug the backend, you can access the following services:
- Cloudflare Worker: http://localhost:8787/
- REST API: http://127.0.0.1:54321
- Local R2 attachments are managed by Wrangler's local Worker runtime.
- Local inbound email uses the Worker
email()handler; staging routes[email protected]through Cloudflare Email Routing.
The in-app CopilotKit assistant uses the Cloudflare Worker runtime in staging and production, with the Node runtime retained only for local rollback and MCP development:
atomic-crm-appโ the static frontend (this repo)atomic-crm-copilotโ the local/rollback CopilotKit runtime (Hono server inserver/)atomic-crm-mcpโ the MCP contract analyzer (also inserver/mcp/)
The chat UI uses shadcn Base UI primitives for message rows, bubbles, streaming markers, anchored transcript scrolling, attachments, and guided Copilot briefs.
Copilot tools talk to the same authenticated CRM APIs as the rest of the app
(D1 on Cloudflare, FakeRest in demo). VITE_COPILOTKIT_API_URL is optional and
is not needed in Cloudflare mode.
VITE_COPILOTKIT_RUNTIME_URLโ optional alternate CopilotKit endpoint. Leave unset to use the same-origin Worker route,/api/copilotkit.
The default local stack is the Vite frontend plus the Cloudflare Worker:
pnpm run d1:migrate:local
vp run dev:cloudflareConfigure BETTER_AUTH_SECRET in .dev.vars before signing in. CopilotKit
runs natively on the Worker; MCP is optional:
vp run dev:allThe in-browser FakeRest demo (no Worker) is:
vp run dev:demoThe Vite dev server proxies /api to the Worker at
http://localhost:8787 (override with COPILOTKIT_PROXY_TARGET). Use
COPILOTKIT_RUNTIME_MODE=proxy and make start-server only for the Node
rollback runtime.
The staged Cloudflare runtime can be started with:
vp run dev:cloudflareThis runs the Vite frontend and Wrangler Worker together. Cloudflare D1 and
Better Auth are selected automatically. Configure BETTER_AUTH_SECRET in
.dev.vars before using authentication. Apply local
D1 migrations with pnpm run d1:migrate:local.
The staging Worker serves CopilotKit natively through the TanStack AI
CopilotKit factory and its AI binding. Set CLOUDFLARE_AI_MODEL if you need a
different Workers AI model; no account ID or AI API token is required. Use
COPILOTKIT_RUNTIME_MODE=proxy only for the local Node rollback path.
Build the staging frontend with vp run build:staging; this selects the
Cloudflare data/auth providers and same-origin Worker API before deployment.
Set STAGING_TEST_EMAIL and STAGING_TEST_PASSWORD locally, then run:
pnpm run smoke:staging
pnpm run sso:register:stagingThe authenticated smoke test creates and removes a contact, note, task, and
attachment. For inbound email, send from a CRM sales-user address to a CRM
contact while CC'ing [email protected]; the Worker associates the
sender with the sales user and a To/Cc/Bcc recipient with the contact.
TanStack Router is the canonical application and test router. Set
VITE_ROUTER=tanstack for an explicit local smoke test; vp run build:staging
enables it automatically. URLs, query strings, resource routes, and ra-core
data fetching remain unchanged.
react-router and react-router-dom remain direct compatibility dependencies
because the current ra-core release statically imports its React Router
adapter even when a custom router provider is configured. The CRM has no
application or test imports of React Router. Those compatibility packages can
be removed after upgrading to an ra-core release that no longer requires that
adapter.
The user and developer documentation for this project is available in the doc/ directory. You can also read it online at https://marmelab.com/atomic-crm/doc/.
This project contains Vitest unit and browser tests. Run them with the following command:
vp testUse vp check for formatting, linting, and typechecking, make typecheck to skip formatting/linting, and vp build for a production build. You can add tests anywhere in src; use *.test.tsx or *.test.ts.
The root project uses Vite+ 0.2.8 for installation, checking, testing, development, and production builds. Production sourcemaps remain enabled. Current builds report large application chunks because the CRM resource definitions are eagerly registered by the admin shell; the measured main application chunk is approximately 2.7 MB minified (812 kB gzip). This warning is retained so future route-level splitting is driven by a measured payload improvement rather than hidden with a higher warning limit.
Tailwind CSS and Vite CSS post-processing may report SOURCEMAP_BROKEN warnings because those upstream transforms do not emit sourcemaps. These warnings are documented here and are not suppressed by disabling production sourcemaps.
Atomic CRM components are published as a Shadcn Registry file:
- The
registry.jsonfile is automatically generated by thescripts/generate-registry.mjsscript as a pre-commit hook. - The
http://marmelab.com/atomic-crm/r/atomic-crm.jsonfile is automatically published by the CI/CD pipeline
Warning
If the registry.json misses some changes you made, you MUST update the scripts/generate-registry.mjs to include those changes.
This project is licensed under the MIT License, courtesy of Marmelab. See the LICENSE.md file for details.