eCommerce platform built with the MERN stack & Redux.
Check it out!
Table of Contents:
- Bulkart - Bulk Purchasing App
I have used ECMAScript Modules in the backend. Be sure to have at least Node v14.6+ or you will need to add the "--experimental-modules" flag.
Also, when importing a file (not a package), be sure to add .js at the end or you will get a "module not found" error.
Create a .env file in then root and add the following
NODE_ENV = development
PORT = 5000
MONGO_URI = your mongodb uri
JWT_SECRET = any random text
npm install
cd frontend
npm install
# Run frontend (:3000) & backend (:5000)
npm run dev
# Run backend only
npm run server
You can use the following commands to seed the database with some sample users and products (/backend/data
) as well as destroy all data
# Import data
npm run data:import
# Destroy data
npm run data:destroy
Sample User Logins
[email protected] (Vendor)
123456
[email protected] (Customer)
123456
[email protected] (Customer)
123456
There are two types of users - Vendors and Customers. Each of them have their own use-cases.
It has an option to enter the username and password, and then login. There is also an option to register in case the user does not have an existing account.
During registration, there would be the option to select between customer and vendor type. Here the user enters his name, email address, and account password.
Create a new product specifying its Name, Price, Image, and the Quantity in the Bundle.
He/she can view all the current product listing done by him/her.
- The vendor has the option to take down a listing making sure that customers get their product status as canceled.
- Once the product is ready to dispatch (i.e. when it has been ordered by sufficient people), it is removed from this view and becomes ready to dispatch.
The vendor can see all the orders which are ready to be dispatched and he/she can click a button to dispatch the product which removes it from this view.
All dispatched orders are visible in another view.
- Exact string is done
- All the vendors selling that product are displayed along with their price, rating, reviews and quantity remaining
- Select the product
- Specify quantity desired
- Add it to cart
- Proceed to checkout
- Enter shipping address
- Place order
- Click to pay
All orders are visible on user's profile to the user. All the products under a particular order have a dispatch status alongside them:
- Waiting, Placed, Dispatched, Cancelled
- Waiting (If not enough orders have been placed meeting the minimum bulk quantity requirement by the seller)
- Quantity left for the order to get placed is also shown
- Placed (If the quantity requirements are met but is yet to get dispatched by the seller in his/her portal)
- Dispatched (If the seller accepts the order in his/her portal)
- Cancelled (If the seller cancels the order in his/her portal)
- Waiting (If not enough orders have been placed meeting the minimum bulk quantity requirement by the seller)
- Home
- Login
- Register
- Product List
- Product Details
- Cart
- Profile
- Waiting List Products
- Ready to Dispatch Products
- Dispatched Products
- Shipping Details
- Place Order Screen
- Product Edit Screen
- Order Details
NAME | TYPE | REQUIRED | OTHERS |
---|---|---|---|
name | String | true | - |
password | String | true | - |
String | true | unique: true | |
isVendor | Boolean | true | default: false |
NAME | TYPE | REQUIRED | OTHERS |
---|---|---|---|
user(the vendor) | ObjectId | true | ref: User |
name | String | true | |
status | String | true | default: 'Waiting' |
image | String | true | |
reviews | Subdocument | ||
rating | Number | true | default: 0 |
numReviews | Number | true | default: 0 |
price | Number | true | default: 0 |
bundleQuantity | Number | true | default: 0 |
remainingQuantity | Number | true | - |
NAME | TYPE | REQUIRED | OTHERS |
---|---|---|---|
name | String | true | |
rating | String | true | |
comment | String | true | |
user | ObjectId | true | ref: User |
NAME | TYPE | REQUIRED | OTHERS |
---|---|---|---|
user | ObjectId | true | ref: User |
orderItems | Subdocument | - | |
shippingAddress | Subdocument | - | |
paymentResult | String | - | - |
totalPrice | Number | true | default: 0.0 |
taxPrice | Number | true | default: 0.0 |
shippingPrice | Number | true | default: 0.0 |
isPaid | Boolean | true | default: false |
shippingPrice | Date | - | - |
NAME | TYPE | REQUIRED | OTHERS |
---|---|---|---|
name | String | true | - |
image | String | true | - |
price | Number | true | - |
product | ObjectId | true | Ref: Product |
NAME | TYPE | REQUIRED | OTHERS |
---|---|---|---|
address | String | true | - |
city | String | true | - |
postalCode | String | true | - |
country | String | true | - |
API_ROUTE | TYPE | DESCRIPTION |
---|---|---|
/api/users/login | POST | Auth user & get token |
/api/users | POST | Register a new user |
/api/users/profile | GET | Get user profile |
/api/users/profile | PUT | Update user profile |
API_ROUTE | TYPE | DESCRIPTION |
---|---|---|
/api/products | GET | Fetch all products |
/api/products/:id | GET | Fetch single product |
/api/products/:id | DELETE | Delist a product |
/api/products | POST | Create a product |
/api/products/:id | PUT | Update a product |
/api/products/:id/reviews | POST | Create new review |
/api/products/mywaitingproducts | GET | Get logged in vendor's waitlist products |
/api/products/dispatchready | GET | Get logged in vendor's dispatch ready products |
/api/products/dispatched | GET | Get logged in vendor's dispatched products |
/api/products/dispatchProduct/:id | PUT | Update product status to dispatched |
API_ROUTE | TYPE | DESCRIPTION |
---|---|---|
/api/orders | POST | Create new order |
/api/orders/:id | GET | Get order by ID |
/api/orders/:id/pay | PUT | Update order to paid |
/api/orders/myorders | GET | Get logged in user orders |