This project is an e-commerce platform designed to connect the Department of Agriculture (DA) with consumers directly.
There are two main user types in the system:
- Customers: These are registered users who can browse products, add items to their shopping cart, and place orders.
- Department of Agriculture (DA): This account acts as the administrator and has full access to manage user accounts, product listings, order fulfillment, and sales reports.
Customers register with their email address and create a username.
- Upon registration, users are automatically assigned as customers.
- The DA has a pre-assigned administrative account for managing the platform.
- General public cannot access the platform without registering as a customer.
- Login/Logout functionality allows secure access for customers.
- Customers cannot access the admin dashboard or functionalities exclusive to the DA.
User Account Management:
Product Listings:
- The DA can create and manage product listings.
- Products include details like:
- Product Name
- Product Type (Crops or Poultry)
- Product Price
- Product Description
- Quantity (Inventory Management)
- The DA can update the stocks inventory of the products.
- Sorting options allow organizing products by name, type, price, or quantity (ascending or descending).
Order Fulfillment:
Sales Reports:
- The DA can generate reports on: - Products sold with individual and total sales income. - Transaction summaries categorized by week, month, and year.
Product Listings and Order Fulfillment:
- Browse product listings with sorting options based on name, type, price, or quantity (ascending or descending).
- Manage shopping cart functionalities: - Delete items - View total number of items - Calculate total price
Order Management:
- Orders serve as confirmation for items purchased.
- Customers can cancel orders before confirmation by the DA.
Prerequisites:
-
Node.js and npm: You'll need Node.js and npm installed on your system. You can download them from the official website https://nodejs.org/en.
-
MongoDB: Download and install MongoDB from the official website https://www.mongodb.com/try/download/community. Follow the installation instructions for your operating system.
-
Project dependencies:
- Navigate to the server directory in your terminal and run the following command:
npm install
- Navigate to the client directory in your terminal and run the following command:
npm install
These command will install all the necessary dependencies listed in your package.json
file.
Next, create a .env file in the server directory and include this line:
SECRET_KEY=MERN_STACK
If you want sample products to be in the app, you must have MongoDB Compass and import farm-to-table.products.json
to the products collection.
Running the Project:
- Start the server: In your terminal, navigate to the server directory and run:
npm start
This will typically start the server-side application.
- Start the client: In your terminal, navigate to the client directory and run:
npm start
This will start the client-side application.