Skip to main content

Overview

SkillRise uses Cloudinary for media asset management. Educators can upload course thumbnails and other media files, which are stored and optimized by Cloudinary.

Features

  • Image uploads: Course thumbnails and profile pictures
  • Automatic optimization: Cloudinary optimizes images for web delivery
  • CDN delivery: Fast global content delivery
  • Transformations: Resize, crop, and format images on-the-fly
  • Secure uploads: Signed upload requests

Environment Variables

Add these to your server/.env file:
server/.env
Get your credentials from the Cloudinary Console. They’re displayed on your dashboard home page.

Setup Instructions

1

Create Cloudinary Account

  1. Go to Cloudinary
  2. Sign up for a free account
  3. Free tier includes:
    • 25GB storage
    • 25GB bandwidth/month
    • 25,000 transformations/month
2

Get API Credentials

  1. Log in to Cloudinary Console
  2. On the dashboard, you’ll see:
    • Cloud Name
    • API Key
    • API Secret
  3. Click “Reveal API Secret” to view the secret
  4. Copy all three values
3

Configure Environment Variables

Add the credentials to server/.env:
4

Install Dependencies

Configuration

Initialize Cloudinary in your server:
server/configs/cloudinary.js
Initialize on server start:
server/server.js

Upload Configuration

SkillRise uses Multer for handling multipart/form-data uploads:
server/configs/multer.js

Upload Implementation

Backend Upload Handler

server/controllers/educatorController.js
Register route:
server/routes/educatorRoutes.js

Frontend Upload Component

client/src/components/ThumbnailUpload.jsx

Image Transformations

Cloudinary supports on-the-fly transformations via URL parameters:

Responsive Images

Common Transformations

Transformation Examples

Organize Assets with Folders

Organize uploads by type:
View folders in Cloudinary Console → Media Library.

Delete Assets

Delete old images when updating:

Signed Uploads (Advanced)

For direct browser-to-Cloudinary uploads (bypassing your server):
server/routes/educatorRoutes.js
Frontend:

File Size Limits

Free Tier Limits

  • File size: 10MB per file
  • Video length: 100MB (not applicable for SkillRise images)
  • Monthly bandwidth: 25GB
Set reasonable limits in Multer config:

Common Issues

  • Verify CLOUDINARY_API_KEY and CLOUDINARY_SECRET_KEY are correct
  • Check that you’ve copied the values from the correct cloud name
  • Ensure there are no extra spaces or quotes in .env file
  • Verify the URL starts with https://res.cloudinary.com/
  • Check browser console for CORS errors
  • Ensure the image was uploaded successfully (check Cloudinary Media Library)
  • Check Multer fileSize limit (default 10MB)
  • Verify Cloudinary account limits
  • Compress images before uploading
  • Ensure transformation params are in the correct format
  • Check for typos in parameter names
  • Verify transformations are placed after /upload/ in the URL

Best Practices

Optimize Images

Always use q_auto,f_auto for automatic quality and format optimization.

Use Folders

Organize assets by type (thumbnails, avatars, content) for easier management.

Set Limits

Enforce file size and type limits to prevent abuse and storage bloat.

Delete Old Files

Remove old images when updating to save storage and bandwidth.

Resources

Cloudinary Docs

Official Cloudinary documentation

Node.js SDK

Node.js SDK reference

Image Transformations

Transformation guide

Upload Widget

Upload widget for direct uploads