Skip to content

abdullahfeb/1st-Simple-Project

Repository files navigation

PHELS - Public Health Emergency Logistics System

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.

πŸš€ Features

A. Advanced Inventory Management (Enhanced CRUD)

  • 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

B. Integrated Payment Management System

  • 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

C. Live Emergency Communication Chat System

  • 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

D. AI-Powered Demand Forecasting & Smart Routing

  • 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

E. Real-Time IoT Monitoring & GPS Tracking

  • 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

F. User Management System (For Admin)

  • 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

G. Integrated System Workflow

  • 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

πŸ› οΈ Technology Stack

Backend

  • 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

Frontend (Client-side)

  • 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

DevOps & Infrastructure

  • Docker - Containerization
  • MongoDB Atlas - Cloud database
  • AWS S3 - File storage
  • Redis - Caching and sessions
  • Nginx - Reverse proxy

πŸ“‹ Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (v5 or higher)
  • npm or yarn
  • Git

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/your-username/phels-system.git
cd phels-system

2. Install Dependencies

npm install

3. Environment Configuration

cp .env.example .env

Edit 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

4. Database Setup

# Start MongoDB (if running locally)
mongod

# The system will automatically create collections on first run

5. Start the Application

# Development mode
npm run dev

# Production mode
npm start

The server will start on http://localhost:5000

πŸ“š API Documentation

Authentication Endpoints

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • GET /api/auth/profile - Get user profile
  • PUT /api/auth/profile - Update user profile

Inventory Management

  • GET /api/inventory - Get all inventory items
  • POST /api/inventory - Create new inventory item
  • PUT /api/inventory/:id - Update inventory item
  • DELETE /api/inventory/:id - Delete inventory item
  • GET /api/inventory/alerts/expiry - Get expiry alerts

Payment Management

  • GET /api/payments - Get all payments
  • POST /api/payments/create-payment-intent - Create payment intent
  • POST /api/payments/process - Process payment
  • GET /api/payments/stats/overview - Payment statistics

Emergency Communication

  • GET /api/emergency - Get all emergencies
  • POST /api/emergency - Create new emergency
  • POST /api/emergency/:id/messages - Add message to emergency
  • PUT /api/emergency/:id/status - Update emergency status

AI & Forecasting

  • GET /api/ai/forecasts - Get AI forecasts
  • POST /api/ai/forecasts - Create new forecast
  • GET /api/ai/demand-forecast - Get demand forecast
  • POST /api/ai/route-optimization - Optimize delivery route

IoT Monitoring

  • GET /api/iot/devices - Get all IoT devices
  • POST /api/iot/devices - Create new IoT device
  • POST /api/iot/devices/:id/sensor-data - Update sensor data
  • GET /api/iot/alerts/active - Get active alerts

User Management

  • 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)

πŸ”§ Configuration

Environment Variables

See .env.example for all available configuration options.

Database Configuration

The system uses MongoDB with the following collections:

  • users - User accounts and authentication
  • inventory - Inventory items and tracking
  • payments - Payment transactions
  • emergencies - Emergency communications
  • ai_forecasts - AI predictions and forecasts
  • iot_devices - IoT device data and sensors
  • orders - Order management and tracking

Security Configuration

  • JWT token expiration: 24 hours
  • Password hashing rounds: 12
  • Rate limiting: 100 requests per 15 minutes
  • CORS enabled for specified origins

πŸ§ͺ Testing

Run Tests

# Unit tests
npm test

# Integration tests
npm run test:integration

# E2E tests
npm run test:e2e

Test Coverage

npm run test:coverage

πŸ“Š Monitoring & Analytics

Health Checks

  • GET /health - System health status
  • GET /metrics - System metrics (if Prometheus enabled)

Logging

  • Application logs: ./logs/phels.log
  • Error tracking: Sentry integration
  • Performance monitoring: Built-in metrics

πŸš€ Deployment

Docker Deployment

# Build Docker image
docker build -t phels-system .

# Run container
docker run -p 5000:5000 --env-file .env phels-system

Production Deployment

  1. Set NODE_ENV=production
  2. Configure production database
  3. Set up SSL certificates
  4. Configure reverse proxy (Nginx)
  5. Set up monitoring and logging

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

For support and questions:

πŸ™ Acknowledgments

  • 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

πŸ“ˆ Roadmap

Phase 2 Features

  • Mobile app for field workers
  • Advanced analytics dashboard
  • Machine learning model improvements
  • Multi-language support
  • Advanced reporting system
  • Integration with government health systems

Phase 3 Features

  • 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors