
- By Muhammad Huzaifa
- Mar 30, 2026
- Comment (3)
Building a Full-Scale ERP System with Next.js 14, TypeScript & NestJS
Lessons learned architecting ThreadX — a production ERP with 30+ modules, granular RBAC, real-time notifications, and 170+ merged PRs — built on Next.js 14, TypeScript, NestJS, and Radix UI.
Building an ERP from scratch is one of the most architecturally demanding challenges in software development. Unlike a standard CRUD app, an ERP must handle complex role hierarchies, cross-module data dependencies, real-time state synchronization, and business logic that evolves rapidly with stakeholder feedback. ThreadX, the ERP I architected at Twelvor Solution, covers 30+ modules: orders, production, finance, CRM, MRP, inventory, compliance, banking, accounts receivable, shipping, tannery, vendor, and HR management. The frontend is built on Next.js 14 with TypeScript, Radix UI components, Zustand for state management, React Query for data fetching, and Recharts for analytics dashboards.
The most critical architectural decision was RBAC (Role-Based Access Control). With multiple distinct roles — admin, patch-admin-c, patch-admin-inp, worker, vendor, and more — every route, component, and API endpoint needed to be permission-aware. We implemented middleware-based route protection on the Next.js side and decorator-based guards on the NestJS backend, keeping permission logic centralized and auditable. Real-time features were essential for operations teams: live order notifications, WhatsApp alerts on status changes, and QR code generation for production batch tracking keep shop floor workers and managers in sync without manual updates. Excel export functionality for finance reports was one of the most-requested features — implementing it with proper pagination and large dataset handling was a recurring challenge that taught me a lot about streaming data exports. After 170+ pull requests and continuous feature development, the biggest lesson is that ERP modularity needs to be enforced from day one. Modules that seem independent always end up sharing data, and a well-defined service layer with clear module boundaries saves weeks of refactoring down the line.
“Welcome to our blog, where we celebrate our achievement as an AWS SaaS Competency Partner and share insights on how we accomplished this significant milestone.
As businesses unlock growth opportunities in the digital age, harnessing the power of cloud computing has become essential. Amazon Web Services (AWS) offers the AWS SaaS Competency.”Silvester Scott
Building a Full-Scale ERP System with Next.js 14, TypeScript & NestJS
Lessons learned architecting ThreadX — a production ERP with 30+ modules, granular RBAC, real-time notifications, and 170+ merged PRs — built on Next.js 14, TypeScript, NestJS, and Radix UI.
Building an ERP from scratch is one of the most architecturally demanding challenges in software development. Unlike a standard CRUD app, an ERP must handle complex role hierarchies, cross-module data dependencies, real-time state synchronization, and business logic that evolves rapidly with stakeholder feedback. ThreadX, the ERP I architected at Twelvor Solution, covers 30+ modules: orders, production, finance, CRM, MRP, inventory, compliance, banking, accounts receivable, shipping, tannery, vendor, and HR management. The frontend is built on Next.js 14 with TypeScript, Radix UI components, Zustand for state management, React Query for data fetching, and Recharts for analytics dashboards.
The most critical architectural decision was RBAC (Role-Based Access Control). With multiple distinct roles — admin, patch-admin-c, patch-admin-inp, worker, vendor, and more — every route, component, and API endpoint needed to be permission-aware. We implemented middleware-based route protection on the Next.js side and decorator-based guards on the NestJS backend, keeping permission logic centralized and auditable. Real-time features were essential for operations teams: live order notifications, WhatsApp alerts on status changes, and QR code generation for production batch tracking keep shop floor workers and managers in sync without manual updates. Excel export functionality for finance reports was one of the most-requested features — implementing it with proper pagination and large dataset handling was a recurring challenge that taught me a lot about streaming data exports. After 170+ pull requests and continuous feature development, the biggest lesson is that ERP modularity needs to be enforced from day one. Modules that seem independent always end up sharing data, and a well-defined service layer with clear module boundaries saves weeks of refactoring down the line.
Explore the transformative impact of technology on logistics management. Discuss how technologies like IoT, AI, and blockchain are reshaping the industry and improving efficiency.
Key Points
- IoT and Real-Time Tracking
- Artificial Intelligence in Route Optimization and Predictive Analytics
- Blockchain for Enhanced Transparency and Security
- Warehouse Automation and Robotics
Conclusion
Emphasize the long-term benefits of integrating sustainable practices into logistics operations, both for the planet and a company's reputation.
These outlines can be expanded into comprehensive blog posts, each providing valuable insights and information on the respective topics.









