Back to Home
Personal project · Modular ERP (live demo)
K-ERP: STOCK & PURCHASING + GENERAL LEDGER
Overview
A small business system for buying and stocking goods. Purchase orders are approved, goods are received, and the matching accounting entry appears in the general ledger on its own, exactly once, even if the accounting service was down at the time.
Key Highlights
- Three services behind one login: a Next.js gateway (JWT in an httpOnly cookie, reverse proxy) plus Stock & Purchase and Accounting, each with its own PostgreSQL database.
- Transactional outbox + idempotent posting: no lost or duplicated journal entries, verified on production by suspending the accounting service mid-receipt.
- Double-entry rules enforced in code and in PostgreSQL (CHECK constraint, triggers that make posted entries immutable); money stored as integer satang.
- Row-level locking keeps stock from going negative; gap-free document numbers under concurrent requests (tested with 20 parallel creates).
- Deployed for 0 THB (Vercel, Render, Neon) with CI on every repository and a nightly job that resets the demo and reconciles stock value with the ledger.
Project Details
CategoryWebsite project
TagsPersonal project · Modular ERP (live demo)
Live demo Source code Stock report (PDF) Accounting report (PDF)Email me Tools & Tech Stack
TypeScript
Node.js / Express
PostgreSQL / Prisma
React / Vite
Next.js
Vitest