Skip to content

Latest commit

Β 

History

History
255 lines (210 loc) Β· 13.6 KB

README.md

File metadata and controls

255 lines (210 loc) Β· 13.6 KB

⭐ Give this repo a star if you liked it!

Β 

farmfresh-logo

Find Farm Fresh

farmfresh-logo farmfresh-logo farmfresh-logo farmfresh-logo farmfresh-logo farmfresh-logo farmfresh-logo farmfresh-logo farmfresh-logo farmfresh-logo

Connecting consumers with local farmers for a direct and fresh produce experience πŸ§‘β€πŸŒΎ
View Demo Β· Report Bug Β· Request Feature

Table of Contents
  1. Description
  2. Prerequisites
  3. Installation
  4. Environment Variables
  5. Run the project
  6. Features
  7. Schema Design
  8. API Documentation
  9. Deployment

🧐 Description

FarmFresh Finder is a platform designed to seamlessly connect farmers with consumers, fostering a direct and transparent exchange of fresh, locally sourced produce. Our application empowers farmers by providing a digital space to showcase their yields while offering consumers a convenient way to discover and purchase high-quality, sustainably grown products.

image1 image1
image1 image1
image1 image1
image1 image2
image1 image2

This project is for demonstration purposes only. The data displayed or curated is for illustrative purposes only and does not represent real-world information.

back to top

πŸ–₯️ Prerequisites

The v22.12.0 version of Node is required for the installation and building of this application.

βš™οΈ Installation

  1. Clone this repository by running the following command in your terminal:
git clone /~https://github.com/Ktn-mariam/Find-FarmFresh.git
cd Find-FarmFresh
  1. Run the following command in the frontend side to install the dependencies:
cd client
npm install
  1. Run the following command in the server side to install the dependencies:
cd server
npm install

back to top

πŸ“š Envirnoment variables

This project is connected to a mongodb database and cloudinary for storing images. Create a .env file in the server side of the application with the following required variables:

MONGO_URI=
JWT_SECRET=
JWT_LIFETIME=
CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
CLOUDINARY_URL=

back to top

▢️ Run the project

  1. To run the React frontend:
cd client
npm start
  1. To run the NodeJS backend:
cd server
npm start

back to top

πŸ’‘ Features

As a consumer, you can:

  • REGISTER: Create an account and buy products from local farmers
  • UPDATE PROFILE: Update contact information as per needs.
  • SEARCH AND FILTER PRODUCTS: Discover products based on categories, filter them based on ratings and sort them as per preferences.
  • View Farmer Profiles: View farmer information and ratings, and access contact information.
  • Persistent Shopping Cart: Add products to the shopping cart and access them anytime, as they are also saved in the database.
  • Track orders: View all your orders, their delivery and payment statuses, and cancel them as well.
  • Add comments: Leave and read reviews of products and farmers for transparent, trustworthy relationships.
  • Follow Farmers: View recently added products of farmers you follow in your main store page.
  • Top rated products: View top rated products in your main store page.
  • View discounts: Take advantage of time limited discounts on products in your main store page.

As a farmer, you can:

  • Register: Create an account and sell directly to consumers beyond local markets.
  • Update Profile: Update profile information as per needs.
  • Add and update Products: Add and update products, add or remove promotional discounts, and change visibility.
  • View comments: View consumer ratings and comments on your products and on your services for continuous improvement.
  • 30 Day Sales Graph: Utilize a 30-day sales graph to track daily sales, gaining valuable insights.
  • Track orders: Track all your orders, update delivery and payment statuses, and delete them as well.
  • Showcase products: Showcase products online for visibility, even without delivery services.
  • View products of other farmers: View pricing of products of other farmers to maintain competitive.

back to top

πŸ› οΈ Schema Design

Blank diagram (3)

back to top

🚧 API Documentation

1. πŸ›‘οΈ Authentication Routes

Action Route Method
User login for farmers and Consumers api/v1/auth/login POST
Checks if email is already registered api/v1/auth/userExists/email/:email GET
Checks if name is already registered api/v1/auth/userExists/name/:name GET
Register Farmer api/v1/auth/register/farmer POST
Register Consumer api/v1/auth/register/consumer POST
Gets User Profile Information if token is present api/v1/auth GET

2. πŸ§‘β€πŸŒΎ Farmer Routes

Action Route Method
Gets products of Farmer api/v1/farmers/:farmerID/products GET
Add comment to Farmer api/v1/farmers/:farmerID/comments PATCH
Get Farmer profile information api/v1/farmers/:farmerID GET
Update Farmer api/v1/farmers/ PATCH

3. πŸ‘¨ Consumer Routes

Action Route Method
Gets products in shopping cart of Consumer api/v1/consumers/shoppingCart GET
Adds farmer to following list of Consumer api/v1/consumers/followFarmer PATCH
Removes farmer from following list of Consumer api/v1/consumers/unFollowFarmer PATCH
Get Consumer profile Information api/v1/consumers/:consumerID GET
Update Consumer api/v1/consumers PATCH

4. 🌾 Product Routes

Action Route Method
Get All Products api/v1/products/ GET
Add Product api/v1/products/ POST
Get Top Rated Products api/v1/products/topRatedProducts GET
Get Discounted Products api/v1/products/discountedProducts GET
Get Recently added products of Farmer api/v1/products/lastThirtyDayProducts/:farmerID GET
Get Product Detail api/v1/products/:productID GET
Delete Product api/v1/products/:productID DELETE
Update Product api/v1/products/:productID PATCH
Get Products of Category api/v1/products/category/:parentCategory GET
Get Product Detail for Order api/v1/products/orderDetail/:productID GET

5. 🚚 Order Routes

Action Route Method
Get Orders of User api/v1/orders/ GET
Add Order api/v1/orders/ POST
Get Orders that need Review api/v1/orders/reviewOrders GET
Get Earning stats of Farmer For Graph api/v1/orders/getEarningsForLast30Days GET
Update Order api/v1/orders/:orderID PATCH
Delete Order api/v1/orders/:orderID DELETE

6. πŸ’¬ Comment Routes

Action Route Method
Get Number of Comments for Farmer api/v1/comments/farmer/:farmerID/count GET
Get Comments of Farmer api/v1/comments/farmer/:farmerID GET
Get Number of Comments for Product api/v1/comments/product/:productID/count GET
Get Comments of Product api/v1/comments/product/:productID GET

back to top

πŸ”— Deployment

This application was deployed on Vercel. Make sure you enter the Environment Variables before deploying it. You also need to add vercel.json file with the following content:

{ "version": 2, "rewrites": [{ "source": "/(.*)", "destination": "/api" }] }

You also need to make sure the main file is named index.ts and is in the /api folder.

back to top