How mohammed-ehap-ali-zean-al-abdin/image-resizer works
Project type and purpose
• This is a full-stack, single-page web application whose primary purpose is to accept image uploads (or select existing images), resize them on demand via URL parameters, cache the results, and serve them back to the client. The frontend is a minimal SPA (HTML/CSS/JS) and the backend is an Express-based, TypeScript Node.js service that uses Sharp for image processing.
File structure
• Top-level:
• README.md
• backend/
• frontend/
• backend/:
• Configuration: .prettierrc, eslint.config.mjs, tsconfig.json, jest.config.ts
• src/:
– app.ts: Express app setup and route definitions
– index.ts: Server bootstrap
– upload.ts: Handles image uploads (multer or similar)
– resize.ts: Core resizing logic (invokes Sharp)
– db.ts: Abstraction over storage/cache (filesystem or metadata store)
– types.ts: Shared TypeScript types
– __tests__/: Unit tests for index, resize, etc.
• frontend/:
• index.html, style.css, app.js — a lightweight SPA that calls the backend API, displays images, and lets the user pick dimensions.
README for additional insights
• Confirms tech stack: Node.js + Express + TypeScript, Sharp for image processing, Jasmine (via Jest config) for testing, ESLint/Prettier for linting/formatting.
• Key features: on-the-fly resizing, caching resized images, placeholder generator.