A backend API for managing categories, products, and inventory with file upload support.
This is a simple Ecommerce Inventory Management API built with NestJS and Prisma ORM.
It supports Category & Product CRUD operations, product filtering (by category, price, pagination), and file upload to Supabase storage.
👉 https://ecommerce-inventory-api-irhk.onrender.com/api/docs
- ERD Diagram: View Online
- Diagram Image: available inside the
/dbfolder at the root of the project
- NestJS — backend framework
- PostgreSQL with Prisma ORM
- Neon — Postgres database hosting
- Supabase Storage — file upload & management (via Multer)
- Swagger — API documentation
Create a .env file in the root directory using .env.example as a reference:
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres?schema=public"
JWT_SECRET="super-secret-key"
ACCESS_TOKEN_EXPIRES_IN="7d"
NODE_ENV=development
PORT=4000
SUPABASE_URL="https://xyz.supabase.co"
SUPABASE_SERVICE_ROLE_KEY="service-role-key-with-permissions"
# Ensure the Supabase Storage has a bucket named "product"
# You can create one from Supabase Dashboard → Storage → Create Bucket-
Clone the repo
git clone https://github.com/shahadathhs/ecommerce-inventory-api.git cd ecommerce-inventory-api -
Install dependencies
pnpm install
-
Generate Prisma client & run migrations
pnpm db:generate pnpm db:migrate
-
Start the server
pnpm dev
-
Open Swagger docs
http://localhost:4000/api/docs
- Backend is hosted on Render
- Database is hosted on Neon
- File uploads are stored on Supabase Storage
src/
├── modules/
│ ├── category/ # Category management (CRUD)
│ ├── product/ # Product management (CRUD + filters)
│ ├── auth/ # Authentication (login, register, refresh, etc.)
├── common/ # Shared utils, decorators, guards, interceptors
├── lib/
│ ├── prisma/ # Prisma service & client wrapper
│ ├── file/ # Supabase file upload integration
└── main.ts # Application entrypoint
prisma/
├── migrations/ # Database migration files
└── schema/ # Prisma schema definition
prisma.config.js # Prisma CLI/config entry
- Category CRUD (unique name, slug auto-generated)
- Product CRUD with filters (category, price range, pagination)
- Supabase file upload (with delete handling)
- Swagger API documentation
- Repository pattern architecture