Skip to content

Solomonkassa/file-converter-pro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

File Converter Pro πŸš€

A production-ready, full-stack file conversion system built with Next.js 14 (Frontend) and Django 4.x (Backend). Convert between 50+ file formats with enterprise-grade security, scalability, and performance.

File Converter Pro Next.js Django PostgreSQL Redis Docker

✨ Features

πŸ”§ Core Conversion Capabilities

  • 50+ File Formats supported across multiple categories:
    • Images: JPG, PNG, WebP, BMP, GIF, TIFF, SVG
    • Documents: PDF, DOCX, TXT, HTML, Markdown, RTF
    • Audio: MP3, WAV, FLAC, AAC, OGG, M4A
    • Video: MP4, AVI, MOV, MKV, WebM, WMV
    • Spreadsheets: XLSX, CSV, JSON, ODS
    • Presentations: PPTX, PDF
  • Smart Format Detection using file magic numbers
  • Batch Processing capabilities
  • Format-specific optimization (image compression, audio bitrate selection)

πŸ—οΈ Architecture Highlights

  • Microservices Architecture with clear separation of concerns
  • Asynchronous Processing using Celery workers
  • Real-time Updates via WebSocket/SSE
  • Scalable Storage with S3 compatibility
  • Redis Caching for improved performance
  • PostgreSQL for reliable data persistence

πŸ”’ Security & Compliance

  • JWT Authentication with refresh tokens
  • File Sanitization and malware scanning
  • Rate Limiting per user/IP
  • SSL/TLS Encryption end-to-end
  • GDPR-ready data retention policies
  • Audit Logging for all operations

πŸ“± User Experience

  • Drag & Drop Interface with preview
  • Real-time Progress tracking
  • Download History with search/filter
  • Bulk Operations support
  • Responsive Design (mobile, tablet, desktop)
  • Dark/Light Mode toggle

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Next.js 14    β”‚    β”‚   Nginx Proxy   β”‚    β”‚   Load Balancer β”‚
β”‚     Frontend    │◄──►│     (SSL/TLS)   │◄──►│   (Optional)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚     Django REST API     β”‚
                    β”‚        (Backend)        β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚   PostgreSQL β”‚ β”‚    Redis    β”‚ β”‚   Celery     β”‚
           β”‚   Database   β”‚ β”‚  Cache/Queueβ”‚ β”‚   Workers    β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚               β”‚               β”‚
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚               Storage Backends                    β”‚
           β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
           β”‚  β”‚   S3    β”‚  β”‚   GCS   β”‚  β”‚  Local Storage  β”‚  β”‚
           β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‹ Prerequisites

System Requirements

  • Docker & Docker Compose (for production deployment)
  • Python 3.11+ (for local development)
  • Node.js 18+ (for frontend development)
  • PostgreSQL 15 (or Docker)
  • Redis 7 (or Docker)
  • LibreOffice (for document conversions)
  • FFmpeg (for audio/video conversions)
  • 4GB RAM minimum, 8GB recommended

Development Tools

  • Git for version control
  • VS Code or any modern IDE
  • Postman or Insomnia for API testing
  • pgAdmin or DBeaver for database management

πŸš€ Quick Start

Option 1: Docker Deployment (Recommended)

# Clone the repository
git clone https://github.com/Solomonkass/file-converter-pro.git
cd file-converter-pro

# Copy environment variables
cp .env.example .env
# Edit .env with your configuration

# Start all services
docker-compose up --build -d

# Run initial setup
docker-compose exec backend python manage.py migrate
docker-compose exec backend python manage.py createsuperuser
docker-compose exec backend python manage.py collectstatic

# Access the application
# Frontend: http://localhost:3000
# Backend API: http://localhost:8000/api
# Django Admin: http://localhost:8000/admin

Option 2: Manual Installation

Backend Setup:

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Install system dependencies (Ubuntu/Debian)
sudo apt-get update
sudo apt-get install -y \
    libpq-dev \
    ffmpeg \
    libreoffice \
    poppler-utils \
    ghostscript \
    imagemagick

# Configure environment
cp .env.example .env
# Edit .env with your settings

# Database setup
python manage.py migrate
python manage.py createsuperuser
python manage.py collectstatic

# Start Redis and Celery (in separate terminals)
redis-server
celery -A config.celery worker --loglevel=info
celery -A config.celery beat --loglevel=info

# Run Django server
python manage.py runserver

Frontend Setup:

cd frontend

# Install dependencies
npm install

# Configure environment
cp .env.example .env.local
# Edit .env.local with your API URL

# Run development server
npm run dev

πŸ”§ Configuration

Environment Variables

Backend (.env):

# Django Settings
SECRET_KEY=your-very-secret-key-change-in-production
DEBUG=False
ALLOWED_HOSTS=localhost,127.0.0.1,yourdomain.com
CORS_ALLOWED_ORIGINS=https://yourdomain.com,http://localhost:3000

# Database
DB_ENGINE=django.db.backends.postgresql
DB_NAME=fileconverter
DB_USER=postgres
DB_PASSWORD=secure_password
DB_HOST=postgres
DB_PORT=5432

# Redis
REDIS_HOST=redis
REDIS_PORT=6379

# File Storage (AWS S3 Example)
USE_S3=True
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_STORAGE_BUCKET_NAME=your-bucket-name
AWS_S3_REGION_NAME=us-east-1

# Email (for notifications)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-app-password

# Security
SESSION_COOKIE_AGE=1209600  # 2 weeks
FILE_UPLOAD_MAX_SIZE=524288000  # 500MB
CONVERSION_TIMEOUT=300  # 5 minutes

Frontend (.env.local):

NEXT_PUBLIC_API_URL=https://yourdomain.com/api
NEXT_PUBLIC_WS_URL=wss://yourdomain.com/ws
NEXT_PUBLIC_MAX_FILE_SIZE=524288000
NEXT_PUBLIC_SUPPORTED_FORMATS=jpg,png,pdf,mp3,mp4,docx,xlsx

Nginx Configuration

For production, use the provided nginx.conf with SSL:

# Generate SSL certificates
sudo certbot --nginx -d yourdomain.com

# Test configuration
sudo nginx -t

# Reload Nginx
sudo systemctl reload nginx

πŸ“ Project Structure

file-converter-pro/
β”œβ”€β”€ frontend/                    # Next.js 14 Frontend
β”‚   β”œβ”€β”€ app/                    # App Router
β”‚   β”‚   β”œβ”€β”€ (auth)/            # Authentication pages
β”‚   β”‚   β”œβ”€β”€ (dashboard)/       # Dashboard pages
β”‚   β”‚   β”œβ”€β”€ api/              # Frontend API routes
β”‚   β”‚   └── layout.tsx        # Root layout
β”‚   β”œβ”€β”€ components/            # Reusable components
β”‚   β”‚   β”œβ”€β”€ ui/               # UI components
β”‚   β”‚   β”œβ”€β”€ forms/            # Form components
β”‚   β”‚   └── conversions/      # Conversion components
β”‚   β”œβ”€β”€ lib/                  # Utility functions
β”‚   β”‚   β”œβ”€β”€ api.ts           # API client
β”‚   β”‚   β”œβ”€β”€ auth.ts          # Authentication
β”‚   β”‚   └── converters/      # Frontend converters
β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
β”‚   β”œβ”€β”€ types/               # TypeScript definitions
β”‚   └── public/              # Static assets
β”‚
β”œβ”€β”€ backend/                   # Django Backend
β”‚   β”œβ”€β”€ config/              # Project settings
β”‚   β”‚   β”œβ”€β”€ settings/       # Split settings
β”‚   β”‚   β”œβ”€β”€ urls.py         # URL routing
β”‚   β”‚   └── wsgi.py         # WSGI config
β”‚   β”œβ”€β”€ apps/               # Django apps
β”‚   β”‚   β”œβ”€β”€ users/          # User management
β”‚   β”‚   β”œβ”€β”€ conversions/    # File conversions
β”‚   β”‚   β”œβ”€β”€ files/         # File management
β”‚   β”‚   └── payments/      # Subscription handling
β”‚   β”œβ”€β”€ core/              # Core functionality
β”‚   β”‚   β”œβ”€β”€ converters/    # Conversion engines
β”‚   β”‚   β”œβ”€β”€ validators/   # File validators
β”‚   β”‚   └── utils/        # Utilities
β”‚   └── media/             # Uploaded files
β”‚
β”œβ”€β”€ docker/                  # Docker configurations
β”‚   β”œβ”€β”€ nginx/              # Nginx configs
β”‚   β”œβ”€β”€ postgres/           # Database init scripts
β”‚   └── redis/              # Redis config
β”‚
β”œβ”€β”€ scripts/                # Deployment scripts
β”‚   β”œβ”€β”€ deploy.sh          # Production deployment
β”‚   β”œβ”€β”€ backup.sh          # Database backup
β”‚   └── migrate.sh         # Migration helpers
β”‚
β”œβ”€β”€ tests/                  # Test suites
β”‚   β”œβ”€β”€ frontend/          # Frontend tests
β”‚   β”œβ”€β”€ backend/           # Backend tests
β”‚   └── e2e/               # End-to-end tests
β”‚
β”œβ”€β”€ docs/                   # Documentation
β”œβ”€β”€ docker-compose.yml      # Multi-container setup
└── README.md              # This file

πŸ§ͺ Testing

Run Test Suite:

# Backend tests
cd backend
pytest --cov=. --cov-report=html

# Frontend tests
cd frontend
npm test
npm run test:e2e

# All tests with Docker
docker-compose exec backend pytest

Test Coverage:

  • Unit Tests: 90%+ coverage
  • Integration Tests: API endpoints
  • E2E Tests: Critical user flows
  • Performance Tests: Load testing with Locust

πŸ“Š Monitoring & Logging

Application Metrics:

# View logs
docker-compose logs -f

# Monitor performance
docker stats

# Check health endpoints
curl http://localhost:8000/health/
curl http://localhost:3000/api/health

# Monitor Celery
celery -A config.celery inspect active

Logging Configuration:

  • Structured JSON logging for production
  • Log rotation with size limits
  • Centralized logging with ELK stack support
  • Error tracking with Sentry integration

πŸ”„ Deployment

Production Deployment Checklist:

  1. Infrastructure Setup:

    # Provision servers/VMs
    # Configure firewall rules
    # Set up DNS records
  2. Deployment Process:

    # Pull latest code
    git pull origin main
    
    # Build and deploy
    ./scripts/deploy.sh
    
    # Run migrations
    docker-compose exec backend python manage.py migrate
    
    # Restart services
    docker-compose restart
  3. Post-Deployment:

    # Verify deployment
    ./scripts/health-check.sh
    
    # Monitor logs
    tail -f logs/production.log
    
    # Run smoke tests
    ./scripts/smoke-tests.sh

CI/CD Pipeline (GitHub Actions):

# See .github/workflows/deploy.yml
name: Deploy to Production
on:
  push:
    branches: [main]
jobs:
  test:
    # Run tests
  build:
    # Build Docker images
  deploy:
    # Deploy to production

πŸ“ˆ Performance Optimization

Caching Strategy:

# Redis caching configuration
CACHES = {
    'default': {
        'BACKEND': 'django_redis.cache.RedisCache',
        'LOCATION': 'redis://redis:6379/1',
        'OPTIONS': {
            'CLIENT_CLASS': 'django_redis.client.DefaultClient',
            'COMPRESSOR': 'django_redis.compressors.zlib.ZlibCompressor',
        }
    }
}

Database Optimization:

-- Indexes for performance
CREATE INDEX idx_conversions_user_status ON conversions(user_id, status);
CREATE INDEX idx_files_created_at ON files(created_at DESC);
CREATE INDEX idx_users_email ON users(email);

CDN Configuration:

# CloudFront/S3 CDN for static files
location /static/ {
    proxy_pass https://your-cdn-url/;
    expires 1y;
    add_header Cache-Control "public, immutable";
}

πŸ”§ Advanced Configuration

Custom Converters:

Add custom conversion logic in backend/core/converters/:

# backend/core/converters/custom.py
class CustomConverter(BaseConverter):
    def convert(self, input_path, output_format):
        # Your custom conversion logic
        pass

Plugin System:

# Register new converters dynamically
from django.conf import settings

for converter in settings.CUSTOM_CONVERTERS:
    register_converter(converter)

Webhooks:

Configure webhooks for external integrations:

# backend/apps/conversions/webhooks.py
def send_conversion_webhook(conversion):
    # Send to Zapier, Make, or custom endpoints
    pass

🀝 Contributing

We welcome contributions! Please see our Contributing Guide.

Development Workflow:

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

Code Style:

  • Backend: Follow PEP 8, use Black for formatting
  • Frontend: ESLint with Airbnb config, Prettier
  • Commits: Conventional commits format
  • Documentation: Keep docstrings and comments updated

πŸ“„ License

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

Commercial Licensing:

For commercial use or enterprise features, contact us at licensing@yourcompany.com.

πŸ†˜ Support

Documentation:

Community Support:

Professional Support:

  • Email: support@yourcompany.com
  • SLAs: Available for enterprise customers
  • Consulting: Custom deployment and integration services

🌟 Features Roadmap

Upcoming Features:

  • AI-powered conversion (smart format detection)
  • Batch processing with ZIP archives
  • API rate limiting tiers
  • Webhook integrations
  • Mobile app (React Native)
  • Team collaboration features
  • Advanced analytics dashboard
  • Plugin marketplace for converters

Current Version: v1.0.0

Stable Release - Production ready with all core features.


πŸ“ž Contact

Project Maintainer: Solomon Kassa Email: maintainer@jedantechnology.com
Twitter: @fileconverterpro
Website: https://fileconverter.pro

πŸ™ Acknowledgments


⭐ Star us on GitHub!

If you find this project useful, please give it a star!

Star History Chart


Built with ❀️ by Solomon Kassa

About

File Converter Pro πŸš€ A production-ready, full-stack file conversion system built with Next.js 14 (Frontend) and Django 4.x (Backend). Convert between 50+ file formats with enterprise-grade security, scalability, and performance.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors