- Node.js + TypeScript
- Express.js (REST API)
- Prisma ORM (database access)
- PostgreSQL (Supabase) as database
-
Clone the repo
npm install
-
Add
.envcontent.DATABASE_URLandCORS_ORIGIN
-
Run development script
npm run dev
-
Build for prod env and run.
npm run build npm start
GET /products→ List all products. (optional query:?category=Apparel)GET /products/:id→ Get product by id.POST /products→ Add new product.
curl http://localhost:3000/products
curl http://localhost:3000/products/1
curl -X POST http://localhost:3000/products \
-H "Content-Type: application/json" \
-d '{
"name": "Basic T-Shirt",
"description": "Cotton, slim fit",
"quantity": 50,
"price": 19.99,
"category": "Apparel",
"imageUrl": "https://picsum.photos/seed/tee/400/300",
"inStock": true
}'