TechStock IMS

A layered .NET 8 hardware inventory management system — CRUD, stock adjustment with guards, a public REST API, role-based security & dashboard analytics.

ASP.NET Core 8 MVCC#EF Core 8 + SQL ServerASP.NET Core IdentityREST APIIn-Memory CachingxUnit + Moq

No public demo — runs locally with .NET 8 SDK & SQL Server LocalDB. Auto-migrates & seeds on first startup.

TechStock IMS dashboard showing stock levels and hardware inventory

The problem

Tracking computer hardware by spreadsheet is error-prone: stock counts drift, low-stock items go unnoticed, and there's no audit trail of who changed what. TechStock IMS replaces that with a proper inventory system backed by a database.

Who uses it

  • Visitor browses the public catalogue (no login required).
  • Staff adds, edits & adjusts stock (±1 with insufficient-stock guard).
  • Admin manages users, assigns roles, deletes accounts & full product CRUD.
Inventory Control Topology
Role-Based Architecture
Interface Tier Responsive MVC & Bootstrap

Clean staff inventory ledger with real-time stock alert badges and quick +/- adjustment triggers.

Security & RBAC ASP.NET Core Identity

Three-tier access model (Visitor / Staff / Admin) with granular endpoint authorization.

Data Layer EF Core & SQL Server / SQLite

Automated schema migrations, seed pipeline, and transactional stock updates with negative-guard checks.

Key decisions

Controller → Service → Repository layers

A clean layered architecture over Entity Framework Core. Controllers handle HTTP, services own business logic (`IProductService`), repositories own data access (`IProductRepository`).

In-memory caching with write invalidation

Dashboard reads are cached for 5 minutes and invalidated on any write, so the dashboard stays fast without serving stale stock counts.

Role-based API writes

The `api/products` REST API is public for reads but admin-gated for writes (`POST`/`PUT`/`PATCH`/`DELETE` require `Admin` or `Staff`).

Offline-friendly inline SVG icons

All button, nav & stat icons are self-contained inline SVGs rendered from a `_Icon` partial — no icon-font or CSS CDN, so icons render even offline.

Hardening & observability

Security headers (CSP, X-Frame-Options), request logging with timings, a global exception handler writing daily error logs, and automatic EF migrations + seeding on startup.

How I built & shipped it

  • Testing: Three xUnit + Moq unit tests cover the product service — caching reads, stock guard & create flow.
  • Auth: ASP.NET Core Identity with Admin & Staff roles; demo credentials `admin@techstock.com` / `Admin@123`.
  • API: `api/products` with pagination (`X-Total-Count` header), low-stock & category filters, and stock-delta adjustments.
  • Setup: Zero-config first run — migrations apply and demo data seeds automatically on startup.
API & Audit Pipeline
Data Safety
REST API Paginated Product Endpoints

Filtered search with X-Total-Count metadata and low-stock threshold queries.

Validation Logic Negative-Stock Safeguards

Transactional check rejecting decrements below zero to prevent ghost inventory states.

DevOps Readiness Zero-Config Bootstrap

Automatic schema verification and sample data seeding on cold container startup.

What went wrong

The demo password (`Admin@123`) is intentionally weak so it's easy to try — that's fine for a portfolio piece, but it would never ship to production unchanged. The auto-migrate-on-startup behavior is convenient for demos but would need explicit migration control in a real deployment pipeline.

The lesson: convenience for a demo is not the same as safety for production. Treat seed credentials and startup behavior as deployment concerns, not code.

What I'd do next

  • Frontend tests. The backend is covered; the Razor views aren't tested yet.
  • Real-time stock alerts. Push low-stock notifications instead of relying on dashboard polling.
  • Barcode scanning. Add stock receipt/adjustment via barcode scan for warehouse workflows.

I'm open to Full-Stack/.NET Developer roles & freelance software projects. If this project is the kind of thing your team or business needs, let's talk.