This is a full-stack web application built with Vue.js, Tailwind CSS, and MongoDB, where users can upload images, add titles, edit, delete, and view a gallery of images. The backend API is powered by Express.js and Mongoose, providing a simple and efficient way to manage image uploads and storage.
The project consists of two main parts:
Frontend: Built using Vue.js and Tailwind CSS for a responsive and modern UI.
Backend: A RESTful API built with Express.js and MongoDB (Mongoose).
Clone the frontend repository:
git clone https://github.com/khaouitiabdelhakim/gallery-store.git
cd gallery-store
Install dependencies:
npm install
Start the development server:
npm run dev
The app will be available at http://localhost:3000
.
Clone the backend repository:
git clone https://github.com/khaouitiabdelhakim/gallery-store-api.git
cd gallery-store-api
Install dependencies:
npm install
Start the backend server:
node api.js
The API will run on http://localhost:5000
.
MongoDB Setup:
Make sure you have a running MongoDB instance. The backend connects to the MongoDB instance at mongodb://localhost:27017/gallery
. If you want to use a different MongoDB URI, modify the connection string in api.js
accordingly.
POST /upload: Upload an image and add a title
multipart/form-data
with image
(file) and title
(text)GET /images: Retrieve all uploaded images
DELETE /images/:id: Delete an image by its ID
Image Upload: The image upload form allows you to upload an image file and provide a title. Once uploaded, the image is displayed in the gallery grid.
Gallery Grid: All uploaded images are displayed in a grid layout. Each image shows its title and a delete icon to remove it.
Deleting an Image: Clicking the delete icon removes the image from both the frontend and backend.
To build the frontend for production:
npm run build
This will create a dist/
folder with optimized production files.
Ensure your MongoDB instance is running in production, then deploy the backend server (e.g., using Heroku or any cloud provider).
Feel free to fork and submit pull requests! All contributions are welcome.