Macos Deployment Guide

๐ŸŽ Enhanced InsideOut Platform - macOS Deployment Guide

๐Ÿ“‹ OVERVIEW

This comprehensive guide provides step-by-step instructions for deploying the Enhanced InsideOut Platform on macOS systems. The platform is specifically designed for Indian law enforcement with complete legal framework compliance, multilingual support, and global platform integration.


๐ŸŽฏ QUICK START (Automated Deployment)

One-Command Installation:

curl -fsSL https://raw.githubusercontent.com/bot-text/SentinentalBERT/main/setup_insideout_macos.sh | bash

Manual Download and Run:

# Download the deployment script
curl -O https://raw.githubusercontent.com/bot-text/SentinentalBERT/main/setup_insideout_macos.sh

# Make it executable
chmod +x setup_insideout_macos.sh

# Run the deployment
./setup_insideout_macos.sh

๐Ÿ”ง SYSTEM REQUIREMENTS

Minimum Requirements:

  • macOS: 10.15 (Catalina) or later
  • RAM: 8GB (16GB recommended)
  • Storage: 5GB free space
  • Architecture: Intel x86_64 or Apple Silicon (M1/M2)
  • Internet: Stable broadband connection
  • macOS: 12.0 (Monterey) or later
  • RAM: 16GB or more
  • Storage: 10GB free space
  • Processor: Multi-core (4+ cores recommended)

๐Ÿ“ฆ WHAT GETS INSTALLED

Development Tools:

  • โœ… Xcode Command Line Tools - Essential development utilities
  • โœ… Homebrew - Package manager for macOS
  • โœ… Git - Version control system
  • โœ… Essential CLI Tools - curl, wget, jq, tree, htop

Programming Languages:

  • โœ… Python 3.11 - Core platform language
  • โœ… Node.js 18 - JavaScript runtime for web components
  • โœ… pip & npm - Package managers

Containerization:

  • โœ… Docker Desktop - Container platform
  • โœ… Docker Compose - Multi-container orchestration

Databases:

  • โœ… PostgreSQL 14 - Primary database
  • โœ… Redis - Caching and session storage

Python Libraries:

  • โœ… Streamlit - Web dashboard framework
  • โœ… Pandas, NumPy - Data processing
  • โœ… Matplotlib, Seaborn, Plotly - Visualization
  • โœ… Scikit-learn - Machine learning
  • โœ… Transformers, PyTorch - NLP and AI models
  • โœ… NLTK, spaCy - Natural language processing
  • โœ… Indic-NLP - Indian language processing
  • โœ… Requests, BeautifulSoup - Web scraping
  • โœ… Cryptography - Security and encryption
  • โœ… FastAPI, Flask - API frameworks

๐Ÿš€ DEPLOYMENT PROCESS

Phase 1: System Preparation

  1. System Requirements Check
  2. Verifies macOS version compatibility
  3. Checks available disk space (5GB minimum)
  4. Validates system architecture (Intel/Apple Silicon)
  5. Tests internet connectivity

  6. Development Tools Installation

  7. Installs Xcode Command Line Tools
  8. Sets up Homebrew package manager
  9. Installs essential CLI utilities

Phase 2: Runtime Environment Setup

  1. Python Environment
  2. Installs Python 3.11 via Homebrew
  3. Creates virtual environment
  4. Installs all required Python packages
  5. Downloads NLTK data and spaCy models

  6. Node.js Environment

  7. Installs Node.js 18 and npm
  8. Installs global packages (yarn, pm2, nodemon)

  9. Docker Installation

  10. Downloads and installs Docker Desktop
  11. Configures Docker for the platform
  12. Installs Docker Compose

Phase 3: Database Setup

  1. Database Services
  2. Installs and configures PostgreSQL 14
  3. Installs and configures Redis
  4. Creates InsideOut database
  5. Starts database services

Phase 4: Platform Deployment

  1. Repository Setup
  2. Clones Enhanced InsideOut Platform repository
  3. Sets up project structure
  4. Configures environment variables

  5. Configuration

  6. Creates .env configuration file
  7. Sets up logging directories
  8. Configures security settings
  9. Prepares evidence storage

Phase 5: Testing & Validation

  1. Integration Testing
  2. Runs comprehensive test suite
  3. Validates all components
  4. Verifies legal framework compliance
  5. Tests multilingual support

  6. Final Setup

    • Creates desktop shortcuts
    • Generates launch scripts
    • Provides access instructions

๐Ÿ”ง MANUAL INSTALLATION STEPS

If you prefer manual installation or need to troubleshoot:

Step 1: Install Xcode Command Line Tools

xcode-select --install

Step 2: Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 3: Install Python and Dependencies

# Install Python
brew install python@3.11

# Create project directory
mkdir -p ~/InsideOut-Platform
cd ~/InsideOut-Platform

# Clone repository
git clone https://github.com/bot-text/SentinentalBERT.git .

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install Python dependencies
pip install -r requirements.txt  # If requirements.txt exists
# Or install manually:
pip install streamlit pandas numpy matplotlib seaborn plotly
pip install scikit-learn transformers torch
pip install nltk spacy textblob langdetect indic-nlp-library
pip install requests beautifulsoup4 selenium
pip install cryptography sqlalchemy redis fastapi

Step 4: Install Node.js

brew install node@18
npm install -g yarn pm2 nodemon

Step 5: Install Docker Desktop

# Download Docker Desktop from https://www.docker.com/products/docker-desktop/
# Or use Homebrew cask:
brew install --cask docker

Step 6: Install Databases

# Install PostgreSQL
brew install postgresql@14
brew services start postgresql@14
createdb insideout_db

# Install Redis
brew install redis
brew services start redis

Step 7: Configure Environment

# Create .env file with your configuration
cp .env.example .env  # If example exists
# Edit .env with your API keys and settings

Step 8: Run Tests

cd ~/InsideOut-Platform
source venv/bin/activate
python test_enhanced_integration.py

Step 9: Start Platform

streamlit run enhanced_viral_dashboard.py --server.port 8080

๐Ÿ”‘ CONFIGURATION

Environment Variables (.env file):

# Application Settings
APP_NAME=InsideOut
APP_VERSION=2.0
DEBUG=true

# Server Configuration
HOST=0.0.0.0
PORT=8080

# Database URLs
DATABASE_URL=postgresql://localhost:5432/insideout_db
REDIS_URL=redis://localhost:6379

# Security Keys (auto-generated)
SECRET_KEY=your_secret_key
JWT_SECRET=your_jwt_secret
ENCRYPTION_KEY=your_encryption_key

# Legal Framework
LEGAL_FRAMEWORK_ENABLED=true
EVIDENCE_STORAGE_PATH=./evidence_storage
CHAIN_OF_CUSTODY_ENABLED=true

# Multilingual Support
DEFAULT_LANGUAGE=en
SUPPORTED_LANGUAGES=en,hi,bn,ta,te
UI_TRANSLATION_ENABLED=true

# Platform API Keys (Add your keys)
TWITTER_API_KEY=your_twitter_api_key
TWITTER_API_SECRET=your_twitter_api_secret
FACEBOOK_ACCESS_TOKEN=your_facebook_token
INSTAGRAM_ACCESS_TOKEN=your_instagram_token
YOUTUBE_API_KEY=your_youtube_api_key
KOO_API_KEY=your_koo_api_key
SHARECHAT_API_KEY=your_sharechat_api_key

API Keys Setup:

  1. Twitter/X API: https://developer.twitter.com/
  2. Facebook API: https://developers.facebook.com/
  3. Instagram API: https://developers.facebook.com/docs/instagram
  4. YouTube API: https://developers.google.com/youtube/
  5. Koo API: Contact Koo developer support
  6. ShareChat API: Contact ShareChat developer support

๐Ÿš€ STARTING THE PLATFORM

Method 1: Desktop Shortcut

  • Double-click "InsideOut Platform" app on Desktop
  • Platform will open in Terminal and browser

Method 2: Command Line

cd ~/InsideOut-Platform
source venv/bin/activate
streamlit run enhanced_viral_dashboard.py --server.port 8080

Method 3: Launch Script

~/InsideOut-Platform/launch_insideout.sh

Access URLs:

  • Main Dashboard: http://localhost:8080
  • API Documentation: http://localhost:8080/docs (if FastAPI is running)

๐Ÿงช TESTING

Run All Tests:

cd ~/InsideOut-Platform
source venv/bin/activate
python test_enhanced_integration.py

Test Components:

  • โœ… Legal Framework Test - Authorization, evidence collection, chain of custody
  • โœ… Multilingual Support Test - Language detection, UI translation
  • โœ… Global Platform Test - Content extraction, viral analysis
  • โœ… Integration Test - End-to-end workflow validation

Expected Results:

๐Ÿš€ Starting Enhanced InsideOut Platform Integration Tests
======================================================================
๐Ÿ” Testing Indian Legal Framework...
โœ… Legal authorization created
โœ… Evidence collected
โœ… Evidence integrity verified
โœ… Chain of custody entry added
โœ… Court report generated

๐ŸŒ Testing Enhanced Multilingual Support...
โœ… Language detection successful: hi, bn, ta, te, en
โœ… UI translations available for all languages
โœ… Multilingual analysis successful

๐ŸŒ Testing Global Platform Support...
โœ… Platform support comprehensive: 7 platforms supported
โœ… Content extraction successful for all platforms
โœ… Platform features well supported

๐Ÿ”— Testing Component Integration...
โœ… All services initialized successfully
โœ… Integration test: Cross-platform analysis successful

======================================================================
๐Ÿ“Š TEST RESULTS SUMMARY
======================================================================
Legal Framework                โœ… PASSED
Multilingual Support           โœ… PASSED
Global Platform Support        โœ… PASSED
Integration                    โœ… PASSED
----------------------------------------------------------------------
Overall Success Rate: 4/4 (100.0%)

๐ŸŽ‰ ALL TESTS PASSED! Enhanced InsideOut Platform is ready for deployment.

๐Ÿ”ง TROUBLESHOOTING

Common Issues and Solutions:

1. Xcode Command Line Tools Installation Fails

# Try manual installation
sudo xcode-select --reset
xcode-select --install

2. Homebrew Installation Issues

# For Apple Silicon Macs, ensure correct PATH
echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

3. Python Virtual Environment Issues

# Recreate virtual environment
rm -rf venv
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip

4. Docker Desktop Not Starting

  • Ensure Docker Desktop is installed in /Applications/
  • Start Docker Desktop manually from Applications folder
  • Wait for Docker to fully initialize before continuing

5. Database Connection Issues

# Restart PostgreSQL
brew services restart postgresql@14

# Restart Redis
brew services restart redis

# Check if services are running
brew services list | grep -E "(postgresql|redis)"

6. Port Already in Use

# Find process using port 8080
lsof -i :8080

# Kill process if needed
kill -9 <PID>

# Or use different port
streamlit run enhanced_viral_dashboard.py --server.port 8081

7. Permission Issues

# Fix permissions for project directory
chmod -R 755 ~/InsideOut-Platform
chown -R $(whoami) ~/InsideOut-Platform

8. Missing Dependencies

# Reinstall Python dependencies
cd ~/InsideOut-Platform
source venv/bin/activate
pip install --upgrade --force-reinstall -r requirements.txt

๐Ÿ“Š PERFORMANCE OPTIMIZATION

System Optimization:

  1. Memory Management
  2. Close unnecessary applications
  3. Monitor memory usage with Activity Monitor
  4. Consider increasing swap space if needed

  5. Database Performance

  6. Regularly vacuum PostgreSQL database
  7. Monitor Redis memory usage
  8. Configure appropriate cache sizes

  9. Network Optimization

  10. Use stable internet connection
  11. Configure firewall to allow required ports
  12. Monitor API rate limits

Platform Optimization:

# Set environment variables for better performance
export STREAMLIT_SERVER_MAX_UPLOAD_SIZE=200
export STREAMLIT_SERVER_MAX_MESSAGE_SIZE=200
export PYTHONUNBUFFERED=1

๐Ÿ”’ SECURITY CONSIDERATIONS

Security Best Practices:

  1. API Keys Management
  2. Store API keys in .env file (never commit to git)
  3. Use environment-specific keys
  4. Regularly rotate API keys

  5. Database Security

  6. Use strong passwords for database connections
  7. Enable SSL for database connections in production
  8. Regular database backups

  9. Evidence Security

  10. Enable encryption for evidence storage
  11. Implement proper access controls
  12. Maintain audit logs

  13. Network Security

  14. Use HTTPS in production
  15. Configure proper firewall rules
  16. Monitor for suspicious activities

๐Ÿ“š ADDITIONAL RESOURCES

Documentation:

  • Platform Summary: ~/InsideOut-Platform/ENHANCED_PLATFORM_SUMMARY.md
  • Change Catalog: ~/InsideOut-Platform/CHANGE_CATALOG.md
  • API Documentation: Available in code comments
  • Legal Framework Guide: Integrated in platform

Support Files:

  • Deployment Log: ~/InsideOut-Platform/deployment.log
  • Test Reports: ~/InsideOut-Platform/enhanced_integration_test_report.json
  • Environment Config: ~/InsideOut-Platform/.env

External Resources:

  • GitHub Repository: https://github.com/bot-text/SentinentalBERT
  • Streamlit Documentation: https://docs.streamlit.io/
  • Python Documentation: https://docs.python.org/3.11/
  • Docker Documentation: https://docs.docker.com/

๐Ÿ†˜ SUPPORT

Getting Help:

  1. Check Logs: Review deployment.log for error details
  2. Run Tests: Execute test suite to identify issues
  3. Documentation: Refer to platform documentation
  4. Community: Check GitHub issues and discussions

Reporting Issues:

  1. Gather Information:
  2. macOS version and architecture
  3. Error messages and logs
  4. Steps to reproduce the issue

  5. Create Issue:

  6. Use GitHub issue tracker
  7. Provide detailed description
  8. Include relevant logs and screenshots

๐ŸŽ‰ SUCCESS INDICATORS

Deployment Success:

  • โœ… All system requirements met
  • โœ… All dependencies installed successfully
  • โœ… Database services running
  • โœ… All tests passing (100% success rate)
  • โœ… Dashboard accessible at http://localhost:8080
  • โœ… All features operational

Platform Ready:

  • โœ… Legal framework compliance active
  • โœ… Multilingual UI functional
  • โœ… Global platform support operational
  • โœ… Evidence collection system ready
  • โœ… Cross-platform analysis working
  • โœ… Real-time monitoring active

๐Ÿš€ NEXT STEPS

After successful deployment:

  1. Configure API Keys
  2. Add your social media platform API credentials
  3. Test platform connections

  4. Legal Setup

  5. Configure legal authorization settings
  6. Set up evidence storage policies
  7. Train officers on legal compliance features

  8. Operational Deployment

  9. Set up monitoring and alerting
  10. Configure backup procedures
  11. Establish maintenance schedules

  12. Training

  13. Train law enforcement officers
  14. Provide user manuals and guides
  15. Set up support procedures

This deployment guide ensures a complete, secure, and legally compliant installation of the Enhanced InsideOut Platform on macOS systems, specifically designed for Indian law enforcement operations.