Skip to content

MuhammadYacoub/egxpilot-simple

Repository files navigation

πŸ“ˆ EGXpilot - Professional Stock Market Analysis Platform

GitHub Docker Pulls Security Build Status

EGXpilot is a professional, enterprise-grade Egyptian Stock Market analysis platform delivering real-time technical analysis with advanced indicators, secure data processing, and modern web interface.

🌐 Live Demo: egxpilot.com | πŸ“š GitHub: ya3qoup/EGXpilot | 🐳 Docker: ya3qoup/egxpilot


πŸš€ Quick Start

Option 1: Docker Hub (Production Ready)

# Pull and run latest version
docker pull ya3qoup/egxpilot:latest
docker run -d --name egxpilot -p 4040:4040 --env-file .env ya3qoup/egxpilot:latest

# Access at http://localhost:4040

Option 2: One-Command Deployment

# Clone and deploy
git clone https://github.com/ya3qoup/EGXpilot.git && cd EGXpilot
./deploy.sh setup    # Environment setup
./deploy.sh start    # Start application

# Access at http://localhost:4040

Option 3: Docker Compose

git clone https://github.com/ya3qoup/EGXpilot.git && cd EGXpilot
cp .env.example .env  # Edit with your credentials
docker-compose up -d

🌟 Features

πŸ“Š Advanced Technical Analysis

  • Real-time EGX Data: Live Egyptian stock market data via Yahoo Finance
  • Technical Indicators: EMA(20/50), RSI, MACD, Bollinger Bands, Volume analysis
  • Pattern Recognition: Candlestick patterns and trend analysis
  • Historical Analysis: Comprehensive price history with data visualization
  • Smart Watchlist: Add/remove stocks with automatic analysis

πŸ”’ Enterprise Security

  • SQL Injection Protection: Parameterized queries throughout
  • Rate Limiting: API abuse prevention (100 requests/min per IP)
  • Security Headers: OWASP-compliant security implementation
  • Input Validation: Comprehensive data sanitization
  • Container Security: Non-root Docker containers with hardened configuration

πŸš€ Production Infrastructure

  • Multi-stage Docker: Optimized production images (< 100MB)
  • Health Monitoring: Built-in health checks and API monitoring
  • Auto-scaling Ready: Kubernetes and Docker Swarm compatible
  • Zero-downtime Updates: Rolling deployment support
  • Professional Logging: Structured JSON logging with error tracking

🎯 Developer Experience

  • Modern API: RESTful endpoints with clear documentation
  • Responsive UI: Mobile-friendly web interface
  • Hot Reload: Frontend updates without container restart
  • One-Script Deploy: Complete deployment automation
  • Development Tools: Linting, formatting, security scanning

πŸ“‘ API Endpoints

Core APIs

# Health and status
GET  /health                     # Application health check
GET  /api/stocks                 # Available stocks list

# Stock analysis
GET  /api/analyze/{SYMBOL}.CA    # Real-time technical analysis
POST /api/watchlist/add          # Add stock to watchlist
POST /api/watchlist/check        # Check if stock exists

# Example usage
curl http://localhost:4040/health
curl http://localhost:4040/api/analyze/EGTS.CA
curl http://localhost:4040/api/stocks

Response Format

{
  "symbol": "EGTS.CA",
  "analysis": {
    "trend": "bullish",
    "rsi": 65.4,
    "ema20": 12.45,
    "ema50": 11.80,
    "recommendation": "buy"
  },
  "timestamp": "2025-06-28T12:00:00Z"
}

πŸ› οΈ Management Script

EGXpilot includes a comprehensive management script for all operations:

Available Commands

# πŸš€ DEPLOYMENT
./deploy.sh start               # Start application (production-ready)
./deploy.sh stop                # Stop application and cleanup
./deploy.sh update              # Update frontend (hot reload)
./deploy.sh restart             # Restart with latest changes

# πŸ”§ MANAGEMENT  
./deploy.sh setup               # Initial environment setup
./deploy.sh health              # Check application health
./deploy.sh status              # Show detailed status
./deploy.sh logs                # View application logs
./deploy.sh clean               # Clean Docker resources

# πŸ“¦ DEVELOPMENT
./deploy.sh dev                 # Start development mode
./deploy.sh test                # Run tests and validation
./deploy.sh security            # Security audit

# 🐳 DOCKER HUB
./deploy.sh build               # Build Docker image
./deploy.sh publish             # Publish to Docker Hub
./deploy.sh release             # Complete release process

Script Features

  • βœ… Environment Validation: Automatic setup and security checks
  • βœ… Hot Updates: Frontend changes without downtime
  • βœ… Health Monitoring: Built-in application health validation
  • βœ… Security Scanning: Credential detection and vulnerability checks
  • βœ… Docker Integration: Seamless Docker Hub publishing
  • βœ… Error Handling: Comprehensive error management and recovery

βš™οΈ Configuration

Environment Setup

# 1. Copy environment template
cp .env.example .env

# 2. Configure your database (REQUIRED)
DB_SERVER=your_database_server
DB_NAME=trade
DB_USER=your_username
DB_PASSWORD=your_secure_password
DB_PORT=1433

# 3. Application settings
NODE_ENV=production
PORT=4040

Database Requirements

  • Microsoft SQL Server 2019+
  • Tables: Watchlist, PriceHistory
  • Permissions: SELECT, INSERT, UPDATE (no admin required)
  • Connection: TLS/SSL recommended for production

System Requirements

  • Memory: 512MB minimum, 2GB recommended
  • Storage: 10GB for historical data
  • Network: HTTPS/SSL for production deployment
  • Docker: 20.10+ with Docker Compose

πŸ”’ Security

Security Features

  • βœ… Parameterized Queries: Complete SQL injection protection
  • βœ… Rate Limiting: API abuse prevention and DDoS protection
  • βœ… Security Headers: OWASP Top 10 compliance
  • βœ… Input Validation: All user inputs sanitized and validated
  • βœ… Container Security: Non-root user, minimal attack surface
  • βœ… Secrets Management: Environment-based configuration only

Security Best Practices

# 1. Use strong database credentials
DB_PASSWORD=generate_strong_password_32_chars_minimum

# 2. Enable SSL/TLS in production
NODE_ENV=production

# 3. Run security audit
./deploy.sh security

# 4. Regular updates
./deploy.sh update

Production Security Checklist

  • Strong database passwords (32+ characters)
  • SSL/TLS certificates configured
  • Firewall rules (only ports 443, 4040)
  • Regular security updates
  • Backup strategy implemented
  • Monitoring and alerting configured

πŸ—οΈ Architecture

Technology Stack

  • Backend: Node.js 18+, Express.js, Microsoft SQL Server
  • Frontend: Vanilla JavaScript, Modern CSS, Responsive Design
  • APIs: Yahoo Finance 2.0, Technical Indicators Library
  • Container: Docker Multi-stage, Alpine Linux base
  • Security: OWASP standards, Rate limiting, Input validation

Performance Metrics

  • API Response: < 200ms average
  • Database Queries: < 50ms average
  • Memory Usage: < 512MB typical
  • Container Size: < 100MB production image
  • Uptime: 99.9% target with health monitoring

Scalability

  • Horizontal: Load balancer ready
  • Vertical: Auto-scaling support
  • Database: Connection pooling optimized
  • Cache: Strategic caching for performance
  • CDN: Static asset optimization

πŸ“ˆ Development

Local Development

# Clone and setup
git clone https://github.com/ya3qoup/EGXpilot.git
cd EGXpilot

# Environment setup
./deploy.sh setup

# Start development
./deploy.sh dev                 # Hot reload development
# OR
npm run dev                     # Direct Node.js development

Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Test changes: ./deploy.sh test
  5. Push to branch: git push origin feature/amazing-feature
  6. Open Pull Request

Code Standards

  • ESLint: Enforced code quality
  • Prettier: Consistent formatting
  • Security: OWASP guidelines compliance
  • Testing: Automated validation
  • Documentation: JSDoc for all functions

🐳 Docker Hub

Available Tags

# Latest stable release
docker pull ya3qoup/egxpilot:latest

# Specific versions  
docker pull ya3qoup/egxpilot:2.0.0
docker pull ya3qoup/egxpilot:v2

# Development builds
docker pull ya3qoup/egxpilot:dev

Docker Features

  • Multi-platform: AMD64, ARM64 support
  • Security: Non-root user, minimal base image
  • Health Checks: Built-in container monitoring
  • Efficiency: < 100MB production images
  • Standards: OCI compliant, best practices

Docker Usage

# Production deployment
docker run -d \
  --name egxpilot \
  --restart always \
  -p 4040:4040 \
  --env-file .env \
  ya3qoup/egxpilot:latest

# Docker Compose (recommended)
curl -o docker-compose.yml https://raw.githubusercontent.com/ya3qoup/EGXpilot/main/docker-compose.yml
docker-compose up -d

πŸ“Š Performance & Monitoring

Health Monitoring

# Application health
curl http://localhost:4040/health

# Detailed status
./deploy.sh status

# Real-time logs
./deploy.sh logs

Performance Optimization

  • Database Indexing: Optimized query performance
  • Connection Pooling: Efficient database connections
  • Caching Strategy: Redis integration ready
  • Asset Compression: Gzip compression enabled
  • Resource Monitoring: Built-in metrics collection

Production Monitoring

  • Health Endpoints: /health for load balancers
  • Metrics Collection: Prometheus compatible
  • Log Aggregation: JSON structured logging
  • Error Tracking: Comprehensive error reporting
  • Uptime Monitoring: External health checks supported

🎯 Roadmap

Version 2.1 (Q3 2025)

  • Real-time WebSocket data feeds
  • Advanced charting with TradingView
  • Portfolio management features
  • Mobile application (React Native)

Version 2.2 (Q4 2025)

  • Machine learning price predictions
  • Advanced analytics dashboard
  • Multi-exchange support (Saudi, Dubai)
  • Enterprise SSO integration

Future Versions

  • Kubernetes deployment charts
  • GraphQL API
  • Multi-language support (Arabic, English)
  • Advanced AI trading signals

πŸ“ž Support & Community

Professional Support

Community Support

Resources


πŸ“„ License

MIT License - This project is commercial-friendly and open source.

Commercial Use Permitted

  • βœ… Commercial use
  • βœ… Modification and distribution
  • βœ… Private use
  • βœ… Patent use

Author

Muhammad Yacoub


⭐ Star this repository if it helped you!

πŸš€ Deploy Now | πŸ“– GitHub | πŸ› Issues | πŸ’¬ Discussions


Built with ❀️ for the Egyptian Stock Market Community

Professional β€’ Secure β€’ Open Source

Releases

No releases published

Packages

No packages published