{"id":29274974,"url":"https://github.com/andreypomortsev/img2pdf","last_synced_at":"2026-05-05T09:31:31.987Z","repository":{"id":300702048,"uuid":"1006868430","full_name":"andreypomortsev/img2pdf","owner":"andreypomortsev","description":"Developed a secure, scalable web service with FastAPI, Celery, and Docker Compose. Features include JWT-based authentication, async image-to-PDF conversion, PDF merging, PostgreSQL ORM, and high test coverage with pytest/HTTPX. Designed for easy deployment and scalable background processing.","archived":false,"fork":false,"pushed_at":"2025-07-03T05:46:47.000Z","size":616,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-30T22:35:50.803Z","etag":null,"topics":["celery","docker","fastapi","python3","redis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreypomortsev.png","metadata":{"files":{"readme":"README.es.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-23T05:50:28.000Z","updated_at":"2025-07-03T05:46:50.000Z","dependencies_parsed_at":"2025-07-02T08:23:20.531Z","dependency_job_id":"52a1fbfe-f2a7-4106-aea9-30b0cad8fe70","html_url":"https://github.com/andreypomortsev/img2pdf","commit_stats":null,"previous_names":["andreypomortsev/imgtopdf","andreypomortsev/img2pdf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andreypomortsev/img2pdf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypomortsev%2Fimg2pdf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypomortsev%2Fimg2pdf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypomortsev%2Fimg2pdf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypomortsev%2Fimg2pdf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreypomortsev","download_url":"https://codeload.github.com/andreypomortsev/img2pdf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypomortsev%2Fimg2pdf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32643499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["celery","docker","fastapi","python3","redis"],"created_at":"2025-07-05T05:10:05.970Z","updated_at":"2026-05-05T09:31:31.964Z","avatar_url":"https://github.com/andreypomortsev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Servicio de Conversión de Imagen a PDF\n\nUn servicio web seguro que convierte imágenes a archivos PDF y fusiona múltiples PDFs en un solo documento. Incluye autenticación JWT, un backend de FastAPI y Celery para el procesamiento asíncrono de tareas, todo ejecutándose dentro de contenedores de Docker.\n\n## Características\n\n- **Autenticación JWT**: Acceso seguro a todos los endpoints con autenticación basada en tokens\n- **Gestión de Usuarios**: Registro y administración de cuentas con hash seguro de contraseñas\n- **Conversión Asíncrona de Imagen a PDF**: Sube una imagen y se convertirá a PDF en segundo plano\n- **Fusión Asíncrona de PDFs**: Combina múltiples archivos PDF en un solo documento\n- **Seguimiento del Estado de Tareas**: Monitorea el estado de cualquier tarea en segundo plano (conversión o fusión)\n- **Contenerizado**: Toda la pila de la aplicación se gestiona con Docker y Docker Compose para una fácil configuración y despliegue\n- **Pruebas Integrales**: Incluye pruebas unitarias y de integración con alta cobertura\n\n## Tecnologías Utilizadas\n\n- **Backend**: FastAPI\n- **Autenticación**: JWT (JSON Web Tokens)\n- **Tareas Asíncronas**: Celery\n- **Broker de Mensajes**: Redis\n- **Base de Datos**: PostgreSQL con SQLAlchemy ORM\n- **Procesamiento de Imágenes**: Pillow, img2pdf\n- **Manipulación de PDF**: pypdf\n- **Seguridad**: Passlib, OAuth2 con Contraseña (y hashing)\n- **Pruebas**: Pytest, HTTPX\n- **Contenedores**: Docker, Docker Compose\n\n## Cómo Empezar\n\n### Prerrequisitos\n\n- Docker\n- Docker Compose\n\n### Ejecutando la Aplicación\n\n1.  **Clona el repositorio:**\n    ```bash\n    git clone https://github.com/andreypomortsev/img2pdf.git\n    cd img2pdf\n    ```\n\n2.  **Construye y ejecuta los servicios:**\n    ```bash\n    docker compose up --build -d\n    ```\n\n3.  La aplicación estará en funcionamiento y accesible en `http://localhost:8000`.\n\n## Autenticación\n\n### Registrar un Nuevo Usuario\n- **URL**: `/api/v1/auth/register`\n- **Método**: `POST`\n- **Cuerpo**:\n  ```json\n  {\n    \"email\": \"usuario@ejemplo.com\",\n    \"password\": \"tu-contraseña-segura\"\n  }\n  ```\n- **Respuesta Exitosa**:\n  ```json\n  {\n    \"email\": \"usuario@ejemplo.com\",\n    \"id\": 1,\n    \"is_active\": true\n  }\n  ```\n\n### Iniciar Sesión\n- **URL**: `/api/v1/auth/login`\n- **Método**: `POST`\n- **Cuerpo**:\n  ```json\n  {\n    \"username\": \"usuario@ejemplo.com\",\n    \"password\": \"tu-contraseña-segura\"\n  }\n  ```\n- **Respuesta Exitosa**:\n  ```json\n  {\n    \"access_token\": \"tu-token-jwt\",\n    \"token_type\": \"bearer\"\n  }\n  ```\n\n## Documentación de la API\n\nTodos los endpoints siguientes requieren autenticación. Incluye el token JWT en la cabecera `Authorization`:\n```\nAuthorization: Bearer tu-token-jwt\n```\n\n### Archivos\n\n#### Subir una Imagen\n- **URL**: `/api/v1/files/upload-image/`\n- **Método**: `POST`\n- **Cabeceras**: `Authorization: Bearer \u003ctoken\u003e`\n- **Datos del Formulario**: `file` (el archivo de imagen a convertir)\n- **Respuesta Exitosa**:\n  ```json\n  {\n    \"task_id\": \"\u003ctu-id-de-tarea\u003e\",\n    \"status\": \"PENDING\"\n  }\n  ```\n\n#### Verificar Estado de Tarea\n- **URL**: `/api/v1/files/tasks/{task_id}`\n- **Método**: `GET`\n- **Cabeceras**: `Authorization: Bearer \u003ctoken\u003e`\n- **Respuesta Exitosa**:\n  ```json\n  {\n    \"task_id\": \"\u003ctu-id-de-tarea\u003e\",\n    \"task_status\": \"SUCCESS\",\n    \"task_result\": \"static/files/tu_archivo.pdf\"\n  }\n  ```\n\n### Operaciones con PDFs\n\n#### Fusionar PDFs\n- **URL**: `/api/v1/pdfs/merge/`\n- **Método**: `POST`\n- **Cabeceras**: `Authorization: Bearer \u003ctoken\u003e`\n- **Cuerpo**:\n  ```json\n  {\n    \"file_ids\": [1, 2],\n    \"output_filename\": \"combinado.pdf\"\n  }\n  ```\n- **Respuesta Exitosa**:\n  ```json\n  {\n    \"task_id\": \"\u003ctu-id-de-tarea\u003e\",\n    \"status\": \"PENDING\"\n  }\n  ```\n\n## Licencia\n\nEste proyecto está bajo la Licencia MIT - consulta el archivo [LICENSE](LICENSE) para más detalles.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreypomortsev%2Fimg2pdf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreypomortsev%2Fimg2pdf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreypomortsev%2Fimg2pdf/lists"}