{"id":26024438,"url":"https://github.com/romaleev/esanum-task","last_synced_at":"2025-12-06T09:01:49.114Z","repository":{"id":280227029,"uuid":"927556905","full_name":"romaleev/esanum-task","owner":"romaleev","description":"High-performance scalable web service for converting MP4 videos to GIFs | Angular, Node.js, Typescript, Redis, BullMQ, Monorepo, Docker","archived":false,"fork":false,"pushed_at":"2025-03-02T04:46:51.000Z","size":3240,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T05:25:52.364Z","etag":null,"topics":["angular","bullmq","docker","monorepo","node","redis","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/romaleev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-02-05T06:38:59.000Z","updated_at":"2025-03-02T04:46:55.000Z","dependencies_parsed_at":"2025-03-02T05:26:01.433Z","dependency_job_id":"e0f66dc6-c912-436b-8b09-37f8255231d1","html_url":"https://github.com/romaleev/esanum-task","commit_stats":null,"previous_names":["romaleev/esanum-task"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romaleev%2Fesanum-task","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romaleev%2Fesanum-task/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romaleev%2Fesanum-task/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romaleev%2Fesanum-task/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romaleev","download_url":"https://codeload.github.com/romaleev/esanum-task/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242212238,"owners_count":20090457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["angular","bullmq","docker","monorepo","node","redis","typescript"],"created_at":"2025-03-06T12:33:40.080Z","updated_at":"2025-12-06T09:01:49.011Z","avatar_url":"https://github.com/romaleev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esanum-task\n\nA high-performance web service for converting MP4 videos to GIFs, designed for scalability and reliability.\n\n## Features\n- **🎥 Upload MP4**: Supports MP4 file uploads with validation (size, resolution, duration).\n- **🚀 Fast Conversion**: Uses `FFmpeg` for efficient MP4 to GIF processing.\n- **📡 Real-time Job Tracking**: Server-Sent Events (SSE) for job status updates.\n- **🖥️ Web UI**: Angular-based client with Material UI.\n- **🔧 Robust Backend**: Node.js, Express, Redis-backed BullMQ for job queueing.\n- **🛠️ Scalable Processing**: Dockerized worker architecture with concurrency control.\n- **📊 Load Testing**: CLI-based tests simulating 1000+ requests/min.\n- **🧪 End-to-End Testing**: Playwright, Jest, and Supertest integration.\n- **🧹 Auto Cleanup**: Scheduled deletion of old files.\n\n## Tech Stack\n- **Client**: Angular 19, Material UI, RxJS\n- **Server**: Node.js, Express, Typescript\n- **Processing**: FFmpeg, BullMQ, Redis\n- **Testing**: Playwright, Supertest, Jest, Jasmine\n- **Deployment**: Docker, Docker Swarm\n- **Load Testing**: CLI-based stress testing\n- **Code Quality**: ESLint, Prettier, pre-commit hooks, lint-staged\n\n## Task Description\n\n- Develop a multi-user, high load, self-recovered web service to convert MP4\n\t to GIF\n- Input MP4: maximum size 1024:768 length 10 seconds\n- Output GIF: size -1:400, FPS = 5\n- Package a service for Docker Swarm\n- API should be able to accept up to 1000 convert requests per minute\n- Time for waiting GIF for user could be from 5 seconds to 5 mins\n- Write a simple load test via CURL\n- The number of web server replicas is 1\n- The number of worker replicas is up to 5\n- Reliable and scalable solution\n- Allow multi-user access\n- Has clean architecture with best practices\n- README how to start develop and deploy on production\n- Has no useless parts or abandoned parts\n\n## Commands\n\n### Installation\n\nInstall [Docker](https://docs.docker.com/get-docker/), [FFmpeg](https://ffmpeg.org/download.html) and NPM dependencies\n\n`brew install --cask docker` Install Docker using brew example\n\n`brew install ffmpeg` Install FFmpeg using [brew](https://brew.sh/) example\n\n`npm install` Install NPM dependencies\n\n### Development\n\nStart app in Development mode with hot reload (**Step 1**).\nThe app will be available at `http://localhost:4200`.\n\n`npm run start` Start client, server, worker and redis (**Step 1**)\n\n`npm run start:server` Start server and worker\n\n`npm run redis:start` Start Redis\n\n`npm run redis:stop` Stop Redis\n\n### Testing\n\nRun the app in Development mode (**Step 1**) and Production mode (**Steps 1-2**) first.\n\n`npm run test` Run client, server and e2e tests\n\n`npm run test:load` Run load testing (1000 requests/min)\n\n`npm run test:e2e` Run Playwright end-to-end tests\n\n`npm run test:e2e:local` Run end-to-end tests for local environment\n\n`npm run test:e2e:docker` Run end-to-end tests for Docker environment\n\n`npm run test:client` Run client tests\n\n`npm run test:server` Run server tests\n\n`npm run test:watch` Run client and server tests in watch mode\n\n`npm run test:watch:client` Run client tests in watch mode\n\n`npm run test:watch:server` Run server tests in watch mode\n\n`npm run test:server:coverage` Run server tests coverage report\n\n### Build\n\nBuild client, server and worker\n\n`npm run build` Build client, server and worker\n\n`npm run build:client` Build client\n\n`npm run build:server` Build server and worker\n\n### Production\n\nStart app in Production mode in Docker environment (**Steps 1-2**).\nThe app will be available at `http://localhost:4200`.\n\n`npm run docker:build` Build Docker images (**Step 1**)\n\n`npm run docker:deploy` Deploy Docker containers (**Step 2**)\n\n`npm run docker:rm` Remove Docker containers\n\n`npm run docker:init` Init Docker\n\n`npm run docker:status` Show Docker status\n\n`npm run docker:logs` Show Docker logs\n\n`npm run docker:prune` Prune Docker containers\n\n### Code quality\n\nCode quality checks and fixes\n\n`npm run lint` Run code quality checks\n\n`npm run lint:fix` Run code quality fixes\n\n`npm run update` Update libraries to the latest versions\n\n## Improvements\n\n- Use hash instead of uid for normalization\n\n- Use url query or local storage persistent state\n\n## API Endpoints\n\n- **`POST /api/upload`**: Upload an MP4 file for conversion\n\n- **`GET /api/status/:jobId`**: Get real-time status of conversion\n\n- **`GET /api/gif/:jobId.gif`**: Retrieve the generated GIF\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromaleev%2Fesanum-task","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromaleev%2Fesanum-task","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromaleev%2Fesanum-task/lists"}