Carbon is a high performance, open-source, single tenant (incomplete) ERP written in Typescript. It allows customers, suppliers, and employees to share a common platform that's easy to integrate with.
Technical highlights/roadmap:
- Full-stack type safety (Database → UI)
- Realtime database subscriptions
- Attribute-based access control (ABAC)
- Row-level security (RLS)
- Composable user groups
- Magic link authentication
- File-based routing
- Third-party integrations for data
- Easy-to-use plugin system
Product highlights/roadmap are:
- Search
- Customer and supplier access
- Double-entry accrual accounting
- Stochastic scheduling/planning
- Graph-based routing for manufacturing
- Pre-Alpha: Developing foundation
- Alpha: Heavy feature development and refinement
- Public Alpha: Ready for use. But go easy on us, there'll be bugs.
- Public Beta: Stable enough for most non-enterprise use-cases.
- Public: Production-ready
- Remix – framework
- Typescript – language
- Tailwind – styling
- Radix UI - behavior
- Supabase - database
- Supabase – auth
- Redis - cache
- Trigger - jobs
- Resend – email
- Vercel – hosting
The monorepo follows the Turborepo convention of grouping packages into one of two folders.
/apps
for applications/packages
for shared code
Package Name | Description | Local Command |
---|---|---|
carbon |
ERP Application | npm run dev |
Package Name | Description |
---|---|
eslint-config-carbon |
Shared, extendable eslint configuration for apps and packages |
@carbon/database |
Database schema, migrations and types |
@carbon/documents |
Transactional PDFs and email templates |
@carbon/jest |
Jest preset configuration shared across apps and packages |
@carbon/logger |
Shared logger used across apps |
@carbon/react |
Shared web-based UI components |
@carbon/redis |
Redis cache client |
@carbon/tsconfig |
Shared, extendable tsconfig configuration used across apps and packages |
@carbon/utils |
Shared utility functions used across apps and packages |
Make sure that you have Docker installed on your system since this monorepo uses the Docker for local development.
After installation you should be able to access the following apps/containers locally:
Application | URL |
---|---|
Carbon ERP | http://localhost:3000 |
Postgres | postgresql://postgres:postgres@localhost:54322/postgres |
Supabase Studio | http://localhost:54323/project/default |
Inbucket | http://localhost:54324/monitor |
Edge Functions | http://localhost:54321/functions/v1/ |
In addition you must configure the following external services:
Service | Purpose | URL |
---|---|---|
Upstash | Serverless Redis | https://console.upstash.com/login |
Trigger.dev | Job runner | https://cloud.trigger.dev/login |
Posthog | Product analytics platform | https://us.posthog.com/signup |
Each of these services has a free tier which should be plenty to support local development.
First download and initialize the repository dependencies.
$ nvm use # use node v20
$ npm install # install dependencies
$ npm run db:start # pull and run the containers
Create an .env
file and copy the contents of .env.example
file into it
$ cp ./.env.example ./.env
Add your environment variables:
- Use the output of
npm run db:start
to set the supabase entries:
- SUPABASE_SERVICE_ROLE=[service_role key]
- SUPABASE_ANON_PUBLIC=[anon key]
- Create a Redis database in upstash and copy the following from the
REST API
section:
- UPSTASH_REDIS_REST_URL=[UPSTASH_REDIS_REST_URL]
- UPSTASH_REDIS_REST_TOKEN=[UPSTASH_REDIS_REST_TOKEN]]
- Navigate to the project you created in https://cloud.trigger.dev/ and copy the following from the
Environments & API Keys
section:
- TRIGGER_PUBLIC_API_KEY=[Public 'dev' API Key, starting 'pk_dev_']
- TRIGGER_API_KEY=[Server 'dev' API Key, starting 'tr_dev_']
- In Posthog go to https://[region].posthog.com/project/[project-id]/settings/project-details to find your Project ID and Project API key:
- POSTHOG_API_HOST=[https://[region].posthog.com]
- POSTHOG_PROJECT_PUBLIC_KEY=[Project API Key starting 'phc_']
Then you can run the following:
$ npm run db:build # run db migrations and seed script
$ npm run build:app # build the app
Finally, start the apps and packages:
$ npm run dev # npm run dev in all apps & packages
You can now sign in with:
username: [email protected] password: carbon
Go ahead and create your own user account
To kill the database containers in a non-recoverable way, you can run:
$ npm run db:kill # stop and delete all database containers
To restart and reseed the database, you can run:
$ npm run db:build # runs db:kill, db:start, and setup
To run a particular application, use the -w workspace
flag.
For example, to run test command in the @carbon/react
package you can run:
$ npm run test -w @carbon/react