How cyber-core-technology/pycore works
PyCore ERP is a multi-tenant ERP for Mexican SMBs, with a React/PWA client and Django REST backend. The main user flow is an employee using the protected client to authenticate, work in an operational module, and receive a result through the API; the README describes the backend’s ViewSet → Service → Repository → Model layering. Operational domains include inventory, purchasing, sales, finance, HR, and storefront, alongside administration and customer records. Domain events are queued for Celery processing and can update WebSocket clients. Relationships not directly demonstrated by excerpts are included only where the README or source index documents them; unsampled modules are not treated as inspected.
Main entry points: urls.py Django API · event_bus.py Domain event bus · cliente_auth_service.py Store customer auth · App.tsx React ERP
Components 26
Client experience
- React ERP
frontend/src/App.tsx - Protected routes
frontend/src/router/routes.ts - API clients
frontend/src/api
Identity and tenancy
- Django API
backend/pycore/urls.py - User authentication
backend/apps/auth_module/services/auth_service.py - Two-factor auth
backend/shared/two_fa_service.py - Tenant context
backend/apps/core/middleware/tenant_middleware.py - Company setup
backend/apps/core/services - Store customer auth
backend/apps/storefront/services/cliente_auth_service.py
Business operations
- Business catalogs
backend/apps/catalogs/services - Customers and suppliers
backend/apps/terceros/services - Inventory and scanning
backend/apps/inventory/services/movimiento_service.py - Purchasing
backend/apps/purchases/services/compra_service.py - POS and sales
backend/apps/sales/services/venta_service.py - Finance and payments
backend/apps/finance/services/cxc_service.py - HR and attendance
backend/apps/hr/services - Online storefront
backend/apps/storefront/services/storefront_service.py
Events and realtime
- Audit logging
backend/apps/audit/events/handlers.py - Domain event bus
backend/shared/events/event_bus.py - Async event tasks
backend/shared/events/tasks.py - WebSocket consumers
backend/apps/ws/consumers.py - Offline POS sync
backend/apps/sync/services/push_service.py - Push notifications
backend/apps/notifications/services/push_service.py
Persistence and integrations
- Storefront records
backend/apps/storefront/models/cliente_storefront.py - PostgreSQL
Other components
- ERP user
Connections 28
- ERP user → React ERP: uses
- React ERP → Protected routes: navigates
frontend/src/App.tsx - Protected routes → API clients: requests data
- API clients → Django API: HTTPS API
- Django API → User authentication: routes requests
- User authentication → Two-factor auth: verifies second factor
backend/apps/auth_module/services/auth_service.py - Django API → Tenant context: resolves tenant
- Tenant context → Company setup: scopes company context
- Django API → Business catalogs: routes operations
- Django API → Customers and suppliers: routes operations
- Django API → Inventory and scanning: routes operations
- Django API → Purchasing: routes operations
- Django API → POS and sales: routes operations
- Django API → Finance and payments: routes operations
- Django API → HR and attendance: routes operations
- Django API → Online storefront: serves store
- Store customer auth → Two-factor auth: checks second factor
backend/apps/storefront/services/cliente_auth_service.py - Store customer auth → Storefront records: authenticates customers
backend/apps/storefront/services/cliente_auth_service.py - Online storefront → Storefront records: uses records
backend/apps/storefront/services/storefront_service.py - Inventory and scanning → PostgreSQL: persists stock
- Django API → Domain event bus: publishes events
- Domain event bus → Async event tasks: queues processing
backend/shared/events/event_bus.py - Async event tasks → Domain event bus: processes events
backend/shared/events/tasks.py - Domain event bus → WebSocket consumers: bridges updates
backend/shared/events/event_bus.py - Domain event bus → Audit logging: dispatches events
backend/apps/audit/events/handlers.py - Domain event bus → PostgreSQL: handlers persist records
- Django API → Offline POS sync: supports offline sync
- Django API → Push notifications: serves notifications