Skip to content
Node.jsExpressMongoDBEJS

Product Inventory System

Inventory manager for products, suppliers and categories, with a dashboard for stock value, low-stock alerts and charts. Node.js, Express and MongoDB.

About

A personal project: a server-rendered inventory system for a small shop or warehouse. It keeps products, suppliers and categories in MongoDB and opens on a dashboard that answers the questions a stock manager asks first: how much stock is there, what is it worth, and what is about to run out.

Challenges

Stock data is only useful if problems surface without digging through tables. The dashboard had to turn raw product records into totals, inventory value, low-stock alerts and restock suggestions, while the product, supplier and category screens stayed fast to search and filter.

Solutions

Built an Express 5 app with Mongoose models for products, suppliers and categories, and EJS views with shared layouts and partials. The dashboard controller computes totals, inventory value, low-stock alerts (under 20 units, urgent under 10) and restock suggestions, and feeds Chart.js charts for category split, stock levels and value by category. List screens have search and category or supplier filters, and create, edit and delete run through modals that post to the controllers and get JSON back for XHR requests.

Technologies

Node.jsExpress 5MongoDBMongooseEJSexpress-validatorChart.js
dashboard.controller.js
const totalProducts = products.length;
const totalSuppliers = suppliers.length;

// Calculate low stock items (quantity < 20)
const lowStockItems = products.filter((p) => p.quantity < 20);
const lowStockCount = lowStockItems.length;

// Calculate total inventory value
const inventoryValue = products.reduce((sum, product) => {
	return sum + product.price * product.quantity;
}, 0);

// Get low stock alerts (top 3 lowest stock items)
const alerts = lowStockItems
	.sort((a, b) => a.quantity - b.quantity)
	.slice(0, 3)
	.map((product) => ({
		...product,
		urgency: product.quantity < 10 ? "urgent" : "warning",
	}));

// Get suggested items to restock (low stock items sorted by quantity)
const suggestedItems = lowStockItems
	.sort((a, b) => a.quantity - b.quantity)
	.slice(0, 4);

// Category distribution for pie chart
const categoryDistribution = {};
products.forEach((product) => {
	const cat = product.category || "Uncategorized";
	categoryDistribution[cat] = (categoryDistribution[cat] || 0) + 1;
});
Product Inventory System dashboard with totals, low-stock count, inventory value and charts for products by category and stock levels
Product Inventory System categories screen with color-coded category cards and status filter
Product Inventory System products table with search, category and supplier filters, and stock quantity badges
Product Inventory System suppliers screen with supplier cards showing address, phone, email and country

Ready To Build Something Real?

Whether you need a Webflow site your team can run, a full-stack web app, or a second pair of hands on an existing codebase, I'm open to freelance projects and full-time roles. Agencies: I also build white-label, under your brand.

Book a 20-min call