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)