Skip to content
fullstack

ERP Platform — Distribution & Retail Business Management

Full-stack ERP for Indonesian distribution with sales, procurement, inventory, accounting, 17+ report types, and multi-branch role-based access control.

0 views
Next.js Node.js Express PostgreSQL Tailwind CSS Zustand JWT Authentication
ERP Platform — Distribution & Retail Business Management

The Problem

Indonesian distribution and retail businesses — from FMCG distributors to agricultural supply chains — still rely on spreadsheets, paper forms, and disconnected tools to manage operations. Sales reps write orders by hand, warehouse staff count stock manually, accountants reconcile with Excel, and branch managers have no real-time visibility into headquarters’ data.

The pain points multiply with scale:

  • Multi-branch chaos — Each branch tracks inventory and sales independently. Consolidating reports means waiting for someone to email a spreadsheet.
  • No procurement workflow — Purchase orders go through WhatsApp. Approvals are verbal. Returns to suppliers are poorly documented.
  • Blind inventory — Stock levels are estimates until someone physically counts. Stock discrepancies are discovered too late.
  • Accounting disconnect — Financial data lives separate from operational data. Generating a profit/loss statement takes days of manual work.

The Solution

This ERP platform digitizes the entire distribution business workflow in a single web application. From central warehouse procurement to branch-level point-of-sale, from supplier management to financial reporting — every operation flows through one system with real-time data synchronization across branches.

Built with Next.js on the frontend and Express/Node.js on the backend, backed by PostgreSQL for reliable transactional data. Role-based access control ensures each user sees only what they need — from the owner’s financial dashboard down to the warehouse clerk’s stock opname screen.

Architecture

ERP Platform
├── Frontend (Next.js 15 App Router)
│   ├── Role-based navigation & menu permissions
│   ├── Zustand state management
│   ├── Drag-and-drop dashboard builder
│   └── Responsive (mobile + desktop)
├── Backend (Node.js / Express)
│   ├── JWT auth (httpOnly cookies)
│   ├── RESTful API with role middleware
│   ├── Rate limiting & security hardening
│   └── Image upload & optimization
├── Database (PostgreSQL)
│   ├── 34+ tables covering all modules
│   ├── Relational integrity for transactions
│   └── Multi-branch data isolation
└── Deployment
    ├── Frontend: CDN-hosted (SSL + caching)
    ├── Backend: API server with reverse proxy
    └── Database: Managed PostgreSQL

Key Features

Sales & Point of Sale

  • Transaction management — Create, edit, and void sales transactions with automatic stock deduction
  • Customer credit tracking — Monitor outstanding balances and payment history per customer
  • Sales history — Filterable transaction log with date range, branch, and customer filters

Procurement & Supply Chain

  • Central procurement — HQ creates purchase orders to suppliers with approval workflow
  • Branch procurement — Branches request stock from central warehouse with transfer tracking
  • Return management — Branch-to-HQ and HQ-to-supplier return flows with documentation

Inventory Management

  • Real-time stock levels — Per-product, per-branch inventory with automatic updates on transactions
  • Stock opname — Physical count workflow with variance reporting
  • Product catalog — Master data with images, categories, units, and pricing

Accounting & Finance

  • Master account system — Structured chart of accounts (format: AKYYMMNNNN)
  • Expense tracking — Categorized expense recording with receipt documentation
  • Bank reconciliation — Match transactions with bank statements

Reporting System (17+ Reports)

  • Sales recap — By branch, by product, by customer, by period
  • Financial reports — Profit/loss, balance sheet, cash flow
  • Inventory reports — Aging, movement, stock valuation
  • Excel export — All reports downloadable as .xlsx for offline analysis

Dashboard & Analytics

  • Drag-and-drop widgets — Customize dashboard layout per user role
  • Real-time filters — Date range, branch, and product category filters
  • Multi-report view — Display multiple KPI widgets on a single screen

User Management & Security

  • Granular roles — SUPER_ADMIN, ADMIN_PUSAT, ADMIN_CABANG, KEPALA_GUDANG, MANAGER_PURCHASING, and more
  • Menu-based permissions — Control which modules each role can access
  • Session security — JWT tokens with 12-hour expiry, BCrypt password hashing, rate limiting on login

What I Learned

  • ERP data models are deeply relational — Products link to categories, units, transactions, stock entries, and suppliers. PostgreSQL’s relational integrity prevented countless data inconsistencies that would have been invisible in a NoSQL database.
  • Role-based access is more than auth — It’s about UX design. Each role sees a different app — the warehouse clerk doesn’t need financial reports, the accountant doesn’t need stock opname. Designing navigation per role was a UX challenge, not just a security one.
  • Reporting drives adoption — Users don’t adopt an ERP because it’s modern. They adopt it because it gives them reports they couldn’t get before. The 17+ report types were the #1 reason stakeholders pushed their teams to use the system.
  • Multi-branch architecture requires discipline — Every query needs to account for branch scoping. Forgetting a branch filter in one query means leaking data across branches — a critical business issue, not just a bug.
  • Indonesian business processes are unique — Purchase order approvals via WhatsApp, verbal return authorizations, handwritten stock counts. Digitizing these required understanding the actual workflow, not just building CRUD screens.

For more enterprise-grade projects, see my BSpace mining operations app for industrial Flutter patterns, or my Semesa Grande community management platform for role-based web app architecture.

Interested in Something Similar?

Need a similar project built, want to collaborate, or have questions about the tech stack? Drop a comment below or reach out directly.

Discussion