Farm2City is a full-stack farmer-to-buyer marketplace that enables farmers to sell their produce directly to buyers, reducing dependence on traditional intermediaries.
The platform allows farmers to list and manage their products while buyers can discover produce based on location, negotiate prices, place orders, and track deliveries through a simple marketplace interface.
- Create and manage product listings
- Specify product price, quantity, and location
- Manage incoming orders
- Track product availability
- Access a dedicated farmer dashboard
- Browse available farm products
- Discover products based on location
- Negotiate product prices
- Place and manage orders
- Track deliveries through the platform
- Access a dedicated buyer dashboard
- Role-based farmer and buyer workflows
- Location-based product discovery
- Price negotiation
- Product and order management
- Mock delivery tracking
- Responsive marketplace interface
- RESTful API architecture
- PostgreSQL-backed persistent data management
Frontend
- React.js
- Vite
- JavaScript
Backend
- FastAPI
- Python
- REST APIs
Database
- PostgreSQL
Architecture
- Full-stack client-server architecture
- RESTful API communication
- Role-based workflows
Farm2City/
├── frontend/ # React.js frontend
│ ├── src/
│ ├── public/
│ └── package.json
│
├── backend/ # FastAPI backend
│ ├── app/
│ ├── requirements.txt
│ └── ...
│
└── README.md
Make sure you have the following installed:
- Node.js and npm
- Python 3.10+
- PostgreSQL
- Git
git clone https://github.com/<your-username>/Farm2City.git
cd Farm2Citycd frontend
npm install
npm run devThe frontend will be available at the local URL shown by Vite.
Open another terminal:
cd backend
python -m venv venv
source venv/bin/activateOn Windows:
venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtStart the FastAPI server:
uvicorn main:app --reloadCreate a PostgreSQL database and configure the required database credentials in the backend environment variables.
Example:
DATABASE_URL=postgresql://username:password@localhost:5432/farm2cityDo not commit your
.envfile or database credentials to the repository.
Farmer
│
├── Add / Manage Products
│
▼
Farm2City Marketplace
│
├── Location-based Discovery
├── Price Negotiation
└── Product Information
│
▼
Buyer
│
├── Place Order
└── Track Delivery
│
▼
Order Management
Farm2City aims to create a more transparent connection between farmers and buyers by providing a digital marketplace where agricultural products can be discovered, negotiated, and purchased directly.
The project also serves as an exploration of full-stack application development, including frontend–backend integration, REST API design, database management, role-based workflows, and responsive UI development.
🚧 Active Development
More features and improvements may be added as the project evolves.
Developed as a full-stack web development project using React.js, FastAPI, and PostgreSQL.