A comprehensive multi-store order management system with dedicated admin panels for each store. The system supports multiple stores with individual theming, order management, and real-time status updates.
- Glowmark - Premium jewelry and accessories store
- Kapuruka - Fashion and lifestyle store
- OnlineKade - Electronics and digital products store
- Node.js (v16 or higher)
- MongoDB (local or cloud instance)
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/Tech-Titans-AI/Store_simulators.git cd Store_simulators/Store_simulators/Store_Simulation -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env # Edit .env with your MongoDB connection string and other settings -
Start the server
npm start # or node server.js -
Access the application
- Main API:
http://localhost:3000 - API Documentation:
http://localhost:3000/api/docs - Health Check:
http://localhost:3000/api/health
- Main API:
Each store has its dedicated admin panel with store-specific theming and functionality:
- Glowmark Store:
http://localhost:3000/glowmark.html - Kapuruka Store:
http://localhost:3000/kapuruka.html - OnlineKade Store:
http://localhost:3000/onlinekade.html
Access all stores from a single interface:
- Main Dashboard:
http://localhost:3000/index.html
http://localhost:3000/api
Currently, the API operates without authentication for development purposes. In production, implement proper API key or JWT authentication.
POST /api/orders/{store}
Create a new order for a specific store.
curl -X POST http://localhost:3000/api/orders/glowmark
-H "Content-Type: application/json"
-d '{
"userId": "user123",
"items": [
{
"productId": "GLW001",
"title": "Diamond Ring",
"price": 25000,
"quantity": 1
}
]
}'Request Body:
{
"userId": "string",
"items": [
{
"productId": "string",
"title": "string",
"price": "number",
"quantity": "number"
}
]
}Response:
{
"success": true,
"message": "Order created successfully",
"data": {
"orderId": "GLW-1693564800000-ABC123",
"userId": "user123",
"store": "glowmark",
"status": "pending",
"totalAmount": 25000,
"items": [...],
"createdAt": "2025-09-01T10:00:00.000Z"
}
}GET /api/orders/{store}/user/{userId}
Retrieve all orders for a specific user in a store.
curl http://localhost:3000/api/orders/glowmark/user/user123Response:
{
"success": true,
"data": [
{
"orderId": "GLW-1693564800000-ABC123",
"userId": "user123",
"store": "glowmark",
"status": "pending",
"totalAmount": 25000,
"items": [...],
"createdAt": "2025-09-01T10:00:00.000Z",
"statusHistory": [...]
}
]
}GET /api/orders/{store}/{orderId}
Get detailed information about a specific order.
curl http://localhost:3000/api/orders/glowmark/GLW-1693564800000-ABC123PUT /api/orders/{store}/{orderId}/status
Update the status of an order.
curl -X PUT http://localhost:3000/api/orders/glowmark/GLW-1693564800000-ABC123/status
-H "Content-Type: application/json"
-d '{
"status": "in_transit",
"note": "Package shipped via courier"
}'Request Body:
{
"status": "pending|in_transit|store_pickup|completed|cancelled",
"note": "string (optional)"
}PUT /api/orders/{store}/{orderId}/cancel
Cancel an existing order.
curl -X PUT http://localhost:3000/api/orders/glowmark/GLW-1693564800000-ABC123/cancel
-H "Content-Type: application/json"
-d '{
"reason": "Customer requested cancellation"
}'GET /api/orders/{store}/stats/summary
Get order statistics summary for a store.
curl http://localhost:3000/api/orders/glowmark/stats/summaryResponse:
{
"success": true,
"data": [
{
"store": "glowmark",
"status": "pending",
"count": 15
},
{
"store": "glowmark",
"status": "completed",
"count": 48
}
]
}GET /api/orders/{store}/stats/revenue
Get revenue statistics for a store.
curl http://localhost:3000/api/orders/glowmark/stats/revenueGET /api/health
Check if the API is running and healthy.
curl http://localhost:3000/api/healthResponse:
{
"success": true,
"message": "API is healthy",
"timestamp": "2025-09-01T10:00:00.000Z",
"uptime": "2 hours, 30 minutes",
"stores": ["glowmark", "kapuruka", "onlinekade"]
}GET /api/docs
Access interactive API documentation (Swagger/OpenAPI).
curl http://localhost:3000/api/docsEach store has its unique visual theme:
- Primary Color:
#4f46e5to#7c3aed - Icon: Diamond/Gem
- Focus: Premium jewelry and luxury items
- Primary Color:
#059669to#047857 - Icon: Shopping bag
- Focus: Fashion and lifestyle products
- Primary Color:
#dc2626to#b91c1c - Icon: Laptop
- Focus: Electronics and digital products
- Real-time order monitoring
- Order status management
- User order filtering and search
- Order creation interface
- Statistics dashboard
- Responsive design for mobile/desktop
- Store switching buttons - Navigate between different store admin panels
- Breadcrumb navigation - Always know which store you're managing
- Theme consistency - Each store maintains its visual identity
The system includes an automated order status scheduler that:
- Progresses orders through realistic status transitions
- Updates orders every minute (configurable)
- Maintains proper status history
- Simulates real-world order processing
- Frontend automatically refreshes data every 10 seconds
- Real-time connection status indicator
- Automatic retry on connection failures
npm testGenerate sample data for testing:
# Single store demo
./demo.sh
# Multi-store demo
./demo-multistore.shnpm run dev
# Enables hot reload and detailed loggingOrders follow this status progression:
- pending - Order created, awaiting processing
- in_transit - Order shipped, in delivery
- store_pickup - Order ready for store pickup
- completed - Order successfully delivered/picked up
- cancelled - Order cancelled (can happen at any stage)
Create a .env file with the following variables:
# Server Configuration
PORT=3000
NODE_ENV=development
# Database
MONGODB_URI=mongodb://localhost:27017/multistore_orders
# Rate Limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100
# Order Processing
ORDER_STATUS_CHECK_INTERVAL=60000- Fork the repository
- Create a feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions:
- Create an issue on GitHub
- Check the API health endpoint:
http://localhost:3000/api/health - Review server logs for detailed error information
Built with β€οΈ by Tech-Titans-AI