Skip to content

Smart Inventory Hub

Live

AI-assisted inventory management with strict per-account isolation

My role

Designed and built the application end to end, including the data-access scoping and the AI description workflow.

Frontend

Next.js 16ReactTypeScriptTailwind CSS v4shadcn/uiAG Grid Community

Backend & data

Server ActionsPostgreSQL (Neon)Drizzle ORM

Auth & AI

ClerkGemini 2.5 Flash (Google AI SDK)

Overview

Smart Inventory Hub is a full-stack business application for managing assets: a searchable, sortable dashboard, complete create/edit/delete workflows, an analytics view, and AI-assisted description generation, with every record scoped to the signed-in account.

The problem

Teams tracking assets needed a dashboard where records are easy to search and sort, changes are safe (one account can't see or edit another account's data), and writing consistent asset descriptions doesn't have to be done by hand every time.

Requirements

Functional

  • Authenticated dashboard with a searchable, sortable asset table.
  • Full create, edit, and delete workflows for assets.
  • Analytics view summarizing inventory data.
  • One-click AI-generated, editable asset descriptions.

Non-functional

  • Strict per-account data isolation — no cross-account access to another user's records.
  • Responsive UI usable on mobile as well as desktop.
  • Reliable read/write behavior for a CRUD-heavy application.

System architecture

Next.js Server Components handle reads and Server Actions handle mutations, talking to PostgreSQL (Neon) through Drizzle ORM. Clerk provides authentication, and every query is scoped by the authenticated user's ID so records never leak across accounts. Gemini 2.5 Flash is called server-side to draft asset descriptions that the user can edit before saving.

  1. User

    Authenticated via Clerk

  2. Next.js UI

    Server Components (reads) + Server Actions (writes)

  3. Gemini 2.5 Flash

    Drafts an editable asset description

    Drizzle ORM

  4. PostgreSQL (Neon)

    Asset records scoped by user ID

  5. Dashboard & analytics

Every query is scoped to the authenticated user's Clerk ID at the data-access layer, so one account's assets are never visible to another. AI description generation returns an editable draft rather than writing directly to the database.

Backend & data

Backend design

  • Server Actions for all mutations (create, edit, delete); Server Components for data reads — no separate client-side data-fetching layer.
  • Drizzle ORM over PostgreSQL (Neon) for typed queries and schema management.

Database design

  • PostgreSQL (Neon) schema for assets, scoped per user via the Clerk user ID on every query.

Authentication & authorization

Clerk handles authentication; the authenticated user's ID is applied as a filter on every data-access query so records are isolated per account rather than relying only on UI-level checks.

Integrations

  • Gemini 2.5 Flash via the Google AI SDK for generating editable asset descriptions.
  • AG Grid Community for the searchable, sortable asset dashboard.

Decisions & trade-offs

Decision

Server Actions for mutations instead of a separate REST/API-route layer.

Why

Keeps the CRUD surface close to the UI code and avoids hand-rolled API endpoints for straightforward form-driven writes.

Decision

Enforce user-scoping at the query layer, not just in the UI.

Why

Prevents cross-account data access even if a client-side check is bypassed.

Decision

AI-generated descriptions are editable drafts, not auto-saved content.

Why

Keeps a human in the loop before AI-generated text becomes part of the record.

Trade-offs

  • Server Actions simplify the write path but couple mutations to the Next.js runtime rather than exposing a reusable public API.

Technical challenges

Preventing one account from ever seeing another account's inventory.

Applied the Clerk user ID as a filter directly in the Drizzle queries for every read and write, rather than relying on the UI to hide other accounts' data.

Deployment & operations

Deployment

  • Deployed on Vercel; live demo at smart-inventory-blush-theta.vercel.app.
  • Bun and Biome used for local tooling.

Security

  • Clerk-managed authentication.
  • Per-user row-level scoping enforced at the query layer on every asset record.

Performance

  • Server Components avoid shipping data-fetching logic to the client; AG Grid Community handles table search, sort, and filter on the client.

Results

A working, deployed dashboard with full CRUD, AI-assisted descriptions, and per-account data isolation.