P Palmyra ERP Docs

Architecture & Technology

Master architecture for Palmyra ERP — a SaaS ERP designed to be manageable by a single developer. Multi-tenant, configuration-driven, one codebase for all industries.

Vision

Palmyra ERP is a multi-tenant SaaS ERP supporting manufacturing, retail, EBO, apparel, agriculture, import/export. It is configuration-driven — business rules, workflows, and industry-specific behavior are stored in the database, not in code.

Technology stack

LayerTechnologyNotes
ServerC# .NET Core 8+Single solution, minimal projects
WebMVC Razor PagesServer-side layout, shell, initial render
APIMVC REST APIJSON request/response; all data via REST
ClientVue.js 3 + PrimeVueMounted on Razor; fetches via REST
DatabasePostgreSQLMulti-tenant; config in DB
Data accessNpgsql (direct SQL)No ORM — DbService / CrudService
CacheIn-memory (IMemoryCache)PostgreSQL NOTIFY invalidation
AuthJWT + Google Sign-InRole-based access

Multi-tenant architecture

Default: shared DB with tenant_id on every table. CrudService auto-filters WHERE tenant_id = @tenant_id. Tenant resolved from subdomain, X-Tenant-Id header, or JWT claim.

Hierarchy

Tenant → Company (legal entity) → Branch (location). All transactions scoped by tenant_id → company_id → branch_id. Inter-company transactions supported.

Database design

  • tenant_id on every table; CrudService auto-filters.
  • company_id, branch_id for multi-company.
  • Soft delete (is_deleted); audit columns on every table.
  • PostgreSQL JSONB for flexible config/matrix data.
  • No C# entity classes — data as Dictionary<string, object?>.

API design

REST: GET/POST/PUT/DELETE /api/{module}/{resource}. List: ?page=1&pageSize=25. Action: POST /api/{module}/{resource}/{id}/{action}. Status codes: 200, 304, 400, 401, 403, 404, 500.