Store & Warehouse Inventory Management System

May 10, 2026

NestJS
Next.js 15
TypeScript
PostgreSQL 17
Drizzle ORM
Turborepo
JWT
Passport.js
Docker

Overview

logo

A web-based inventory management system designed for Mongolian small and medium enterprises that operate both a central warehouse and one or more retail stores. The system unifies stock tracking, transfer authorization, and sales reporting under a single role-aware interface so that owners stop relying on paper logs, scattered Excel files, and chat messages to keep stock counts honest.

Problem

Mongolian SMEs that run both warehouses and stores typically manage inventory manually. Stock levels live in notebooks or workbooks that go out of sync the moment a transfer or sale happens; transfer requests travel through Messenger or phone calls; and there is no audit trail when numbers don't add up at month-end.

The concrete pain points the system set out to solve:

  • Resource discrepancies between what the warehouse thinks it shipped and what the store thinks it received
  • Human error in repeatedly transcribing the same transfer across paper, spreadsheet, and chat
  • Lagged information β€” owners don't see the real stock state until someone manually compiles it
  • No audit trail, so when discrepancies appear, there is no way to reconstruct who moved what, when, or under whose authorization

Research

A survey of existing inventory systems used regionally and globally β€” Oracle WMS, Odoo, and the locally-developed Veritech β€” found that none of them fit Mongolian SMEs cleanly. The international systems are priced and scoped for enterprises with dedicated logistics teams; the local options solve either warehouse or retail but rarely the seam between them, which is exactly where SMEs lose stock. This system positions itself in that gap: it treats the warehouse↔store handoff as a first-class workflow rather than as two disconnected modules.

System Design

The system is structured as a three-tier web application:

  • Presentation tier β€” Next.js 15 (App Router) frontend, server-rendered, mobile-responsive, Mongolian-language UI
  • Business logic tier β€” NestJS REST API protected by JWT and Passport.js, with role-based access control (RBAC) gating every endpoint
  • Data tier β€” PostgreSQL 17 accessed through Drizzle ORM, with an audit table that records every state-changing action

Three user roles are wired through RBAC end-to-end:

  • Admin β€” provisions warehouses, stores, and users; sees everything
  • Warehouse Manager β€” manages stock at a specific warehouse and initiates transfers to stores
  • Store Manager β€” receives transfers, records sales, and reports back to their store's stock

The transfer workflow is the design centerpiece: a transfer is a stateful object that the warehouse manager creates, the store manager confirms on receipt, and the system writes to the audit log on every transition β€” replacing the chat-message handoff with a digital signature trail.

System architecture diagram

Tech Stack

  • Frontend: Next.js 15, React, TypeScript, Tailwind CSS
  • Backend: NestJS (REST API), TypeScript, JWT + Passport.js for auth
  • Database: PostgreSQL 17 with Drizzle ORM
  • Build: Turborepo monorepo, pnpm workspaces
  • Infrastructure: Docker for local development; deployable as containerized services

Implementation

The NestJS backend is split into seven modules, each owning its own controllers, services, and Drizzle schemas:

  • Auth β€” login, JWT issuance, password hashing
  • Users β€” user CRUD scoped by role
  • Warehouses β€” warehouse provisioning and stock state
  • Stores β€” store provisioning and stock state
  • Transfers β€” the warehouse↔store transfer state machine
  • Sales β€” point-of-sale entry from the store side
  • Audit β€” append-only log of every state-changing action across the other six modules

The repository is a Turborepo monorepo so the backend, frontend, and shared TypeScript types live in one place and build together:

warehouse-inventory/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ api/        # NestJS REST API
β”‚   └── web/        # Next.js 15 app
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ db/         # Drizzle schema + migrations
β”‚   └── shared/     # Shared types and DTOs
└── turbo.json

Results

The delivered system covers the full warehouse-to-store loop:

  • Multi-warehouse, multi-store unified stock view in one dashboard
  • Digital transfer authorization replacing chat-and-paper handoffs
  • Automated audit logging on every state change, queryable by user, date, or entity
  • Three role-tailored UIs β€” admin, warehouse, and store β€” sharing one component library
  • Mobile-responsive layouts (login, sidebar, tables) so store managers can use it on a phone
  • Mongolian-language interface throughout

transfer 1

transfer 2

transfer 3

Conclusion

The project is an exercise in scoping software to a specific market: small Mongolian businesses that need an audit trail more than they need configurability. The next step is moving from a single-tenant deployment toward a multi-tenant SaaS, plus expanding the audit module into a full reporting layer.