Skip to main content

General Overview

FeelyFeely Content Delivery Network (CDN)

A Flask-based Content Delivery Network service that provides intelligent image processing, watermarking, and asset delivery through DigitalOcean Spaces and Uploadcare integration.

πŸš€ Features​

  • Multi-Bucket Asset Management: Support for user assets, mobile device photos, and vehicle photos
  • Intelligent Image Processing: Dynamic resizing, cropping, and optimization using Uploadcare
  • Real-time Watermarking: Automatic watermark embedding with brightness detection
  • Multiple Database Support: MySQL and MongoDB integration
  • Scalable Architecture: Built with Flask and Gunicorn for production deployment
  • Cloud Storage Integration: DigitalOcean Spaces for reliable asset storage
  • Format Optimization: Automatic format conversion and quality adjustment

πŸ“‹ Table of Contents​

πŸƒβ€β™‚οΈ Quick Start​

Prerequisites​

  • Python 3.11.9
  • MySQL database
  • MongoDB instance
  • DigitalOcean Spaces account
  • Uploadcare account

Installation​

  1. Clone the repository

    git clone https://github.com/FeelyFeely/ff-cdn.git
    cd ff-cdn
  2. Install dependencies

    pip install -r requirements.txt
  3. Configure environment variables

    cp .env.example .env
    # Edit .env with your credentials
  4. Run the development server

    python server.py

The CDN will be available at http://localhost:5065

πŸ“š Documentation​

🎯 API Reference​

Image Endpoints​

General User Assets​

GET /image/<bucket>/<uuid>/<operation>/<path:s3_key>

Mobile Device Photos​

GET /image/mobiledevice/<path:s3_key>

Vehicle Photos​

GET /image/vehicle/<path:s3_key>

Supported Operations​

OperationDimensionsUse Case
thumbnail150x150Profile pictures, avatars
small320x240Small previews
medium640x480Standard web images
large1024x768High-quality displays
hero1920x1080Banner images
profile400x400Profile photos

βš™οΈ Configuration​

Key environment variables:

# Database Configuration
MYSQL_HOST=your-mysql-host
MYSQL_USER=your-mysql-user
MYSQL_PASSWORD=your-mysql-password

# DigitalOcean Spaces
DO_USER_ASSET_SPACES_KEY=your-spaces-key
DO_USER_ASSET_SPACES_SECRET=your-spaces-secret

# Uploadcare
UPLOAD_CARE_PUBLIC_KEY=your-uploadcare-public-key
UPLOAD_CARE_SECRET_KEY=your-uploadcare-secret-key

πŸš€ Deployment​

Production Deployment​

# Using Gunicorn
gunicorn --config gunicorn_config.py wsgi:app

# Using Docker (recommended)
docker build -t ff-cdn .
docker run -p 8080:8080 ff-cdn

Environment Setup​

  • Development: python server.py
  • Production: Gunicorn with configured workers
  • Platform: Supports Heroku, DigitalOcean App Platform, AWS

πŸ—οΈ Architecture​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Client App │───▢│ FF-CDN API │───▢│ DigitalOcean β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ Spaces β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Uploadcare │───▢│ Watermark β”‚
β”‚ Processing β”‚ β”‚ Embedding β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack​

  • Backend: Flask, Python 3.11
  • Databases: MySQL, MongoDB
  • Storage: DigitalOcean Spaces (S3-compatible)
  • Image Processing: Uploadcare, OpenCV, Pillow
  • Server: Gunicorn with Gevent workers
  • Authentication: Keycloak integration

πŸ“– Usage Examples​

Basic Image Request​

curl "https://cdn.feelyfeely.com/image/user-assets/12345/medium/photo.jpg"

Mobile Device Photo​

curl "https://cdn.feelyfeely.com/image/mobiledevice/devices/12345/thumbnail/device-photo.jpg"

🀝 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​

Copyright Β© 2024 FeelyFeely by Footprintts. All Rights Reserved.

πŸ“§ Support​

For support and questions:


Note: Unauthorized access is strictly prohibited. This service is intended for authorized FeelyFeely applications only.