Skip to content

itxtalal/healf-ops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Operations Products Management System

DISCLAIMER — Seeds Database on Startup:

Running the project via docker-compose up --build will automatically run database migrations and execute the Prisma seed script inside the backend container. The seed resets and populates the database with demo data (see backend/prisma/seed.ts), so do not run it against production data or a database you need to keep unchanged.

Full-stack ops dashboard to manage products and product owners. Backend is NestJS + Prisma; frontend is Next.js with a clean admin UI. Docker Compose gives a one-command spin-up.

Quick Start (Docker)

docker-compose up --build

Services: Postgres (5432), Backend API (3001, Swagger at http://localhost:3001/docs), Frontend dashboard (3000).

Open These URLs

Local Development (without Docker)

Backend

cd backend
cp .env.example .env   # set DATABASE_URL, PORT
npm install
npx prisma migrate dev --name init
npx prisma db seed      # optional but recommended for demo data
npm run start:dev

Frontend

cd frontend
echo "NEXT_PUBLIC_API_URL=http://localhost:3001" > .env.local
npm install
npm run dev

What the System Does

You can fully manage products and product owners from the dashboard.

Products

  • Create, edit, delete, and view products
  • Upload product images (stored locally)
  • Filter and search by name, SKU, status, owner, price range, and inventory range
  • Sorting and pagination are built in
  • Stock status updates automatically based on inventory: 0 -> Out of Stock, >0 -> In Stock

Product Owners

  • Create, edit, and view owners
  • Search, sort, and paginate
  • Cannot delete an owner if products reference them

Dashboard Insights

  • Total products and inventory value
  • Products by status
  • Top owners
  • Recent products
  • Low stock items

Image Handling

  • Uploading a new image replaces the old one
  • Old image files are cleaned up

Error Handling

  • Clear API errors for duplicate SKUs, missing records, or invalid relations
  • No raw database errors exposed

Data Model

  • ProductOwner: id, name, timestamps, products relation
  • Product: id, name, unique SKU, price, inventory, status (IN_STOCK, OUT_OF_STOCK, DISCONTINUED), optional imagePath, owner FK, timestamps

Notes

  • No authentication/authorization (intentional)
  • Seed script resets data for deterministic demos
  • Images stored on disk in backend/uploads (not cloud storage)
  • Prices and inventory cannot be negative; SKU must be unique
  • Pagination and sort inputs are sanitized to avoid over-fetching or unsafe ordering

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages