A service for processing images. This service allows users to upload images and apply various transformations such as resizing, cropping, rotating, and applying filters like grayscale and sepia. The transformations are processed asynchronously using Celery and RabbitMQ.
For a complete project overview, visit the Roadmap.
- Image Upload: Upload images for processing.
- Image Transformations: Apply transformations such as resize, crop, rotate, grayscale, and sepia.
- Asynchronous Processing: Image transformations are processed asynchronously using Celery and RabbitMQ.
These instructions will help you set up the project locally for development and testing.
- Python 3.12+
- uv: Environment management
- RabbitMQ: For Celery to work, RabbitMQ must be running.
- Database: SQLite (by default, but can be configured for other databases).
git clone [email protected]:devid8642/image-processing-service.git
cd image-processing-service
uv sync
cp env.example .env
alembic upgrade head
docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:management
task run
In another terminal:
task celery
task test
- image_processing_service/main.py: The entry point for the FastAPI application.
- image_processing_service/models.py: SQLAlchemy models for the application (e.g., Image).
- image_processing_service/services: Business logic.
- image_processing_service/tasks.py: Celery tasks.
- image_processing_service/celery.py: Configuration for Celery and RabbitMQ.
- image_processing_service/settings.py: Configuration for the application (e.g., database URL, secret key).
- image_processing_service/schemas/: Pydantic schemas for validating data.
- uploads/: Directory for storing uploaded images.