A comprehensive, AI-powered logistics management system designed for public health emergency response, featuring real-time inventory tracking, payment processing, emergency communication, IoT monitoring, and intelligent demand forecasting.
- Full CRUD Operations: Create, Read, Update, Delete inventory items with comprehensive tracking
- Automated Expiry Alerts: System highlights items nearing expiry in yellow and expired items in red
- Digital Audit Trails: Complete accountability with detailed audit logs for all inventory operations
- Smart Filtering & Sorting: Advanced search and filter capabilities with pagination
- Role-based Access Control: Different permissions for different user roles
- Secure Payment Gateway Integration: Support for bKash, Nagad, Mastercard, VISA via Stripe
- Automatic Invoice Generation: Invoices created upon delivery verification
- Real-time Payment Tracking: Live status updates and transaction monitoring
- Comprehensive Payment History: Complete audit trail of all financial transactions
- Multi-currency Support: Support for BDT and other currencies
- Real-time Chat: WebSocket-based instant messaging for emergency situations
- Emergency Types: Pre-defined categories (Route Blocked, Vehicle Broken, Medical Emergency)
- Push Notifications: Instant alerts for emergency managers
- Message History: Complete conversation logs with timestamps
- File Attachments: Support for images and documents in emergency communications
- SEIR Model Integration: Epidemiological modeling for disease spread prediction
- Multi-Echelon Supply Chain (MESC): Advanced supply chain optimization
- Route Optimization: Google Maps API integration for optimal delivery routes
- Predictive Analytics: Machine learning models for demand forecasting
- Real-time Traffic Integration: Live traffic data for route optimization
- IoT Sensor Integration: Temperature, humidity, pressure, vibration monitoring
- GPS Tracking: Real-time location tracking of delivery vehicles
- Automated Alerts: Threshold-based alerts for environmental conditions
- Device Health Monitoring: Battery level, signal strength, and device status
- Historical Data Analysis: Sensor data history and trend analysis
- Comprehensive User Administration: Full CRUD operations for system users
- Role-based Access Control (RBAC): Granular permissions system
- Audit Logging: Complete activity tracking for all users
- Bulk Operations: Mass user management capabilities
- Password Management: Secure password reset and management
- Microservices Architecture: Modular, scalable system design
- API-First Approach: RESTful APIs for all system interactions
- Real-time Synchronization: Live data updates across all modules
- Comprehensive Reporting: Analytics and insights across all system components
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - NoSQL database
- Mongoose - MongoDB ODM
- Socket.io - Real-time communication
- JWT - Authentication
- bcryptjs - Password hashing
- Stripe - Payment processing
- Multer - File uploads
- React.js - Frontend framework
- Material-UI - UI component library
- Socket.io-client - Real-time client
- Google Maps API - Mapping and routing
- Chart.js - Data visualization
- Docker - Containerization
- MongoDB Atlas - Cloud database
- AWS S3 - File storage
- Redis - Caching and sessions
- Nginx - Reverse proxy
- Node.js (v16 or higher)
- MongoDB (v5 or higher)
- npm or yarn
- Git
git clone https://github.com/your-username/phels-system.git
cd phels-systemnpm installcp .env.example .envEdit the .env file with your configuration:
# Database
MONGODB_URI=mongodb://localhost:27017/phels
# JWT
JWT_SECRET=your-super-secret-jwt-key
# Payment Gateway
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key
# Google Maps
GOOGLE_MAPS_API_KEY=your_google_maps_api_key# Start MongoDB (if running locally)
mongod
# The system will automatically create collections on first run# Development mode
npm run dev
# Production mode
npm startThe server will start on http://localhost:5000
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/profile- Get user profilePUT /api/auth/profile- Update user profile
GET /api/inventory- Get all inventory itemsPOST /api/inventory- Create new inventory itemPUT /api/inventory/:id- Update inventory itemDELETE /api/inventory/:id- Delete inventory itemGET /api/inventory/alerts/expiry- Get expiry alerts
GET /api/payments- Get all paymentsPOST /api/payments/create-payment-intent- Create payment intentPOST /api/payments/process- Process paymentGET /api/payments/stats/overview- Payment statistics
GET /api/emergency- Get all emergenciesPOST /api/emergency- Create new emergencyPOST /api/emergency/:id/messages- Add message to emergencyPUT /api/emergency/:id/status- Update emergency status
GET /api/ai/forecasts- Get AI forecastsPOST /api/ai/forecasts- Create new forecastGET /api/ai/demand-forecast- Get demand forecastPOST /api/ai/route-optimization- Optimize delivery route
GET /api/iot/devices- Get all IoT devicesPOST /api/iot/devices- Create new IoT devicePOST /api/iot/devices/:id/sensor-data- Update sensor dataGET /api/iot/alerts/active- Get active alerts
GET /api/users- Get all users (Admin only)POST /api/users- Create new user (Admin only)PUT /api/users/:id- Update user (Admin only)DELETE /api/users/:id- Delete user (Admin only)
See .env.example for all available configuration options.
The system uses MongoDB with the following collections:
users- User accounts and authenticationinventory- Inventory items and trackingpayments- Payment transactionsemergencies- Emergency communicationsai_forecasts- AI predictions and forecastsiot_devices- IoT device data and sensorsorders- Order management and tracking
- JWT token expiration: 24 hours
- Password hashing rounds: 12
- Rate limiting: 100 requests per 15 minutes
- CORS enabled for specified origins
# Unit tests
npm test
# Integration tests
npm run test:integration
# E2E tests
npm run test:e2enpm run test:coverageGET /health- System health statusGET /metrics- System metrics (if Prometheus enabled)
- Application logs:
./logs/phels.log - Error tracking: Sentry integration
- Performance monitoring: Built-in metrics
# Build Docker image
docker build -t phels-system .
# Run container
docker run -p 5000:5000 --env-file .env phels-system- Set
NODE_ENV=production - Configure production database
- Set up SSL certificates
- Configure reverse proxy (Nginx)
- Set up monitoring and logging
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Email: support@phels.com
- Documentation: docs.phels.com
- Issues: GitHub Issues
- MongoDB for the database solution
- Stripe for payment processing
- Google Maps for routing and geolocation
- Socket.io for real-time communication
- The open-source community for various libraries and tools
- Mobile app for field workers
- Advanced analytics dashboard
- Machine learning model improvements
- Multi-language support
- Advanced reporting system
- Integration with government health systems
- Blockchain integration for supply chain transparency
- Advanced AI models for outbreak prediction
- Integration with weather APIs
- Advanced IoT sensor networks
- Predictive maintenance for vehicles and equipment
PHELS System - Empowering public health emergency response through intelligent logistics management.