A simple React application that allows users to manage a marketplace of products using Firebase Firestore as the backend. Users can add, update, and delete products dynamically, with changes reflected in the database.
- Add Products: Add a new product with a name and price.
- Update Products: Edit the details of an existing product.
- Delete Products: Remove a product from the marketplace.
- Real-Time Updates: Reflect changes dynamically using Firebase Firestore.
- Frontend: React.js, Tailwind CSS
- Backend: Firebase Firestore
- Deployment: Any hosting platform supporting React apps (e.g., Firebase Hosting, Vercel, Netlify)
Make sure you have the following installed:
- Node.js (v14 or later)
- Firebase Account with a Firestore database setup
-
Clone the repository:
git clone https://github.com/ezekielkibiego/market-place cd market-place -
Install dependencies:
npm install
-
Set up Firebase
-
Create a Firebase project in the Firebase Console.
-
Enable Firestore in the Build > Firestore Database section.
-
Add your Firebase configuration to a new file
Firebase.jsin the project root:import { initializeApp } from "firebase/app"; import { getFirestore } from "firebase/firestore"; const firebaseConfig = { apiKey: "YOUR_API_KEY", authDomain: "YOUR_AUTH_DOMAIN", projectId: "YOUR_PROJECT_ID", storageBucket: "YOUR_STORAGE_BUCKET", messagingSenderId: "YOUR_MESSAGING_SENDER_ID", appId: "YOUR_APP_ID", }; const app = initializeApp(firebaseConfig); const db = getFirestore(app); export { db };
-
-
Run the application:
npm run dev
The app will be available at http://localhost:5173
For development, set Firestore rules to allow read and write operations:
- Open the application in your browser.
- Add products using the input fields and "Add Product" button.
- Edit or delete products using the respective buttons next to each product.
- All changes are reflected dynamically in the Firebase Firestore database.
Contributions are welcome! Feel free to submit a pull request or open an issue for suggestions or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.
- Firebase for backend services
- React for the frontend framework
- Tailwind CSS for styling