Skip to content

Add profile image upload with local/S3 storage - #1041

Merged
nafiuishaaq merged 5 commits into
MentoNest:mainfrom
No-bodyq:feat/issue-993-avatar-upload
Aug 2, 2026
Merged

Add profile image upload with local/S3 storage#1041
nafiuishaaq merged 5 commits into
MentoNest:mainfrom
No-bodyq:feat/issue-993-avatar-upload

Conversation

@No-bodyq

Copy link
Copy Markdown
Contributor

Closes #993

Note: this branch is stacked on #1040 (issue #976) for the shared Redis module wiring, so its diff will include those commits until that PR merges.

  • POST /user/avatar accepts a multipart file upload, validates type (JPEG/PNG/WebP only), size (5MB max), and dimensions (200x200–2000x2000), rejecting anything outside those bounds with 400
  • Images are processed with Sharp into four variants (original, thumbnail 64x64, small 200x200, medium 400x400), re-encoded as progressive JPEG at quality 80
  • Uploads go through a StorageProvider abstraction with local filesystem (dev) and S3 (STORAGE_DRIVER=s3, configured via AWS_ACCESS_KEY/AWS_SECRET_ACCESS_KEY/AWS_REGION/AWS_S3_BUCKET) implementations
  • avatarUrl and avatarThumbnailUrl are saved on the user entity; the previous avatar's variants are deleted from storage when a new one is uploaded
  • Unit tests for the avatar service/controller and both storage providers, plus an e2e scaffold

@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@No-bodyq Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@No-bodyq
No-bodyq force-pushed the feat/issue-993-avatar-upload branch from e2d1f66 to 09f711e Compare July 26, 2026 20:47
@No-bodyq
No-bodyq force-pushed the feat/issue-993-avatar-upload branch from 09f711e to 518a948 Compare July 26, 2026 21:00
- auth.controller.ts had two full AuthController class bodies concatenated
  (a botched prior merge), which broke parsing for the whole file and
  cascaded into unrelated eslint type-resolution errors repo-wide
- add missing @nestjs/swagger dependency (used throughout but never
  added to package.json)
- fix relative import paths in auth.service.ts (an extra '../' pointed
  outside src/auth, breaking NodeNext module resolution)
- add .js extensions to relative imports per the project's nodenext
  moduleResolution, removing further unresolved-type cascades
- remove JwtAuthGuard's unresolvable third constructor parameter (a bare
  function type Nest can never inject), small unused-import/no-await
  cleanups, and a wrong TypeORM option name (connectTimeout -> connectTimeoutMS)
- apply repo-wide prettier formatting (was never run on ~50 files)

Lint: 95 errors -> 0. Build: failing -> passing. Prettier: 51 files -> 0.
@No-bodyq
No-bodyq force-pushed the feat/issue-993-avatar-upload branch from f252bb6 to 50212a7 Compare July 26, 2026 21:32
No-bodyq added 3 commits July 26, 2026 23:47
…ation

These specs were written against a device-aware, RefreshTokenService +
UsersService backed refresh-token design that was never wired into
AuthService/AuthController — the real implementation still uses the
simpler in-memory nonce/token-map flow. Rewrite both specs to exercise
what's actually there instead of leaving them permanently red.
@nafiuishaaq
nafiuishaaq merged commit 316c137 into MentoNest:main Aug 2, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile image upload system

2 participants