PhotoDrag is a React-based application that allows users to upload images and display them in a gallery. Users can drag and drop images or upload them via file input. Images are stored in Firebase and displayed with pagination.
- Drag-and-drop or file upload functionality for images.
- Display images in a gallery with pagination.
- View full-size images in a modal.
- Delete images with a confirmation modal.
- Images are stored in Firebase Firestore and Firebase Storage.
- Multi-language support with a language selector in the Navbar.
- Responsive and modern UI using React.
- React: Frontend library for building the user interface.
- Firebase: Used for authentication, Firestore for storing image data, and Firebase Storage for image storage.
- CSS: Custom styles for the user interface.
├── src
│ ├── components
│ │ ├── Navbar.js
│ │ ├── ImageUpload.js
│ │ ├── ImageGallery.js
│ ├── css
│ │ ├── App.css
│ │ ├── Navbar.css
│ │ ├── ImageUpload.css
│ │ ├── ImageGallery.css
│ ├── firebase.js
│ ├── App.js
│ ├── index.js
└── .env
Before you begin, ensure you have met the following requirements:
- Node.js and npm installed on your local machine.
- A Firebase project set up for authentication, Firestore, and Firebase Storage.
Follow these instructions to set up and run the project locally.
git clone https://github.com/naumanshafi/image-gallery-app.git
cd image-gallery-app
Run the following command to install the necessary dependencies:
npm install
Create a .env
file in the root directory of your project and add your Firebase credentials:
REACT_APP_FIREBASE_API_KEY=YOUR_API_KEY
REACT_APP_FIREBASE_AUTH_DOMAIN=YOUR_AUTH_DOMAIN
REACT_APP_FIREBASE_PROJECT_ID=YOUR_PROJECT_ID
REACT_APP_FIREBASE_STORAGE_BUCKET=YOUR_STORAGE_BUCKET
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=YOUR_MESSAGING_SENDER_ID
REACT_APP_FIREBASE_APP_ID=YOUR_APP_ID
REACT_APP_FIREBASE_MEASUREMENT_ID=YOUR_MEASUREMENT_ID
Important: Replace the placeholders (YOUR_API_KEY, etc.) with your actual Firebase credentials from your Firebase Console.
- Go to Firebase Console.
- Create a new project (if you don’t have one).
- Enable Firestore Database and Firebase Storage in the Firebase Console.
Once the configuration is complete, you can start the development server by running:
npm start
The app should now be running at http://localhost:3000.
For deploying the application, you can build it by running:
npm run build
In the project directory, you can run:
npm start
: Runs the app in the development mode.npm run build
: Builds the app for production to thebuild
folder.
This version removes the actual Firebase credentials and uses placeholders. Make sure to replace them with your own credentials before setting up.