- Server Enviornment - NodeJS
- Framework - ExpressJS
- Frontend - ReactJS, HTML, CSS, Javascript, Vite
- UI/UX - BootStrap
- State management - Redux
- Database - MongoDB
- Cloud database service - MongoDB Atlas
- Authorizatiion - JWT
- Upload image - Multer
- Frontend Deployment - Vercel
- Backend Deployment - Render
- First, fork this repository 🍴 and follow the given instructions:
# clone the repository to your local machine
$ git clone `git clone https://github.com/<YOUR-GITHUB-USERNAME>/proshop.git`
# navigate to the project's directory and install all the relevant dev-dependencies
$ yarn
$ cd frontend && yarn
$ cd backend && yarn
# create a MongoDB Atlas instance and obtain the MongoDB URI
# Create a developer account at Paypal and obtain PayPal Account ID
# choose a random JWT secret
# create a .env file with the following fields according to the knowledge obtained
NODE_ENV
PORT
MONGO_URI
JWT_SECRET
PAYPAL_CLIENT_ID
# use the seeder script to populate the cloud database
$ yarn data:import
# Start application
$ yarn dev
# Make requests on http://localhost:PORT/ from Postman
On the home page you can view all the products available along with their ratings and prices.
- Register/ Login
- Update Profile
- View Products on the HomePage
- View Detailed description upon clicking on the specific product from the database.
- Decide upon the quantity of the product and add it to the cart.
- View the cart to know the total Amount alongside the tax and discount breakdown.
- Decide upon the quantity and the price of the items in the cart and proceed to checkout.
- Enter your shipping details.
- Enter your method of payment.
- Place your order.
- An oder will be created against your profile which you can view in your profile.
- Use paypal to pay your order.
- You can also edit your profile and change your password.
- All the above mentioned functionalities.
- An admin can remove a user from the database.
- An admin can change the user's details except their password.
- An admin can add products to the avalable list of product on the homepage.
- An admin can alter the details of a product.
I structured the application based on MVC Architecture. MVC stands for Model, View and Controller. This application presents a clear demarcation between the Model, View and Controller logics:
- The
Model
logic is managed by Redux and Redux toolkit. Redux store decides what data the app should contain according to the current state. If the state of this data changes, then theView
is notified. It is Implemented and managed usingStore
,Reducers
,Constants
andActions
. - The
View
logic is handled usingBootStrap
Elements. It renders elements usingReact
and by monitoring the changes in theModel
logic or the store state. - The
Controller
contains the implemtation and logic to all the routes which ultimately updates the model and/or view in response to input from the users of the app.
/api/products
REQUEST METHODS | ENDPOINTS | DESCRIPTION | ACCESS |
---|---|---|---|
GET | /api/products | Fetch all products | Public |
GET | /api/products/:id | Fetch single product | Public |
DELETE | /api/products/:id | Delete a product | Private/Admin |
POST | /api/products | Create a product | Private/Admin |
PUT | /api/products/:id | Update a product | Private/Admin |
/api/users
REQUEST METHODS | ENDPOINTS | DESCRIPTION | ACCESS |
---|---|---|---|
POST | /api/users/login | Auth User and get token | Public |
POST | /api/users | Register User | Public |
GET | /api/users/profile | Get user profile | Private |
PUT | /api/users/profile | Update user profile | Private |
GET | /api/users | Get All users | Private/Admin |
DELETE | /api/users/:id | Delete a user | Private/Admin |
GET | /api/users/:id | Get user by Id | Private/Admin |
PUT | /api/users/profile | Update user by Id | Private/Admin |
/api/orders
REQUEST METHODS | ENDPOINTS | DESCRIPTION | ACCESS |
---|---|---|---|
POST | /api/orders | Create new Order | Private |
GET | /api/orders/:id | Get order by ID | Private |
GET | /api/orders/:id/pay | Update order to paid | Private |
GET | /api/orders/myorders | Update logged in user orders | Private |
/api/upload
REQUEST METHODS | ENDPOINTS | DESCRIPTION | ACCESS |
---|---|---|---|
POST | /api/upload | Upload an Image | Private |
- The upload functionality broke upon bringing into production.
- The state of the payment completion is not updated upon payment.
- Unit Tests
- Product Carousel
- Reviews for users
- Search within the homepage
- Pagination for the homepage
- Filers for price, category, brand etc.