In today's agricultural landscape, farmers often face challenges in getting fair prices due to multiple layers of middlemen. Krushak was built to solve this problem. It is a full-stack MERN platform designed to empower farmers by providing them with a direct-to-consumer marketplace.
This project goes beyond a simple e-commerce site by integrating real-time communication, data analytics, and essential tools like weather updates, creating a complete digital ecosystem for modern agriculture.
Live Demo: [Link to your deployed site on Vercel/Netlify] (Your link here!)
- Direct Selling & Buying: A multi-vendor marketplace where farmers can create their own shop, list products, and manage inventory.
- Complete Shopping Experience: Users can browse products, add items to a cart and wishlist, and complete secure online payments.
- Order Management: Full order tracking for both buyers and sellers.
- Real-Time Chat: A dedicated Socket.IO server powers a live chat feature, enabling direct communication between buyers and sellers.
- Reviews & Ratings: A two-way review system to build trust and transparency within the community.
- Seller Dashboard: An analytical dashboard for farmers to track their sales, view earnings, and analyze product performance with interactive charts.
- Withdrawal System: Farmers can securely withdraw their earnings.
- Admin Panel: A comprehensive dashboard for platform administrators to manage users, oversee all products, and view platform-wide analytics.
- Weather API: Integrated real-time weather updates to help farmers with crop planning.
- Farming News: A news feed with relevant agricultural articles and updates.
This application is built using a modern, scalable architecture, separating concerns into three distinct services.
- Frontend: React, Redux Toolkit (for state management), React Router, TailwindCSS, Axios
- Backend: Node.js, Express.js
- Database: MongoDB with Mongoose
- Real-Time Engine: Socket.IO
- Payment Gateway: Stripe
- Image Hosting: Cloudinary
+------------------+ +-------------------+ +---------------------+
| | | | | |
| React Client |----->| Node.js/Express |----->| MongoDB |
| (localhost:3000) | | API Server | | (Database) |
| | | (localhost:8000) | | |
+--------^---------+ +-------------------+ +---------------------+
|
| Real-time
| (WebSockets)
|
+--------|---------+
| |
| Socket.IO Server|
| (localhost:4000) |
| |
+------------------+
Follow these instructions to get a local copy of the project up and running for development and testing purposes.
- Node.js (v16 or higher) & npm
- MongoDB (a local instance or a free account on MongoDB Atlas)
- A free account with Stripe and Cloudinary.
-
Clone the repository:
git clone https://github.com/iffat1404/FarmKart.git cd FarmKart -
Setup the Backend:
cd backend npm install- Create a
.envfile in the/backenddirectory and add the following variables:DB_URI=<Your_MongoDB_Connection_String> PORT=8000 STRIPE_API_KEY=<Your_Stripe_Publishable_Key> STRIPE_SECRET_KEY=<Your_Stripe_Secret_Key> JWT_SECRET=<Create_A_Strong_JWT_Secret> JWT_EXPIRE=5d CLOUDINARY_NAME=<Your_Cloudinary_Name> CLOUDINARY_API_KEY=<Your_Cloudinary_Api_Key> CLOUDINARY_API_SECRET=<Your_Cloudinary_Api_Secret>
- Create a
-
Setup the Frontend:
cd ../frontend npm install- The frontend will automatically proxy requests to the backend server running on port 8000.
-
Setup the Socket Server:
cd ../socket npm install
You must run all three services concurrently in three separate terminals.
-
Start the Backend Server:
# from the /backend directory npm run dev -
Start the Socket Server:
# from the /socket directory node index.js -
Start the Frontend Client:
# from the /frontend directory npm start
Your application should now be live!
- Frontend running on
http://localhost:3000 - Backend API on
http://localhost:8000 - Socket Server on
http://localhost:4000
Click to view application screenshots
Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is distributed under the MIT License. See LICENSE for more information.