Short Explanation
Kirim Now REST API is a backend system designed for courier and logistics operations. This project was developed to further explore the use of the NestJS framework and modern backend architecture patterns, and showcases enterprise-grade features and integrations.
Key Features
- JWT-based authentication and authorization, along with role and permission management.
- Implementation of an email notification system integrated with NestJS, as well as a queue system for efficient and reliable email delivery.
- This system will be equipped with Xendit payment gateway integration that supports various payment methods, including an auto-expired payment feature utilizing Redis queues when invoices are not paid within a specified expiration time.
- Shipment management, including creation, tracking, and shipment status.
- Management of branches, couriers, and shipment history.
- Creation of shipping labels in PDF format complete with QR codes.
- Implementation of Turf.js to calculate the distance between two coordinate points (longitude and latitude).
- Implementation with OpenCage to perform geocoding, which converts addresses into geographic coordinates (latitude and longitude).
- Implementation of Google Cloud Storage for storage media.
- Using Redis as a message broker to manage email queues and various background jobs.
API Endpoints
List of available routes:
Authentication Routes:
POST /api/v1/login - User login
POST /api/v1/register - Register new userRoles Management:
GET /api/v1/roles - Get list of all roles
GET /api/v1/roles/:id - Get role details by ID
PATCH /api/v1/roles/:id - Update role by IDPermissions Management:
GET /api/v1/permissions - Get list of all permissionsProfile Management:
GET /api/v1/profile - Get current user profile
PATCH /api/v1/profile - Update user profileBranches Management:
POST /api/v1/branches - Create new branch
GET /api/v1/branches - Get list of all branches
GET /api/v1/branches/:id - Get branch details by ID
PATCH /api/v1/branches/:id - Update branch by ID
DELETE /api/v1/branches/:id - Delete branch by IDEmployee Branch Management:
POST /api/v1/employee-branch - Assign employee to branch
GET /api/v1/employee-branch - Get list of employee-branch assignments
GET /api/v1/employee-branch/:id - Get employee-branch details by ID
PATCH /api/v1/employee-branch/:id - Update employee-branch assignment
DELETE /api/v1/employee-branch/:id - Remove employee from branchUser Address Management:
POST /api/v1/user-address - Add new user address
GET /api/v1/user-address - Get list of user addresses
GET /api/v1/user-address/:id - Get address details by ID
PATCH /api/v1/user-address/:id - Update user address
DELETE /api/v1/user-address/:id - Delete user addressShipments Management:
POST /api/v1/shipments - Create new shipment
GET /api/v1/shipments/:id/pdf - Download shipment label in PDF format
GET /api/v1/shipments - Get list of all shipments
GET /api/v1/shipments/tracking/:trackingNumber - Track shipment by tracking number
GET /api/v1/shipments/:id - Get shipment details by ID
PATCH /api/v1/shipments/:id - Update shipment data
DELETE /api/v1/shipments/:id - Delete shipmentShipment Webhook:
POST /api/v1/shipments/webhook - Webhook for payment notifications or status updatesCourier Operations:
GET /api/v1/courier/shipments - Get list of shipments for courier
POST /api/v1/courier/pick/:trackingNumber - Pick up package from sender
POST /api/v1/courier/pickup/:trackingNumber - Confirm package pickup
POST /api/v1/courier/deliver-to-branch/:trackingNumber - Deliver package to branch
POST /api/v1/courier/pick-shipment-from-branch/:trackingNumber - Pick up package from branch
POST /api/v1/courier/pickup-shipment-from-branch/:trackingNumber - Confirm pickup from branch
POST /api/v1/courier/deliver-to-customer/:trackingNumber - Deliver package to customerShipment Branch Operations:
GET /api/v1/shipment-branch/logs - Get branch activity logs
POST /api/v1/shipment-branch/scan - Scan package QR code at branchHistory:
GET /api/v1/history - Get activity history
GET /api/v1/history/:id - Get history details by ID