A robust and scalable full-stack solution for implementing secure, high-performance image uploads in a MERN (MongoDB, Express, React, Node.js) application using Cloudinary for media management. Say goodbye to file system uploads and hello to powerful, cloud-based media delivery!
-
🌐Live Demo: https://mern-cloudinary.vercel.app/
-
Frontend vercel: http://vercel.com/
-
Backend Render: https://render.com/
| Feature | Description |
|---|---|
| Cloudinary Integration | Seamlessly upload, store, and manage media assets using the industry-leading Cloudinary platform. |
| Secure & Scalable | Images are offloaded from your server and stored securely, ensuring quick retrieval and reduced server load. |
| Full MERN Stack | Built on the reliable and modern MongoDB, Express, React, and Node.js architecture. |
This project is built using a powerful and modern stack:
- React (with Functional Components and Hooks)
- Axios (for API communication)
- Node.js & Express.js
- Cloudinary SDK (for server-side media management)
- MongoDB (NoSQL Database)
- Mongoose (ODM for MongoDB)
Follow these steps to set up the project locally.
You must have Node.js and npm installed on your machine.
-
Clone the repository:
git clone [https://github.com/dheepaky/Mern-Cloudinary.git](https://github.com/dheepaky/Mern-Cloudinary.git) cd Mern-Cloudinary -
Install dependencies in both client and server directories:
# Install server dependencies cd server npm install # Install client dependencies cd ../client npm install
-
Set up Environment Variables: Create a file named
.envin theserverdirectory and add your credentials.# MongoDB Connection MONGO_URI="YOUR_MONGO_CONNECTION_STRING" # Cloudinary Credentials (Get these from your Cloudinary Dashboard) CLOUDINARY_CLOUD_NAME="YOUR_CLOUD_NAME" CLOUDINARY_API_KEY="YOUR_API_KEY" CLOUDINARY_API_SECRET="YOUR_API_SECRET" # Optional: Server port PORT=5000
-
Start the Backend Server: Navigate back to the
serverdirectory and run the development script:npm run dev # Requires nodemon # OR npm start
The server will typically run on
http://localhost:5000. -
Start the Frontend Client: Navigate to the
clientdirectory and run:npm start
The React application will open in your browser, typically at
http://localhost:3000.
You're all set! Now you can test the upload functionality and see your assets appear instantly on Cloudinary.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'feat: Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See the LICENSE file for more information.
Dheepak Y
- GitHub: dheepaky
- Project Link: https://github.com/dheepaky/Mern-Cloudinary