BJ Printworks & Souvenirs
Inventory Management API — Siargao & Surigao Print Shop & Souvenir Store
API Endpoints
Auth
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register | Register a new user |
| POST | /api/auth/login | Login |
| GET | /api/auth/me | Get current user |
| POST | /api/auth/logout | Logout |
| PUT | /api/auth/users/:id/role | Update user role (admin only) |
| GET | /api/auth/users | Get all users (admin only, ?search=&status=&page=&limit=) |
| PUT | /api/auth/users/:id/approve | Approve a user (admin only) |
| PUT | /api/auth/users/:id/reject | Reject a user (admin only) |
| POST | /api/auth/google | Authenticate with Google |
| POST | /api/auth/forgot-password | Request password reset OTP |
| POST | /api/auth/reset-password | Reset password with OTP |
| PUT | /api/auth/profile | Update current user's profile |
Categories
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/categories | Get all categories (?search=&page=&limit=) |
| POST | /api/categories | Create a category (with optional skuPrefix) |
| PUT | /api/categories/:id | Update a category (with optional skuPrefix) |
| DELETE | /api/categories/:id | Soft-delete a category |
Products
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/products | Get all products (?search=&category=&isCustomizable=&page=&limit=) |
| GET | /api/products/:id | Get a single product |
| POST | /api/products | Create a product (SKU auto-generated from skuPrefix if omitted) |
| POST | /api/products/import | Bulk import products (max 500, category matched by name) |
| PUT | /api/products/:id | Update a product |
| DELETE | /api/products/:id | Soft-delete a product |
Orders
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/orders | Get all orders (?search=&status=&page=&limit=) |
| GET | /api/orders/:id | Get a single order |
| POST | /api/orders | Create an order (decrements stock) |
| PUT | /api/orders/:id | Update an order |
| DELETE | /api/orders/:id | Soft-delete an order |
Tech Stack
- Runtime: Node.js (ES Modules)
- Framework: Express
- Database: MongoDB with Mongoose
- Auth: Express Session + connect-mongo
- File Upload: Multer + Cloudinary
- Security: Helmet, CORS, express-rate-limit
- Docs: Swagger (swagger-jsdoc + swagger-ui-express)