Back to home

Case study

PyCore SGC
The engineering behind the ERP.

pycore.app explains what the product does. This page explains how it's built: the decisions, the problems you can't see from the interface, and what I learned keeping it running in production.

At a glance

Product
Modular ERP for Mexican SMBs
Owned by
Global-IAnalytics S. A. de C. V.
My role
End-to-end development and DevOps
Architecture
Multi-tenant · Clean Architecture · DDD
Modules
11 integrated modules
Recognition
2nd place · IV Mercado Emprendedor 2026

01 / The context

A small business in Mexico doesn't run on one system: it runs on several that don't talk to each other. Inventory lives in a spreadsheet, sales in a notebook or a cash register, invoicing on a third party's portal, and payroll somewhere else entirely. Every handoff between those tools is a point where the data drifts apart.

PyCore SGC starts from a different premise: one system as the source of truth, with modules that share the same data instead of copying it. That decision defines everything else, because it forces you to get isolation between companies, consistency across branches, and behavior when the connection drops all correct.

I developed it end to end, from the first table to production: data model, API, interfaces, the assistant, and the servers it runs on.

02 / Architecture and decisions

The system is organized with Clean Architecture and DDD: business logic sits at the center, isolated from the framework, the database and the presentation layer. In an ERP this isn't academic purism, it's survival — tax and inventory rules change for different reasons and at a different pace than the interface does.

There are eleven integrated modules: core and branches, access control, catalogs, customers and suppliers, inventory, purchasing, sales and point of sale, CFDI invoicing, finance, HR and audit. Integrated means they share the model: a sale at the point of sale moves inventory, generates the tax document and shows up in finance with no sync step in between.

Decisions that shaped it

Business logic independent of the framework

The rules live in the core, not in the views or the ORM. It costs more up front and pays for itself the first time a tax rule has to change without breaking inventory.

Integrated modules, not coupled ones

They share the data model but each has its own boundary. A sale crosses several modules without any of them knowing the others' internals.

The ERP as the single source of truth

The online store and the operations panel read from the same system. There are no copies to reconcile because there are no copies.

Permissions per module and per action

Roles configurable down to view, create, edit and delete, with manager and subordinate hierarchies. In a real business, the cashier and the accountant can't see the same things.

03 / The offline point of sale

This is the most interesting problem in the system. A point of sale can't stop taking payments because the internet went down: in a shop with a queue, a system that freezes is worse than no system at all. But operating offline opens the opposite problem.

If the point of sale stores sales locally and pushes them on reconnect, you have to guarantee that a sale isn't charged twice, that inventory doesn't go negative, and that two branches which sold the same item from the same batch converge on a coherent state. The system stores operations locally and syncs them once the connection returns, detecting and resolving the conflicts that surface at that moment.

The detail that matters: the hard part isn't storing offline, it's deciding what wins when two divergent realities meet. That call can't be made with a generic rule; it depends on what the data means. A sale already charged to a customer can't be discarded; an inventory count can be recomputed.

04 / Isolation between companies

PyCore is multi-tenant: several companies on the same platform, with their data fully isolated. Solving that in the foundations rather than as a filter bolted on afterwards is the difference between real isolation and isolation that breaks the first time someone forgets a condition in a query.

Isolation isn't only about reads. Tax document numbering, branch-configurable series, catalogs and permissions are all per company. A mistake here isn't an interface bug — it's a data leak between businesses that compete with each other.

On top of per-company isolation sits per-branch isolation: stock, alerts and numbering series of its own per location, with transfers between them that have to balance on both ends.

05 / Mexican tax reality

Invoicing in Mexico means CFDI 4.0: stamping, cancelling and delivering legally valid tax documents with the correct tax ID, legal name and tax regime. It isn't one more database field; it's a contract with an authority that validates the document's structure and rejects it if anything is off.

On top of that comes handling VAT, excise tax and income tax withholdings, three price levels per product, and cases that only show up in live operation: cigarettes sold by the piece or by the pack, bulk goods measured in grams, recipes that consume inventory ingredients, and real-world catalogs with duplicate codes that have to be mergeable.

Those cases are what separate an ERP that works in the demo from one that works in the shop. None of them is hard on its own; together they define the data model.

06 / Operations and deployment

The system runs in Docker containers in the cloud with automated deployment. Keeping it up is part of the job, not a later phase: the same judgment I applied to the architecture applies to how it updates without interrupting someone mid-sale.

On the security side: two-factor authentication, automatic lockout after failed attempts with an alert to the administrator, tokens that expire, and an audit log recording who did what, when, and with what change detail, with alerts on critical changes and log export.

The audit log deserves its own note. In a system where several people move inventory and money, the record isn't a compliance checkbox: it's the tool you settle an argument about what actually happened with.

Technologies

  • Python
  • Django
  • React
  • TypeScript
  • PostgreSQL
  • Redis
  • Celery
  • Docker
  • Nginx
  • Stripe

2nd place · IV Mercado Emprendedor 2026, UAEMéx

My contribution

  • End-to-end development, from the first table to production
  • Data model and API design
  • Building the enterprise modules
  • Operations panel and point-of-sale interfaces
  • Payment service integration
  • Infrastructure, servers and automated deployment

07 / What it taught me

This is the project where I understood that architectural decisions are paid for, or paid off, months later — never on the day you make them. Separating business logic from the framework felt like extra work until the first time a rule had to change without touching anything else.

It also taught me that the hard part of an enterprise system isn't the modules, it's what happens between them: a sale crossing inventory, invoicing and finance, or two branches reconnecting with different versions of the same truth.

And it gave me the judgment I now apply to infrastructure: operating what you build changes how you build it. Keeping up a system a shop's register depends on teaches more about reliability than any course.

Want to see the product?

The product landing page covers the modules, the plans and the use cases for a business.