- Implement a Web Based solution through which farmers can participate in a commodity exchange market. The solution should explain the process involved and the benefits of commodity exchange to the user.
- The purpose of such an exchange is to provide a centralized marketplace where commodity producers can sell their commodities to those who want to use them for manufacturing or consumption.
- The solution should enable farmers to create independent accounts and interact with dealers to avail the best profits and deals.
-
Frontend
- HTML5
- CSS3
- Vanilla JavaScript
-
Backend
- Node.js (Express.js)
-
Database
- MongoDB
For the Live Demo, click here.
- The live demo replicates the behavior of the site without the need for a real server. Instead, there is a mock server that is implemented in client side JavaScript, using
localStorage
as the database. - Please refer to
frontend/mock-server.js
if you are curious about how the mock server is implemented. - To get a better understanding of how the site works, please open the developer console (Ctrl + Shift + J).
The live demo logs a lot of details like network requests, responses and messages to the browser console. - The database can be inspected directly from the console by typing
Database.tables
.
When the page is unloaded, the database is saved tolocalStorage
with the keydatabase
. You can access this withlocalStorage.database
. - Since this is just a prototype, there isn't any real OTP integration.
If you run the server locally, then the OTP will be generated and logged to the server output.
If you view the live demo then the OTP will be displayed as an alert and also logged to the browser console.
- The wheat represents farmer's pride, and green around the wheat represents the Indian fields.
- Unified landing page loads.
- Do GET
/user
- If successful, go to respective dashboard.
- Wait for user to enter valid phone, and press next.
- Do POST
/otp
body:{phoneNumber}
- If post is unsuccessful, then we have bigger problems.
- (*) Wait for user to enter valid OTP, and press next.
- Do POST
/authenticate
body:{phoneNumber, otp}
- If post is successful, do GET
/user
- If user is found then go to respective dashboard.
- Else user does not exist, goto signup.
- If post is successful, do GET
- Inform user that OTP is wrong, goto (*)
frontend
┣ contact
┃ ┣ index.html
┃ ┗ translation.js
┣ farmer
┃ ┣ index.html
┃ ┣ script.js
┃ ┗ style.css
┣ signup
┃ ┣ index.html
┃ ┣ script.js
┃ ┗ style.css
┣ videos
┃ ┣ farmer.mp4
┃ ┗ wholesaler.mp4
┣ wholesaler
┃ ┣ index.html
┃ ┣ script.js
┃ ┗ style.css
┣ background.svg
┣ index.html
┣ logo.svg
┣ mock-server.js
┣ script.js
┣ style.css
┣ translation.js
┗ util.js
- Clone repository.
- Setup MongoDB, either locally, in a Docker container or on the cloud.
- Edit the MongoDB server Url in
/server/server.js
. - Run
npm install
andnpm start
in the/server
folder. - Go to
https://localhost:5000
in your web browser.
- Mobile - OTP verification
- OTP is valid for 5 minutes from issue time
- Blind checking of OTP
- Unified auth & identity token.
- Token is stored as a cookie on the client side
- Token valid for 2 days
- Every privileged request is authenticated on the server side
- Client side cookie is set to expire after 2 days
- Minimized the number of buttons and pages for accesibility for the farmer.
- Everything on one page.
- Simple add and remove icon.
Initially, the original added quantity is set to available quantity. As quantity is sold, the available quantity is updated, helping farmer keep track of what he added initially to the Farmer's Portal
Simply selecting the item, and ordering directly the required quantity. It will be added to Ordered Items for Wholesalers, and Open Orders for Farmers.
Simply, pressing the tick icon, if the order is delivered, the wholesaler can update it for himself and the farmers.
Both the Farmer's and the Wholesaler's numbers will be provided on the portals and how the transactions will take place can be discussed over call, according to one's convenience.
- 24 X 7 Helpline Service Center
- Videos in Hindi explaining working of site to help both, the farmers and the wholesalers.
- Added FAQs, in Hindi and English
- Harsh Kapadia (HarshKapadia2, [email protected])
- Kartik Soneji (KartikSoneji, [email protected])
- Tushar Nankani (tusharnankani, [email protected])