A progressive Node.js framework for building efficient and scalable server-side applications.
Sistem Manajemen Inventaris menggunakan NestJS + PostgreSQL.
Proyek ini adalah repository starter untuk membangun sistem inventaris sederhana dengan NestJS, TypeScript, PostgreSQL, Prisma ORM, dan Docker.
Clone repository, lalu jalankan perintah berikut:
# Build dan jalankan Docker
$ docker compose up --detach --build
# (Opsional) Jika ingin menjalankan di lokal, install dependensi
$ yarn installEndpoint : POST /item
Request Body :
{
"name": "iPhone 15 Pro",
"description": "Latest iPhone",
"price": 25000000,
"quantity": 10,
"categoryId": 1,
"supplierId": 1,
"createdBy": 1
}Response Body
{
"data": {
"id": 1,
"name": "iPhone 15 Pro",
"description": "Latest iPhone",
"price": 25000000,
"quantity": 10,
"categoryId": 1,
"supplierId": 1,
"createdBy": 1
}
}Endpoint : GET /item/:id
Respones Body
{
"data": {
"id": 1,
"name": "iPhone 15 Pro",
"description": "Latest iPhone",
"price": 25000000,
"quantity": 10,
"categoryId": 1,
"supplierId": 1,
"createdBy": 1
}
}Endpoint : GET /item
Response Body
{
"data": [
{
"id": 1,
"name": "iPhone 15 Pro",
"description": "Latest iPhone",
"price": 25000000,
"quantity": 10,
"categoryId": 1,
"supplierId": 1,
"createdBy": 1
},
{
"id": 2,
"name": "MacBook Pro",
"description": "Powerful laptop",
"price": 35000000,
"quantity": 5,
"categoryId": 1,
"supplierId": 2,
"createdBy": 2
}
]
}Endpoint : PATCH /item/:id
Request Body
{
"name": "iPhone 15 Pro Max",
"description": "Latest iPhone Pro Max",
"price": 27000000,
"quantity": 15,
"categoryId": 1,
"supplierId": 1
}Response Body
{
"data": {
"id": 1,
"name": "iPhone 15 Pro Max",
"description": "Latest iPhone Pro Max",
"price": 27000000,
"quantity": 15,
"categoryId": 1,
"supplierId": 1,
"createdBy": 1
}
}Endpoint: DELETE /item/:id Response Body
{
"data": true
}Endpoint: GET /item/summary/supplier Response Body
{
"data": [
{
"supplierId": 1,
"supplierName": "Supplier A",
"totalItems": 25
},
{
"supplierId": 2,
"supplierName": "Supplier B",
"totalItems": 10
}
]
}Endpoint: GET /item/summary/category Response Body
{
"data": [
{
"categoryId": 1,
"categoryName": "Electronics",
"totalItems": 35
},
{
"categoryId": 2,
"categoryName": "Clothing",
"totalItems": 15
}
]
}Endpoint: POST /category
Request Body:
{
"name": "Electronics",
"description": "Kategori barang-barang elektronik"
}Response Body
{
"data": {
"id": 1,
"name": "Electronics",
"description": "Kategori barang-barang elektronik"
}
}Endpoint: POST /category/:id
{
"data": {
"id": 1,
"name": "Electronics",
"description": "Kategori barang-barang elektronik"
}
}Endpoint: GET /category
Response Body
{
"data": [
{
"id": 1,
"name": "Electronics",
"description": "Kategori barang-barang elektronik"
},
{
"id": 2,
"name": "Fashion",
"description": "Kategori pakaian dan aksesoris"
}
]
}Endpoint: DELETE /category/:id
Response Body
{
"data": true
}Endpoint : POST /suppliers
Request Body:
{
"name": "Supplier A",
"contactInfo": "supplierA@example.com"
}Response Body
{
"data": {
"id": 1,
"name": "Supplier A",
"contactInfo": "supplierA@example.com"
}
}Endpoint : GET /suppliers/:id Response Body
{
"data": {
"id": 1,
"name": "Supplier A",
"contactInfo": "supplierA@example.com"
}
}Endpoint : GET /suppliers Response Body
{
"data": [
{
"id": 1,
"name": "Supplier A",
"contactInfo": "supplierA@example.com"
},
{
"id": 2,
"name": "Supplier B",
"contactInfo": "supplierB@example.com"
}
]
}