Image Uploader Multer Mern API is a sleek, full-stack image upload and management web application built using Node.js, Express, MongoDB, and EJS. It supports both manual uploads via form and API-based uploads, with an elegant Glassmorphism UI, dark gradient design, and a modern responsive gallery layout.
✅ Glassmorphism + Dark Gradient UI — clean, aesthetic design with modern effects ✅ Responsive Layout — grid gallery auto-adjusts to screen size ✅ Instant Image Preview & Upload Feedback ✅ Dual Upload Methods — via form and API ✅ EJS Templating — server-side rendering for simplicity ✅ MongoDB Integration — stores image data efficiently ✅ Static Hosting for Uploaded Files — easily accessible URLs ✅ Error Handling Middleware — user-friendly API messages
| Category | Technology |
|---|---|
| Frontend | EJS, CSS (Glassmorphism Design), Poppins Font |
| Backend | Node.js, Express.js |
| Database | MongoDB (Mongoose) |
| Templating | EJS |
| Styling | Custom CSS + Gradient + Hover Effects |
| File Uploads | Multer |
| Environment | dotenv |
| Cross-Origin Access | CORS |
Image Uploader Multer Mern API/
│
├── public/
│ └── css/
│ └── styles.css # Gradient + Glassmorphism styling
│
├── uploads/ # Uploaded images stored here
│
├── views/
│ ├── index.ejs # Upload page (form + API section)
│ └── gallery.ejs # Modern gallery grid
│
├── routes/
│ └── upload.routes.js # Upload routes (form + API)
│
├── models/
│ └── Image.model.js # MongoDB schema for storing image data
│
├── .env # Environment variables
│
├── server.js # Main Express server
│
└── package.json # Project dependencies and scripts
Follow these steps to run Image Uploader Multer Mern API locally:
git clone https://github.com/yourusername/Image Uploader Multer Mern API.git
cd Image Uploader Multer Mern APInpm installCreate a .env file in the project root:
MONGODB_URI=mongodb+srv://<your-cluster-url>
PORT=3000npm startThe server will run at: 👉 http://localhost:3000
- Visit
/route. - Choose an image file and click Upload.
- Image will appear in your Gallery section.
Use the /api/uploads endpoint:
curl -X POST -F "image=@yourfile.jpg" http://localhost:3000/api/uploads{
"message": "Image uploaded successfully",
"image": {
"originalName": "yourfile.jpg",
"url": "http://localhost:3000/uploads/yourfile.jpg"
}
}- Responsive 4-column grid layout
- Hover animation for image zoom
- Displays uploaded images dynamically from the database
- Gradient background with subtle animation
- Glass card design for upload box
- Smooth transitions on hover and button clicks
- Modern typography using Poppins
- Fully responsive for mobile, tablet, and desktop
🔹 Drag-and-drop image upload 🔹 Image compression and preview before upload 🔹 User authentication for private uploads 🔹 Delete/edit uploaded images 🔹 Cloud storage integration (e.g., Cloudinary, AWS S3)
Contributions are welcome! If you have suggestions for improvement, feel free to open a pull request or issue.