Skip to content

profparadox3/FEAS

Β 
Β 

Repository files navigation

πŸ•΅οΈβ€β™‚οΈ Forensic Evidence Acquisition System (FEAS)

License Python React FastAPI

Investigator-grade digital forensics platform for acquiring, preserving, and analyzing web and local evidence with an immutable chain of custody.


πŸ“– Overview

The Forensic Evidence Acquisition System (FEAS) is a secure, full-stack solution designed for law enforcement and digital forensic investigators. It automates the acquisition of evidence from social media URLs and local files, ensuring strict integrity through SHA-256 hashing and automated PDF reporting.

Unlike standard downloaders, FEAS maintains a legally admissible Chain of Custody log for every action taken on a piece of evidence, from the moment of acquisition to final storage.

✨ Key Features

  • πŸ” Secure User Authentication
    • NEW: Automatic database initialization on first run
    • NEW: Default admin user created from environment variables
    • NEW: Bcrypt password hashing for maximum security
    • JWT token-based authentication with configurable expiration
    • User registration and login system
    • User profile management with editable information
    • Role-based access control (Admin vs Analyst roles)
    • πŸ“š See AUTHENTICATION_GUIDE.md for details
  • 🌐 Universal Acquisition
    • Capture videos and metadata from Twitter (X), YouTube, and direct URLs.
    • Secure Local File Upload for existing evidence.
  • πŸ”’ Evidence Integrity
    • Automated SHA-256 Hashing upon acquisition.
    • Verify Integrity tools to detect file tampering.
  • ⛓️ Chain of Custody
    • Immutable, append-only logs for every event (Acquisition, Hashing, Storage, Access, Verification).
    • Full audit trail exportable in reports.
    • Stored in both database (PostgreSQL) and file-based log.
  • πŸ“Š Deep Metadata Extraction
    • Extracts EXIF data, video codecs, bitrates, duration, resolution, and platform-specific metadata.
    • Uses ffmpeg for video analysis and exifread for image metadata.
    • MIME type detection via python-magic.
  • πŸ“Š Real-time Analytics Dashboard
    • Live statistics and metrics for all forensic operations.
    • Period-based analytics (24h, 7d, 30d, 90d).
    • Success/failure rate tracking and performance metrics.
  • πŸ“„ Automated Reporting
    • Generates professional PDF Forensic Reports containing all case details, hashes, and custody logs.
  • ⚑ Real-time Monitoring
    • Live job tracking with React Query polling.
    • Background processing with Celery Worker and Celery Beat scheduler.
    • Progress tracking through multiple stages (pending, downloading, processing, hashing, extracting metadata, generating report, completed).

🎯 Supported Platforms & File Types

URL Acquisition (Social Media)

  • Twitter (X) - twitter.com, x.com
  • YouTube - youtube.com, youtu.be

Local File Upload

Supported file types:

  • Images: JPEG (.jpg, .jpeg), PNG (.png), HEIC/HEIF (.heic, .heif)
  • Videos: MP4 (.mp4), QuickTime (.mov), AVI (.avi)
  • Audio: MP3 (.mp3), WAV (.wav)
  • Documents: PDF, text files, and archives (ZIP)

Maximum file size: 500 MB (configurable via MAX_FILE_SIZE)


πŸ› οΈ Tech Stack

Backend

  • 🐍 Python 3.11 & FastAPI 0.115 - High-performance async API framework.
  • πŸ—„οΈ PostgreSQL 15 & SQLAlchemy 2.0 - Robust relational database with ORM.
  • ⚑ Celery 5.3 & Redis 7 - Distributed task queue with Celery Beat scheduler.
  • πŸ•΅οΈ Forensic Tools:
    • yt-dlp - Video download from social platforms
    • ffmpeg - Media processing and metadata extraction
    • exifread - EXIF data extraction
    • python-magic - File type detection
  • πŸ“„ ReportLab - Dynamic PDF forensic report generation.
  • 🎭 Playwright - Web scraping and browser automation.
  • πŸ” Pydantic 2.9 - Data validation and settings management.
  • πŸ”‘ python-jose & passlib - JWT tokens and password hashing.

Frontend

  • βš›οΈ React 18.2 - Modern UI library with hooks.
  • πŸ’… Styled Components 6.1 - Component-based theming (Cyber/Dark/Light themes).
  • πŸ“‘ React Query 3.39 & Axios 1.6 - Efficient data fetching and caching.
  • 🎨 React Icons 4.12 - Visual indicators for file types and status.
  • 🎭 Framer Motion 10.16 - Smooth animations.
  • πŸ“€ React Dropzone 14.2 - Drag-and-drop file uploads.
  • πŸ”” React Toastify 10.0 - User notifications.
  • 🎯 Zustand 4.4 - Lightweight state management.

DevOps

  • 🐳 Docker & Docker Compose - Multi-container orchestration.
  • πŸ“¦ PostgreSQL, Redis, Backend, Frontend, Celery Worker, Celery Beat - 6 containerized services.

πŸš€ Getting Started

Prerequisites

  • Docker & Docker Compose (Recommended)
  • OR Python 3.11+ and Node.js 18+ (for manual setup)

Quick Start Guide

πŸ“š For detailed setup instructions, see QUICKSTART.md

Option 1: Quick Start (Docker) 🐳

  1. Clone the repository

    git clone https://github.com/Dynamo2k/FEAS.git
    cd FEAS
  2. Configure Environment

    cd backend
    cp .env.example .env
    # Edit .env and change default admin credentials!
    # DEFAULT_ADMIN_EMAIL=admin@feas.local
    # DEFAULT_ADMIN_PASSWORD=change-this-password
  3. Launch All Services

    # From the backend directory
    docker-compose up --build -d

    This starts 6 services:

    • PostgreSQL (port 5432) - Database
    • Redis (port 6379) - Message broker
    • Backend API (port 8000) - FastAPI server
    • Frontend (port 3000) - React application
    • Celery Worker - Background task processor
    • Celery Beat - Scheduled task scheduler
  4. Access the Application

    • Frontend Dashboard: http://localhost:3000
    • API Documentation: http://localhost:8000/docs
    • API Health Check: http://localhost:8000/health
  5. Login with Default Admin

    • Email: admin@feas.local (or your configured email)
    • Password: admin123 (or your configured password)
    • ⚠️ Change the password immediately after first login!

Option 2: Manual Installation πŸ› οΈ

Backend Setup

cd backend
python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install -r requirements.txt

# Create .env file
cp .env.example .env
# Edit .env with your configuration

# For quick testing with SQLite:
export USE_SQLITE=true  # or set USE_SQLITE=true in .env

# Install system dependencies (Linux/Mac)
# ffmpeg, libmagic1 are required
sudo apt-get install ffmpeg libmagic1  # Ubuntu/Debian
# brew install ffmpeg libmagic  # macOS

# Start the backend (database tables created automatically on first run)
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

# In separate terminals, start Celery:
celery -A app.workers.celery_app.celery worker --loglevel=info
celery -A app.workers.celery_app.celery beat --loglevel=info

πŸ“š For PostgreSQL setup, see POSTGRESQL_SETUP.md

Frontend Setup

cd frontend
npm install
npm start

The React app will open at http://localhost:3000.


πŸ“ Project Structure

FEAS/
β”œβ”€β”€ backend/                    # FastAPI Backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/v1/endpoints/  # REST API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ jobs.py        # Job submission & monitoring
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.py        # Authentication (login/register)
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard.py   # Analytics & statistics
β”‚   β”‚   β”‚   β”œβ”€β”€ profile.py     # User profile management
β”‚   β”‚   β”‚   β”œβ”€β”€ social.py      # Social media links
β”‚   β”‚   β”‚   β”œβ”€β”€ links.py       # Link management
β”‚   β”‚   β”‚   └── health.py      # Health check endpoint
β”‚   β”‚   β”œβ”€β”€ core/              # Core utilities
β”‚   β”‚   β”‚   β”œβ”€β”€ config.py      # Pydantic settings
β”‚   β”‚   β”‚   β”œβ”€β”€ logger.py      # Forensic logging
β”‚   β”‚   β”‚   └── security.py    # Authentication & authorization
β”‚   β”‚   β”œβ”€β”€ db/                # Database
β”‚   β”‚   β”‚   β”œβ”€β”€ base.py        # SQLAlchemy base
β”‚   β”‚   β”‚   └── session.py     # DB session management
β”‚   β”‚   β”œβ”€β”€ models/            # Data models
β”‚   β”‚   β”‚   β”œβ”€β”€ schemas.py     # Pydantic schemas (API)
β”‚   β”‚   β”‚   β”œβ”€β”€ sql_models.py  # SQLAlchemy models (DB)
β”‚   β”‚   β”‚   └── enums.py       # Enumerations
β”‚   β”‚   β”œβ”€β”€ pipelines/         # Processing pipelines
β”‚   β”‚   β”‚   β”œβ”€β”€ url_pipeline.py      # URL acquisition
β”‚   β”‚   β”‚   β”œβ”€β”€ upload_pipeline.py   # File upload processing
β”‚   β”‚   β”‚   └── unified_pipeline.py  # Unified forensic flow
β”‚   β”‚   β”œβ”€β”€ services/          # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ downloader.py       # yt-dlp wrapper
β”‚   β”‚   β”‚   β”œβ”€β”€ metadata.py         # EXIF/ffmpeg extraction
β”‚   β”‚   β”‚   β”œβ”€β”€ hashing.py          # SHA-256 hashing
β”‚   β”‚   β”‚   β”œβ”€β”€ chain_of_custody.py # Audit logging
β”‚   β”‚   β”‚   β”œβ”€β”€ pdf_generator.py    # ReportLab PDF creation
β”‚   β”‚   β”‚   β”œβ”€β”€ pdf_service.py      # Playwright PDF service
β”‚   β”‚   β”‚   β”œβ”€β”€ validator.py        # File validation
β”‚   β”‚   β”‚   └── storage.py          # Storage abstraction
β”‚   β”‚   β”œβ”€β”€ storage/           # Storage backends
β”‚   β”‚   β”‚   β”œβ”€β”€ local_storage.py    # Local filesystem
β”‚   β”‚   β”‚   └── s3_storage.py       # AWS S3 (optional)
β”‚   β”‚   β”œβ”€β”€ workers/           # Celery tasks
β”‚   β”‚   β”‚   β”œβ”€β”€ celery_app.py       # Celery configuration
β”‚   β”‚   β”‚   └── tasks.py            # Async job tasks
β”‚   β”‚   └── main.py            # FastAPI application entry
β”‚   β”œβ”€β”€ Dockerfile             # Backend container
β”‚   β”œβ”€β”€ docker-compose.yml     # Multi-service orchestration
β”‚   └── requirements.txt       # Python dependencies
β”‚
β”œβ”€β”€ frontend/                  # React Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ common/        # Reusable components
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LoadingSpinner.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ThemeSwitcher.jsx
β”‚   β”‚   β”‚   β”‚   └── ErrorBoundary.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ evidence/      # Evidence display
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ MediaPreview.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ MetadataTable.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SHA256Display.jsx
β”‚   β”‚   β”‚   β”‚   └── VerifyIntegrityButton.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ layout/        # Layout components
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Header.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.jsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Footer.jsx
β”‚   β”‚   β”‚   β”‚   └── Layout.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ monitoring/    # Job monitoring
β”‚   β”‚   β”‚   β”‚   └── JobMonitorTable.jsx
β”‚   β”‚   β”‚   └── submission/    # Evidence submission
β”‚   β”‚   β”‚       β”œβ”€β”€ URLInput.jsx
β”‚   β”‚   β”‚       β”œβ”€β”€ FileUpload.jsx
β”‚   β”‚   β”‚       └── SubmissionTabs.jsx
β”‚   β”‚   β”œβ”€β”€ pages/             # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SubmissionPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ JobMonitorPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ EvidenceDetailPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SettingsPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ LoginPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ RegisterPage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProfilePage.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ AnalyticsPage.jsx
β”‚   β”‚   β”‚   └── PlaceholderPage.jsx
β”‚   β”‚   β”œβ”€β”€ services/          # API & utilities
β”‚   β”‚   β”‚   β”œβ”€β”€ api.js         # Axios instance
β”‚   β”‚   β”‚   β”œβ”€β”€ validation.js  # Form validation
β”‚   β”‚   β”‚   └── theme.js       # Theme helpers
β”‚   β”‚   β”œβ”€β”€ store/             # State management
β”‚   β”‚   β”‚   β”œβ”€β”€ jobStore.js    # Zustand job state
β”‚   β”‚   β”‚   β”œβ”€β”€ themeStore.js  # Zustand theme state
β”‚   β”‚   β”‚   └── authStore.js   # Zustand auth state
β”‚   β”‚   β”œβ”€β”€ styles/            # Global styles
β”‚   β”‚   β”‚   β”œβ”€β”€ GlobalStyles.js
β”‚   β”‚   β”‚   β”œβ”€β”€ theme.js       # Theme definitions
β”‚   β”‚   β”‚   └── components.css
β”‚   β”‚   β”œβ”€β”€ App.jsx            # Main app component
β”‚   β”‚   └── index.js           # React entry point
β”‚   β”œβ”€β”€ package.json           # Node dependencies
β”‚   └── public/                # Static assets
β”‚
└── README.md                  # This file

πŸ—οΈ Architecture Overview

System Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Client    β”‚ (React Frontend)
β”‚  Browser    β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚ HTTP/REST
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          FastAPI Backend (Port 8000)    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  API Endpoints (v1)             β”‚   β”‚
β”‚  β”‚  /jobs/url, /jobs/upload        β”‚   β”‚
β”‚  β”‚  /jobs/{id}, /dashboard          β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚             β”‚                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚     Pipelines Layer             β”‚   β”‚
β”‚  β”‚  β€’ URL Pipeline (yt-dlp)        β”‚   β”‚
β”‚  β”‚  β€’ Upload Pipeline              β”‚   β”‚
β”‚  β”‚  β€’ Unified Forensic Pipeline    β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚             β”‚                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚     Services Layer              β”‚   β”‚
β”‚  β”‚  β€’ Downloader (yt-dlp)          β”‚   β”‚
β”‚  β”‚  β€’ Metadata (ffmpeg, exifread)  β”‚   β”‚
β”‚  β”‚  β€’ Hashing (SHA-256)            β”‚   β”‚
β”‚  β”‚  β€’ Chain of Custody Logger      β”‚   β”‚
β”‚  β”‚  β€’ PDF Generator (ReportLab)    β”‚   β”‚
β”‚  β”‚  β€’ Storage (Local/S3)           β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚
         β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”
         β–Ό         β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Redis  β”‚ β”‚  PostgreSQL  β”‚
    β”‚ (Cache) β”‚ β”‚  (Database)  β”‚
    β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
    β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   Celery Workers        β”‚
    β”‚  β€’ process_url_job      β”‚
    β”‚  β€’ process_upload_job   β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   Celery Beat           β”‚
    β”‚  (Scheduled Tasks)      β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Components

  1. FastAPI Backend: RESTful API server handling all forensic operations
  2. React Frontend: Modern SPA with three theme options (Cyber/Dark/Light)
  3. PostgreSQL: Stores job metadata, chain of custody, and user profiles
  4. Redis: Message broker for Celery and caching
  5. Celery Worker: Processes heavy tasks asynchronously (downloads, metadata extraction, PDF generation)
  6. Celery Beat: Scheduler for periodic tasks (cleanup, monitoring)

πŸ”Œ API Endpoints

Jobs

Method Endpoint Description
POST /api/v1/jobs/url Submit URL for evidence acquisition (Twitter/X, YouTube)
POST /api/v1/jobs/upload Upload local file as evidence
GET /api/v1/jobs List all jobs
GET /api/v1/jobs/{job_id}/status Get detailed job status
GET /api/v1/jobs/{job_id}/details Get detailed job metadata and chain of custody
POST /api/v1/jobs/{job_id}/verify Verify file integrity (SHA-256)
GET /api/v1/jobs/{job_id}/report Generate and download PDF forensic report
GET /api/v1/analytics Get analytics data (total jobs, completed, failed, etc.)

Authentication

Method Endpoint Description
POST /api/v1/auth/register Register new user account
POST /api/v1/auth/login Login and receive JWT token
GET /api/v1/auth/me Get current authenticated user
POST /api/v1/auth/logout Logout (client-side token removal)

Dashboard

Method Endpoint Description
GET /api/v1/dashboard/cards Get dashboard statistics cards
GET /api/v1/dashboard/activity Get recent chain of custody events

Profile

Method Endpoint Description
GET /api/v1/profile/ Get user profile information
PATCH /api/v1/profile/ Update profile information

Social Links

Method Endpoint Description
GET /social Get social media links
POST /social Add new social link
DELETE /social/{id} Delete social link

Health

Method Endpoint Description
GET /health API health check
GET / API version info

πŸ“Έ Screenshots

Dashboard Evidence Details
Real-time monitoring of all forensic jobs Deep dive into metadata and custody logs

πŸ”§ Configuration

Environment Variables (Backend)

Create a .env file in the backend/ directory:

# Database
POSTGRES_SERVER=localhost
POSTGRES_USER=forensic
POSTGRES_PASSWORD=password
POSTGRES_DB=forensic_db
POSTGRES_PORT=5432
DATABASE_URL=postgresql://forensic:password@localhost:5432/forensic_db

# Redis
REDIS_HOST=localhost
REDIS_PORT=6379

# Celery Configuration
# Set USE_CELERY=false to use FastAPI BackgroundTasks instead of Celery
# Useful for simple development setups without Redis/Celery
USE_CELERY=true

# Storage
STORAGE_TYPE=local  # or 's3'
LOCAL_STORAGE_PATH=./evidence_storage
MAX_FILE_SIZE=524288000  # 500MB in bytes

# S3 (Optional)
S3_ENDPOINT=https://s3.amazonaws.com
S3_ACCESS_KEY=your_access_key
S3_SECRET_KEY=your_secret_key
S3_BUCKET_NAME=forensic-evidence
S3_REGION=us-east-1

# Security
SECRET_KEY=your-secret-key-change-in-production
ACCESS_TOKEN_EXPIRE_MINUTES=11520  # 8 days

# Logging
LOG_LEVEL=INFO
CHAIN_OF_CUSTODY_LOG_PATH=./chain_of_custody.log

# Rate Limiting
RATE_LIMIT_PER_MINUTE=60

# Allowed Domains for URL Acquisition
ALLOWED_URL_DOMAINS=["twitter.com","x.com","youtube.com","youtu.be","facebook.com","fb.watch","fb.com","instagram.com"]

πŸ“š For URL acquisition setup details, see URL_SETUP.md

Frontend Configuration

The frontend uses environment variables prefixed with REACT_APP_:

REACT_APP_API_URL=http://localhost:8000

πŸ§ͺ Testing

Currently, the project does not include automated tests. Manual testing is performed through:

  1. API Testing: Use FastAPI's built-in Swagger UI at http://localhost:8000/docs
  2. Frontend Testing: Manual UI testing in the React app
  3. Integration Testing: End-to-end workflow testing with real URL submissions and file uploads

πŸ› Troubleshooting

Common Issues

1. Docker Compose Not Found

Error: docker-compose: command not found

Solution:

  • Install Docker Compose: sudo apt-get install docker-compose (Linux)
  • Or use Docker Compose V2: docker compose up (instead of docker-compose up)

2. Port Already in Use

Error: Bind for 0.0.0.0:8000 failed: port is already allocated

Solution:

# Find and kill process using the port
sudo lsof -i :8000
sudo kill -9 <PID>

3. Database Connection Failed

Error: sqlalchemy.exc.OperationalError: could not connect to server

Solution:

  • Ensure PostgreSQL is running: docker-compose ps
  • Check database credentials in .env
  • Wait a few seconds for PostgreSQL to fully initialize

4. Celery Worker Not Processing Jobs / Jobs Stuck at 0%

Error: Jobs stuck in "pending" status with 0% progress

Solutions:

  1. If using Celery mode (USE_CELERY=true):

    # Check Celery worker logs
    docker-compose logs celery-worker
    
    # Restart Celery services
    docker-compose restart celery-worker celery-beat
    
    # Verify Redis is running
    redis-cli ping  # Should return PONG
  2. Switch to BackgroundTasks mode (simpler for development):

    • Set USE_CELERY=false in your .env file
    • Restart the backend server
    • Jobs will process in-process without requiring Redis/Celery

5. Frontend Can't Connect to Backend

Error: Network Error or CORS errors in browser console

Solution:

  • Verify backend is running: curl http://localhost:8000/health
  • Check REACT_APP_API_URL in frontend environment
  • Ensure CORS is properly configured in backend/app/main.py

6. Video Download Fails

Error: yt-dlp error or download timeout

Solution:

  • Update yt-dlp: pip install --upgrade yt-dlp
  • Check if URL is from supported platform (Twitter/X, YouTube)
  • Verify internet connectivity from Docker container

7. PDF Generation Fails

Error: Playwright or ReportLab errors

Solution:

# Install Playwright browsers (if manual setup)
playwright install chromium

# For Docker, rebuild the container
docker-compose build backend

8. Permission Denied for Storage

Error: Permission denied: './evidence_storage'

Solution:

# Create storage directory with proper permissions
mkdir -p backend/evidence_storage
chmod 777 backend/evidence_storage

# Or use Docker volumes (already configured in docker-compose.yml)

🚧 Roadmap & Future Enhancements

  • WebSocket support for real-time job updates
  • Instagram and Facebook evidence acquisition
  • Multi-user authentication and role-based access control
  • Advanced search and filtering in evidence database
  • Export chain of custody as blockchain records
  • Mobile app for field evidence collection
  • Automated testing suite (unit, integration, E2E)
  • Cloud deployment guides (AWS, Azure, GCP)
  • Evidence comparison and deduplication
  • Machine learning for content classification

πŸ‘₯ Contributors

A huge thanks to the team that made this project possible:

  • πŸ‘¨β€πŸ’» Rana Uzair Ahmad - Dynamo2k1
  • πŸ‘¨β€πŸ’» Muhammad Usman - Prof.Paradox
  • πŸ‘©β€πŸ’» Hoor ul Ain - hurrainjhl
  • πŸ‘©β€πŸ’» Umae Habiba - ZUNATIC
  • πŸ‘¨β€πŸ’» Bilal Badar - devdas36

πŸ“„ License

This project is licensed under the MIT License..


Disclaimer: This software is intended for authorized forensic investigations only. Ensure compliance with all local laws regarding data privacy and evidence handling. The developers are not responsible for any misuse of this software.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 57.3%
  • Python 38.6%
  • HTML 2.2%
  • CSS 1.8%
  • Dockerfile 0.1%