Personal Project · Full-Stack Web App
WMS VERSION 1.0 · Flask · SQLite

Warehouse
Management
System

Multi-tenant inventory platform — per-user isolated databases, real-time stock tracking, analytics dashboards, and a structured event schema built for downstream DS/AI pipelines.

7
DB Tables
Multi-tenant
REST
API Layer
Try Live Demo Nguyen Hong Son · 2025–2026
warehouse.db · stock_view
Steel Box 50×50142 pcs
Bolt M8×403 pcs ⚠
AB Adhesive28 box
Wire 1.5mm510 m
Hex Bolt M106 pcs ⚠
stock_in stock_out

Data Flow

API Pipeline

process_transaction(user_id, product_id, qty, direction)
01
🔐
Auth
session · PBKDF2
02
📦
Stock Engine
stock_in / stock_out
03
🕵️
Audit Log
old / new · JSON
04
📊
Analytics
time-series SQL
05
📤
Export
CSV · HTML

DS / AI Relevance

Built for
Downstream Analytics

Data Science · AI Engineer Perspective

The schema and event pipeline were designed with downstream ML in mind — not just a CRUD app. Every stock movement is a timestamped, structured event. The audit log captures old/new state diffs in JSON, ready to feed anomaly detection or demand forecasting models with minimal preprocessing.

⏱ Time-Series Schema
stock_in / stock_out keyed on ISO-8601 timestamps (VN tz). SQL aggregations over day / month / year match feature engineering patterns for demand forecasting.
📋 Structured Audit Events
audit_log stores action, table_name, record_id, old_values (JSON), new_values (JSON). Direct input to anomaly detection — no ETL needed.
⚠ Alert Threshold Logic
alert_amount per product mirrors reorder-point logic in inventory optimization. qty_per_shift enables shift-level demand feature extraction.
🗓 Schedule Table
expected_in / expected_out per date create a ground-truth forecast table — enabling MAE / MAPE evaluation against actual transactions.

What It Does

Core
Features

🔐
Auth & Multi-tenancy
PBKDF2-HMAC password hashing, per-user isolated SQLite databases, secure HTTP-only sessions with 7-day lifetime and CSRF protection.
📦
Stock In / Out Engine
Batch transactions, real-time current_stock updates, configurable low-stock alerts with repeat interval settings.
📊
Analytics Dashboard
Time-series SQL aggregations over week / month / year with per-product drill-down. Chart series returned as structured JSON.
🗓️
Shift Scheduling
Expected in/out volumes per date. Employee assignment and role management via dedicated employees table.
🕵️
Full Audit Trail
Every mutation logged with old/new JSON diffs, actor ID, table name, and VN-timezone timestamps — ML-ready event log.
📤
Export & Reporting
CSV and HTML report export, shareable per-user export URLs served directly from Flask with zero external storage dependency.

System Design

Architecture

┌─────────────────────────────────────────────────────────────────┐ BROWSER (Vanilla JS) Stock UI · Dashboard Charts · Schedule · Audit Log └────────────────────────────┬────────────────────────────────────┘ │ HTTP/REST · JSON · session cookie ┌────────────────────────────▼────────────────────────────────────┐ FLASK (Python) ┌──────────────────────────────────┐ ┌─────────────────────┐ │ Transaction Engine │ │ Auth / Session │ │ stock_in ──► current_stock │ │ PBKDF2 · UUID │ │ stock_out ──► alert check │ └─────────────────────┘ │ batch API ──► audit_log (JSON) │ └──────────────────────────────────┘ ┌─────────────────────┐ │ Analytics Engine │ ┌──────────────────────────────────┐ │ time-series SQL │ │ Per-User SQLite DB │ │ week/month/year │ │ data_base/{user_id}/ │ └─────────────────────┘ │ warehouse.db (7 tables) │ └──────────────────────────────────┘ └─────────────────────────────────────────────────────────────────┘ ┌─────────────────────────────────────────────────────────────────┐ Linux VPS · Gunicorn · Nginx └─────────────────────────────────────────────────────────────────┘

Technology

Full Stack

Python · Flask
REST API backend · session management · routing
SQLite (multi-tenant)
Per-user isolated databases · foreign keys · WAL
PBKDF2-HMAC · SHA-256
260 000-round password hashing · salt + dk storage
Time-Series SQL
strftime aggregations · week / month / year buckets
Audit Log (JSON diff)
old_values / new_values · actor · table · timestamp
Vanilla JS · HTML / CSS
Single-page frontend · zero build step · no framework
Gunicorn · Nginx
Production deployment on Linux VPS
CSV · HTML Export
Report generation · shareable per-user export URLs