nafi@portfolio:~$
bash — ~/projects/simple-erp
$cd ~/projects/simple-erp && cat summary.txt
Full-stack ERP system for retail businesses — manage inventory across multiple stores, process sales with refunds, handle purchase orders from suppliers, and track everything with role-based access and audit logging.

SIMPLE ERP

Full-Stack Developer · #e8c2f41 fullstack
NestJS · Next.js 14 · Tailwind CSS · Prisma · PostgreSQL/SQLite github.com/sleepyhead000/simple-erp
~/projects/simple-erp $

cat README.md

README.md
$cat overview.txt
A production-grade ERP for retail: product catalog with SKUs and categories, per-store inventory with low-stock alerts, sales transactions with multi-method refunds, purchase orders that auto-update stock on receive, and a dashboard with real-time revenue/inventory metrics. Ships with a one-click launcher that auto-detects Docker and falls back to SQLite.
$cat architecture.txt
Backend: NestJS with Prisma ORM, JWT auth (bcrypt + 15-min expiry), class-validator DTOs on every endpoint, and RBAC guards (admin/manager/cashier/staff). Frontend: Next.js 14 App Router with Tailwind CSS + shadcn/ui components, Zustand for client state, React Query for server state. Global rate limiting (100 req/min) and per-route auth guards.
$cat data.txt
9-table schema: stores, users, products, inventory, purchase_orders, purchase_order_items, sales_transactions, sales_transaction_items, audit_log. Stock protection prevents negative inventory adjustments. All mutations are audit-logged. Supports PostgreSQL (Docker) for production and SQLite for zero-dependency local dev.
~/projects/simple-erp $

ls -l features/

dashboard
Real-time metrics · revenue breakdown, stock levels, sales + order counts
products
Full CRUD with SKU · categories, pricing, search, pagination
inventory
Per-store stock levels · low-stock alerts · audit-logged adjustments
sales
POS transactions · multiple payment methods · refund processing
purchase orders
Supplier orders · receive stock · auto-update inventory on receive
multi-store
Multiple locations · store-level data isolation · admin store management
rbac
4 roles · admin · manager · cashier · staff — per-endpoint guard enforcement
onboarding
Step-by-step tutorial · guided walkthrough for new users
~/projects/simple-erp $

cat stack.yaml

backend
NestJS · TypeScript · class-validator DTOs · global rate limiting
frontend
Next.js 14 (App Router) · React · Tailwind CSS · shadcn/ui
database
PostgreSQL (Docker) / SQLite (local) · Prisma ORM · dual schema support
auth
JWT + bcrypt · 15-min expiry · RBAC (4 roles) · per-route guards
state
Zustand (client) · React Query (server) · Lucide React (icons)
notifications
Sonner (toast) · non-blocking user feedback
infra
Docker Compose · one-click launcher (bat/sh) · auto-detect Docker/SQLite
~/projects/simple-erp $

git log --oneline

#a1b2c3dfeat/auth

JWT authentication & role-based access control

NestJS · Passport · bcrypt · class-validator
  • Implemented login/register with bcrypt password hashing and 15-minute JWT expiry with cryptographically random secret.
  • Built 4-role RBAC system (admin, manager, cashier, staff) with per-route Guards enforcing role requirements on every endpoint.
  • Rate-limited login endpoint (5 req/min) and global 100 req/min cap via NestJS throttler.
#b2c3d4efeat/products

Product catalog & inventory management

Prisma · PostgreSQL/SQLite · class-validator DTOs
  • Designed 9-table Prisma schema with dual PostgreSQL/SQLite support — same codebase runs on Docker or zero-dependency local dev.
  • Product CRUD with SKU, categories, pricing; inventory tracking per store with low-stock alerts and negative-quantity prevention.
  • All mutations wrapped in audit log — every stock change is traceable to the user and timestamp.
#c3d4e5ffeat/sales

Sales transactions & refund processing

NestJS · Prisma · Zustand · React Query
  • POS endpoint creates atomic sales transactions with line items, multiple payment methods, and automatic inventory decrement.
  • Refund endpoint validates transaction, reverses stock, and records the refund as a linked transaction — no double-spend.
  • Frontend: sales page with real-time search, date filters, and paginated results via React Query.
#d4e5f6afeat/po

Purchase order lifecycle & stock receive

NestJS · Prisma · Next.js 14 · shadcn/ui
  • Full PO lifecycle: create from supplier, receive items (auto-updates inventory), cancel with validation.
  • Receive endpoint atomically increments stock per-store and logs the adjustment — no race conditions.
  • Frontend PO page: list/detail views, status badges, receive/cancel actions with confirmation dialogs.
#e5f6a7bfeat/store

Multi-store architecture & admin dashboard

Next.js 14 · Zustand · Tailwind CSS · Lucide React
  • Store-level data isolation: inventory, sales, and POs are scoped to the active store; admin can manage all stores.
  • Dashboard with real-time metrics: revenue breakdown, stock levels, top products — all computed server-side via Prisma aggregations.
  • Onboarding tutorial component guides new users through first login with a step-by-step overlay.