SC-ERP
We built SC-ERP as the top tier of our ecosystem: a full ERP for the mid-sized Mexican company that today survives between Excel, CONTPAQi and Aspel. Instead of a pretty demo, we laid the foundations of a real system: a 13-entity multi-tenant data model on PostgreSQL, double-entry accounting with fiscal precision, and a REST API with full CRUD across the 7 operational cores — every endpoint validated with Zod, paginated, searchable, and tenant-isolated through middleware, so no company sees another's data. We didn't re-invent the tax layer: the invoice is born CFDI 4.0-ready (stamp UUID, stamped XML, RFC and CFDI Usage as first-class fields), ready to stamp against our own Omnifiscal API. On top we built a 34-page frontend covering 11 business areas, a custom design system and an installable mobile-first PWA, all packaged in Docker with a branch-based CI/CD pipeline to staging and production. The proof is in the repo: 13 models, 19 API routes, 34 pages, 76 components, and a price target 10x below a SAP. The SMB's problem isn't in the systems, it's between them — and that's exactly the gap this ERP closes.
Category
ERP
Stack
Next.js, React, TypeScript
Status
In development
The problem
Mid-sized Mexican companies live split across Excel, CONTPAQi and Aspel: tax data on one side, operations on the other, and no one holding the full picture. Enterprise ERPs (SAP, Oracle) ask for $200,000+ a month plus a team to run them, so they are off the table. The problem isn't in any one system, it's between them: the manual reconciliation, the hand-copied data, the close that takes days.
What we built
- —Real multi-tenant data model: 13 Prisma models on PostgreSQL (Organization, Customer, Supplier, Product, Chart of Accounts, double-entry Journal, Invoice, Payment) with organizationId on every business entity and per-tenant isolation.
- —Business REST API with full CRUD for the 7 operational cores (customers, products, invoices, payments, suppliers, chart of accounts, journals), with list/create and read/update/delete-by-id on separate routes.
- —Every endpoint validates input, paginates and searches, and scopes by tenant via middleware: no one sees another company's data.
- —Custom end-to-end authentication (login/register/logout/session) with middleware protecting every non-public route and isolating each tenant.
- —Native double-entry accounting: journal entries with lines linked to account/customer/supplier/product, a 5-type hierarchical chart of accounts, and amounts in Decimal(15,2) with rates in Decimal(5,4) so no cents are lost.
- —Invoice with CFDI 4.0 baked in: fields for stamp UUID, stamped XML and CFDI metadata, RFC and CFDI Usage as first-class fields, ready to stamp via the Omnifiscal API without re-implementing the SAT.
- —A 34-page frontend covering 11 business areas (Personal, Sales/CRM, Billing, Purchasing, Products, HR, Finance, BI, Compliance, Development, Administration) over a shell with an 11-group sidebar and two dashboards (personal and company-wide).
- —A custom 'Editorial Minimalism' design system: zero radius, a two-size type scale, hierarchy by opacity, tabular-nums numerals, three themes (light/dark/OLED) — terminal density with newspaper clarity.
- —Installable mobile-first PWA with service worker and install prompt, built for companies that operate from a phone, not a corporate desktop.
- —CI/CD ready: a containerized image and a pipeline deploying to staging and production by branch, over PostgreSQL.
Results
13 data models and 6 enums in the Prisma schema (382 lines).
7 business cores with full CRUD: 19 API routes total (including auth and healthcheck).
34 UI pages across 11 functional areas, with 76 components (30 UI primitives).
Custom authentication with secure sessions.
Representative seed: 1 organization (Demo Corp S.A. de C.V.), 10 customers, 5 suppliers, 20 products, 14 ledger accounts, 10 invoices, 5 payments.
3 visual themes (light / dark / OLED) and a documented 1,348-line design guide.