DEV Community

Cover image for ImageVault: A Full-Stack Image Upload & Gallery App Built with MERN and Tailwind
ADESH MISHRA
ADESH MISHRA

Posted on

ImageVault: A Full-Stack Image Upload & Gallery App Built with MERN and Tailwind

🚀 Introduction

In an era where visual content dominates the web, creating a fast, secure, and user-friendly image hosting app is a rewarding challenge. That's exactly what led me to build ImageVault — a full-stack application where users can upload, view, and manage images seamlessly.
This article dives into how I built ImageVault using the MERN stack (MongoDB, Express.js, React.js, Node.js) along with Tailwind CSS for sleek UI styling.

🧩 Tech Stack

Frontend: React , Tailwind CSS
Backend: Node.js, Express.js
Database: MongoDB
Image Uploads: Handled via multer and served with Express static middleware
Hosting:
Backend: Render
Frontend: Vercel

Version Control: Git & GitHub

📦 Key Features

✅ Upload images (PNG, JPG, etc.)
✅ View uploaded images in a responsive gallery
✅ Image previews and metadata
✅ Server-side image storage (locally in uploads/)
✅ REST API built with Express.js
✅ Clean Tailwind-based UI
✅ Delete functionality with confirmation

📂 Folder Structure
imagevault/

├── ImageVault-frontend/ # React frontend with Tailwind
│ ├── src/
│ └── ...

├── ImageVault-backend/ # Node + Express backend
│ ├── config/
│ ├── routes/
│ ├── controllers/
│ ├── models/
│ ├── uploads/
│ └── server.js

🔧 Backend Setup
I used Express.js to handle image uploads via multer. Here's a glimpse:

javascript// server.js
const express = require('express');
const cors = require('cors');
const app = express();

app.use(cors({ origin: 'https://adeshmishra-imagevault.vercel.app' }));
app.use(express.json());
app.use('/uploads', express.static('uploads'));

const imageRoutes = require('./routes/imageRoutes');
app.use('/api/images', imageRoutes);

🧑‍🎨 Frontend UI

Using React + Tailwind CSS, I built a responsive image gallery. Here's a preview of the upload component:
javascript
Upload
And fetching uploaded images:
javascriptuseEffect(() => {
fetch('https://atadeshmishra-imagevault.onrender.com/api/images')
.then(res => res.json())
.then(data => setImages(data));
}, []);

🌐 Deployment

🧠 Backend is hosted on Render:
https://atadeshmishra-imagevault.onrender.com
🎨 Frontend is deployed on Vercel:
https://adeshmishra-imagevault.vercel.app

🛡️ Sensitive credentials like DB URI are stored securely in .env, and .gitignore prevents committing them.

📚 What I Learned

Handling file uploads securely with multer
Connecting a React frontend to an Express backend with CORS
Managing deployments across Vercel & Render
Structuring scalable MERN applications

💭 What's Next?

🔐 Add user authentication (JWT + bcrypt)
☁️ Use a cloud storage like AWS S3 or Cloudinary
🖼️ Add image tagging and search
🖼️ Add image sending functionality

🔗 Live Project Links

Frontend (Vercel): https://adeshmishra-imagevault.vercel.app
Backend (Render): https://adeshmishra-imagevault.onrender.com
GitHub Repo: https://github.com/adesh9201/imagevault
Image description
Image description
Image description
Image description
Image description

🧑‍💻 Final Thoughts
Building ImageVault helped me deepen my full-stack development skills. It's lightweight, fast, and extensible — ideal for developers looking to implement image upload features or create portfolio-worthy MERN projects.
If you found this useful, feel free to fork it and make it your own!

Top comments (0)