enterprise-erp
A modern, multi-tenant Enterprise Resource Planning (ERP) system built with Next.js 15, Prisma, and PostgreSQL.
A multi-tenant business management system (ERP) covering accounting with Turkish e-invoice integration, inventory tracking, role-based access, and AES-256 field encryption, built with Next.js, PostgreSQL, and Redis.
Enterprise ERP is a business management system built for companies that want to run multiple separate organizations from a single platform. Each organization, called a tenant, gets its own isolated slice of the database so that one company's data can never be seen by another. This pattern is common in B2B software-as-a-service products where one vendor hosts many clients.
The system covers several core business functions. It includes an accounting engine that handles VAT and withholding taxes, and reconciles ledger entries automatically. It also connects directly to Turkey's Revenue Administration (GIB) via a government SOAP interface, which allows businesses to issue legally compliant electronic invoices in real time. Inventory tracking is included, with low-stock alerts sent through a background job queue rather than slowing down the main application.
Security is addressed at multiple layers. Personal data fields are encrypted individually using AES-256, meaning sensitive information is protected even at the database level. Access to features is controlled through role-based permissions, and authentication supports both single sign-on and traditional username/password login.
The technical stack is built around Next.js for both the front end and the API layer, with PostgreSQL as the main database and Redis handling caching and background task queues. Background jobs, such as generating large reports or processing batches of invoices, run through BullMQ so they do not block user requests.
The project is structured around domain-driven design, grouping accounting, inventory, and invoicing logic into separate modules. Tests are split between unit tests using Vitest and end-to-end browser tests using Playwright. It runs locally with Node.js 20 or higher, PostgreSQL 15 or higher, and Redis 7 or higher. The code is released under the MIT license.
Where it fits
- Build a SaaS platform where multiple businesses each manage their own accounting, invoices, and inventory in complete isolation from each other.
- Issue legally compliant Turkish electronic invoices in real time by connecting to the government's GIB SOAP interface.
- Run heavy tasks like large report generation or batch invoice processing as background jobs so users never wait for the page to respond.
- Enforce fine-grained role-based permissions so employees only see the features and data their role allows.