The Order Service manages delivery orders for the Commune Drop platform. It serves as the central coordination point between customers, carriers, and other services in the platform.
- Create and manage delivery orders
- Track order status in real-time
- Cancel or modify existing orders
- Retrieve order history and details
- Coordinate with other services for a complete delivery workflow
- Auth Service: User authentication and authorization
- Valuation Service: Delivery price calculation
- Carrier Service: Finding and assigning riders
- Location Service: Order and rider tracking
- Payment Service: Processing payments
- Notification Service: Sending status updates
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB
- Message Queue: RabbitMQ/Kafka
- Caching: Redis
- Node.js v16+
- MongoDB
- Redis
- Clone the repository
git clone https://github.com/commune-drop/order-service.git
cd order-service
- Install dependencies
npm install
- Configure environment variables
cp .env.example .env
# Edit .env with your configuration
- Start the service
npm start
For development:
npm run dev
Key environment variables:
PORT=3001
MONGODB_URI=mongodb://localhost:27017/order-service
AUTH_SERVICE_URL=http://auth-service:3000
VALUATION_SERVICE_URL=http://valuation-service:3004
CARRIER_SERVICE_URL=http://carrier-service:3006
LOCATION_SERVICE_URL=http://location-service:3002
PAYMENT_SERVICE_URL=http://payment-service:3003
NOTIFICATION_SERVICE_URL=http://notification-service:3005The service publishes these events when order status changes:
order.createdorder.acceptedorder.picked_uporder.in_transitorder.deliveredorder.cancelled
MIT