Skip to main content

Inventory Management System

This project is a full-stack application designed with a "Merchant-First" mindset. It focuses on scannability, data security, and ease of use for non-technical business owners.

Inventory Dashboard (UI)

The frontend utilizes a stateless approach to maximize security, ensuring sensitive auth data never hits localStorage.

Technical Stack

  • Library: React.js (Vite)
  • State: React Hooks (useState, useEffect)
  • Styling: Modular Sass (SCSS)

Key Features

  • Real-Time Dashboard: Overview of stock levels with low-stock highlighting.
  • Inline Management: Update quantities directly from the table view.
  • Responsive: Optimized for the warehouse floor (tablet/mobile).

Component Design

  • Reusability: Modular SCSS and functional components (Modals, Tables).
  • User Feedback: Clear loading states and error boundaries.

Local Setup

To run the full Inventory Management System locally, follow these steps in order to ensure the frontend can successfully communicate with the backend.

1. Database & Environment Ensure PostgreSQL is running, then create the database and apply the schema:

  createdb inventory_app
psql -d inventory_app < db/schema.sql

Create a .env file in the root directory:

  PORT=3000
DATABASE_URL=postgres://localhost:5432/inventory_app
SESSION_SECRET=your_secret_string

2. Launching the System

Order of Operations

Always start the Backend first so the Frontend has an API to connect to.

Start Backend (Terminal 1):

  # From the root directory
npm install
npm run dev

Start Frontend (Terminal 2):

  # If frontend is in a separate folder
cd frontend
npm install
npm run dev

The dashboard will be accessible at http://localhost:5173.


Security & Design Implementation

The Inventory Management System follows a stateful, "security-first" authentication flow to protect merchant data from common web vulnerabilities.

  • Data Isolation: Enforced via a user_id foreign key on the items table, ensuring users can only access their own data.
  • SQL Injection Protection: All database interactions utilize parameterized queries ($1, $2).
  • Stateful Security: Server-side sessions prevent unauthorized data access even if client-side state is compromised.
Technical Deep Dive

I’ve written a detailed breakdown of the session-based authentication architecture, including the logic behind choosing HttpOnly cookies over JWTs.

Read the Security & Auth Deep Dive