Esta API permite aplicar transformaciones a imágenes previamente subidas por el usuario, tales como redimensionamiento, recorte, rotación y filtros (escala de grises, sepia). Las imágenes se almacenan en MinIO y se procesan en tiempo real utilizando Go.
Para iniciar la aplicación localmente utilizando Docker:
sudo docker compose up --buildEsto levantará tanto el backend como MinIO en una red compartida.
La documentación Swagger está disponible en:
http://localhost:8080/swagger/index.html
Desde allí podés explorar y probar los endpoints disponibles, incluyendo autenticación, carga y transformación de imágenes.
La API utiliza autenticación JWT. Para realizar peticiones protegidas, agregá el token en el encabezado:
Authorization: Bearer YOUR_TOKEN_HERE
⚠️ ReemplazáYOUR_TOKEN_HEREcon tu token JWT válido y{id}con el ID de la imagen que querés transformar.
curl -X POST http://localhost:8080/images/123/transform \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-H "Accept: image/jpeg" \
-d '{
"transformations": {
"resize": { "width": 800, "height": 600 },
"crop": { "width": 0, "height": 0, "x": 0, "y": 0 },
"rotate": 0,
"format": "jpg",
"filters": { "grayscale": false, "sepia": false }
}
}' --output resized.jpgcurl -X POST http://localhost:8080/images/123/transform \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-H "Accept: image/png" \
-d '{
"transformations": {
"resize": { "width": 0, "height": 0 },
"crop": { "width": 400, "height": 300, "x": 100, "y": 50 },
"rotate": 0,
"format": "png",
"filters": { "grayscale": false, "sepia": false }
}
}' --output cropped.pngcurl -X POST http://localhost:8080/images/123/transform \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-H "Accept: image/jpeg" \
-d '{
"transformations": {
"resize": { "width": 0, "height": 0 },
"crop": { "width": 0, "height": 0, "x": 0, "y": 0 },
"rotate": 90,
"format": "jpeg",
"filters": { "grayscale": true, "sepia": false }
}
}' --output rotated_grayscale.jpgcurl -X POST http://localhost:8080/images/123/transform \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-H "Accept: image/gif" \
-d '{
"transformations": {
"resize": { "width": 320, "height": 240 },
"crop": { "width": 0, "height": 0, "x": 0, "y": 0 },
"rotate": 0,
"format": "gif",
"filters": { "grayscale": false, "sepia": true }
}
}' --output sepia.gif- 📤 Subida y almacenamiento de imágenes en MinIO
- 🔄 Transformación en tiempo real usando
imaging - 🔐 Autenticación JWT
- 🧪 Swagger UI para testing de endpoints
- 🐳 Contenerización con Docker
