Skip to content

pneman1/CloudComputingProject

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–ΌοΈ Image Processing Application

A cloud-based Django application for processing images with various filters and storing them in AWS S3.

✨ Features

  • 6 Image Filters: Grayscale, Sepia, Poster, Blur, Edge Detection, Solar
  • Drag & Drop Upload: Easy image upload interface
  • AWS S3 Integration: Automatic cloud storage
  • Responsive Design: Works on desktop and mobile
  • Docker Support: Easy deployment with Docker
  • Gallery View: Browse all processed images

πŸš€ Quick Start

Option 1: Automated Setup (Recommended)

git clone https://github.com/pneman1/CloudImage.git
cd CloudImage
chmod +x setup.sh
./setup.sh
source venv/bin/activate
python manage.py runserver

Option 2: Manual Setup

  1. Clone the repository

    git clone https://github.com/pneman1/CloudImage.git
    cd CloudImage
  2. Create virtual environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Run migrations

    python manage.py migrate
  5. Start development server

    python manage.py runserver
  6. Access the application

Docker Deployment

  1. Build and run with Docker Compose

    docker-compose up -d
  2. Access the application

πŸ”§ Configuration

Environment Variables

Create a .env file with the following variables:

# Django Settings
SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1

# Database (for production)
DATABASE_URL=postgresql://user:password@localhost:5432/image_processing

# AWS S3 Configuration
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_STORAGE_BUCKET_NAME=your-s3-bucket-name
AWS_S3_REGION_NAME=us-east-1

AWS S3 Setup

  1. Create S3 bucket

    ./setup-s3.sh
  2. Or configure manually

    aws configure
  3. Test S3 integration

    • Upload an image through the web interface
    • Check your S3 bucket for the processed image

πŸ“ Project Structure

ImageProcessing/
β”œβ”€β”€ apps/                    # Django applications
β”‚   β”œβ”€β”€ core/               # Core functionality
β”‚   β”œβ”€β”€ images/             # Image processing
β”‚   β”œβ”€β”€ storage/            # S3 storage utilities
β”‚   └── common/             # Shared utilities
β”œβ”€β”€ config/                 # Django configuration
β”œβ”€β”€ templates/              # HTML templates
β”œβ”€β”€ static/                # Static files (CSS, JS)
β”œβ”€β”€ media/                  # Media files
β”œβ”€β”€ deployment/             # Deployment configurations
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ Dockerfile             # Docker configuration
β”œβ”€β”€ docker-compose.yml     # Docker Compose setup
└── manage.py              # Django management script

🎨 Image Filters

The application supports 6 different image filters:

  1. Grayscale - Convert to black and white
  2. Sepia - Vintage brown tone effect
  3. Poster - Reduce colors for poster effect
  4. Blur - Gaussian blur effect
  5. Edge Detection - Highlight edges
  6. Solar - Invert colors for solar effect

πŸš€ Deployment

Local Docker Deployment

# Build and start services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Production Deployment

  1. Configure environment variables

    cp production.env.example .env
    # Edit .env with your production values
  2. Deploy with production configuration

    docker-compose -f docker-compose.prod.yml up -d
  3. Set up SSL (optional)

    • Configure Nginx with SSL certificates
    • Update security settings in Django

πŸ”§ Development

Running Tests

python manage.py test

Database Management

# Create migrations
python manage.py makemigrations

# Apply migrations
python manage.py migrate

# Create superuser
python manage.py createsuperuser

Static Files

# Collect static files
python manage.py collectstatic

πŸ“Š Monitoring

Logs

  • Django logs: Check console output
  • Docker logs: docker-compose logs -f
  • Nginx logs: docker-compose logs nginx

Performance

  • Image processing: Optimized with NumPy
  • S3 uploads: Asynchronous processing
  • Caching: Redis for session storage

πŸ› οΈ Troubleshooting

Common Issues

  1. "ModuleNotFoundError"

    • Ensure virtual environment is activated
    • Install dependencies: pip install -r requirements.txt
  2. "Database connection failed"

    • Check database configuration
    • Run migrations: python manage.py migrate
  3. "S3 upload failed"

    • Verify AWS credentials
    • Check S3 bucket permissions
    • Ensure bucket exists
  4. "Static files not found"

    • Run: python manage.py collectstatic
    • Check STATIC_ROOT setting

Debug Mode

Enable debug mode for development:

# In config/settings.py
DEBUG = True

πŸ“ API Endpoints

  • GET / - Home page
  • GET /images/upload/ - Upload form
  • POST /images/upload/ - Process image
  • GET /images/result/<id>/ - View processed image
  • GET /images/gallery/ - Browse all images
  • GET /images/download/<id>/ - Download image

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

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

πŸ™ Acknowledgments

  • Django framework
  • Pillow for image processing
  • Bootstrap for UI components
  • AWS S3 for cloud storage
  • Docker for containerization

πŸ“ž Support

For issues and questions:

  • Create an issue on GitHub
  • Check the troubleshooting section
  • Review the deployment guide

Built with ❀️ using Django, AWS S3, and Docker

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 37.6%
  • HTML 33.2%
  • Shell 22.1%
  • JavaScript 3.8%
  • CSS 2.0%
  • Dockerfile 1.3%