- Monorepo
webdevtudios-fullstack-turborepowith web app using Next.js (App Router), Tailwind CSS, motion/react and Next Image for landing page / shop. FeaturesGridon the website displays 4 WebDev Studios merch products: t-shirt, badge, lanyard and limited mouse pad, with glassmorphism effects and light 3D animations.
- Increased size of WDS t-shirt product image block in
FeaturesGridwith hero style, while increasing hover effects (scale, translate Y axis, slight rotate) and strengthening glow/shadow for better prominence. - Adjusted lanyard image (
/shop/day-deo.webp) in Bag & Backpack card to full-width, clearer horizontal ratio, gentle hover for users to view detailed preview. - Updated card titles and descriptions to match image file/product names:
- WebDev Studios Badge (
huy-hieu.webp) - WebDev Studios Lanyard (
day-deo.webp) - WebDev Studios Limited Edition Mouse Pad (
pad-chuot.webp)
- WebDev Studios Badge (
- Cloudflare R2 Storage Integration: Created complete storage module with AWS SDK v3 (S3-compatible API)
- Storage Module (
apps/api/src/storage/):storage.service.ts: Service handling upload/download/delete with R2storage.config.ts: Configuration for R2 credentialsstorage.module.ts: NestJS moduleexceptions/: Custom exceptions (FileTooLargeException, InvalidFileTypeException, ImageProcessingException, StorageException)interfaces/: TypeScript interfaces for storage operationsutils/image-optimization.util.ts: Image processing with sharp (resize, convert to WebP, validate)pipes/file-validation.pipe.ts: File validation pipe for upload endpoints
- Avatar Upload Endpoint:
- Updated
PATCH /users/avatarto accept file upload (multipart/form-data) - File validation: jpg, png, webp, max 5MB
- Image processing: Resize to 400x400px, convert to WebP
- Auto-delete old avatar when uploading new one
- Storage path:
avatars/{userId}/{timestamp}-{uuid}.webp
- Updated
- Dependencies: Installed
@aws-sdk/client-s3,@aws-sdk/lib-storage,multer,sharp,uuid - Documentation: Created
apps/api/src/storage/README.mdwith setup and usage instructions
- Create R2 bucket on Cloudflare Dashboard
- Create API tokens and configure environment variables:
R2_ACCOUNT_IDR2_ACCESS_KEY_IDR2_SECRET_ACCESS_KEYR2_BUCKET_NAMER2_PUBLIC_URLR2_ENDPOINT(optional)
- Test avatar upload endpoint after R2 setup
- Setup public access for R2 bucket if needed
- Test avatar upload with different file types
- Test file validation (size, type)
- Test image optimization
- Test old avatar deletion
- Not yet tested on very small screens (<360px) or very wide screens (>1600px); may need additional Tailwind class adjustments for those breakpoints if layout is misaligned.