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.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
-- Company buckets: company backups (`exports/`) and audit-log archives
-- (`<companyId>/audit-logs/`) are read and written with the service role only.
DROP POLICY IF EXISTS "Company bucket access" ON storage.objects;
CREATE POLICY "Company bucket access" ON storage.objects
FOR ALL USING (
bucket_id = ANY (
(
SELECT
get_companies_with_employee_role()
)::text[]
)
AND NOT starts_with(name, 'exports/')
AND NOT starts_with(name, bucket_id || '/audit-logs/')
);
-- The feedback bucket has no readers or writers in the app.
UPDATE storage.buckets SET public = false WHERE id = 'feedback';
DROP POLICY IF EXISTS "Anyone can read the feedback buckets" ON storage.objects;
DROP POLICY IF EXISTS "Anyone with settings_create can insert into the feedback bucket" ON storage.objects;