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β
-
Clone the repository
git clone https://github.com/FeelyFeely/ff-cdn.git
cd ff-cdn -
Install dependencies
pip install -r requirements.txt -
Configure environment variables
cp .env.example .env
# Edit .env with your credentials -
Run the development server
python server.py
The CDN will be available at http://localhost:5065
π Documentationβ
- Installation Guide - Detailed setup instructions
- Configuration Guide - Environment and service configuration
- API Reference - Complete API documentation
- Architecture Overview - System design and components
- Deployment Guide - Production deployment instructions
- Development Guide - Contributing and development setup
π― 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β
| Operation | Dimensions | Use Case |
|---|---|---|
thumbnail | 150x150 | Profile pictures, avatars |
small | 320x240 | Small previews |
medium | 640x480 | Standard web images |
large | 1024x768 | High-quality displays |
hero | 1920x1080 | Banner images |
profile | 400x400 | Profile 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β
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
π Licenseβ
Copyright Β© 2024 FeelyFeely by Footprintts. All Rights Reserved.
π§ Supportβ
For support and questions:
- Email: [email protected]
- Documentation: Full Documentation
- Issues: GitHub Issues
Note: Unauthorized access is strictly prohibited. This service is intended for authorized FeelyFeely applications only.