Check out the website here
- Sliding Window Rate Limiter (using Node cache memory) to control traffic
- Fixed Window Rate Limiter (using Node cache memory) for IP banning
- JWT Authentication
- Customers can add items to cart and change the quantity from the cart page
- All orders history is also available to the user along with relevant information
- Search functionality to find different products
- Updates stock, rating and comments as per the input by customers
- Admin control to add and delete products
- Admin also confirms the delivery of order
- Stripe api integrated. Currently allows only credit card
- ReactJS for front-end
- Redux for state management
- SASS for CSS pre processing
- Redux thunk middleware for asynchronus redux actions
- React router for routing to different pages
- Express middleware on the backened to handle routes and requests
- Mongoose for the database schema and performing operations
- MongoDB used as a database
- Currently adding unit tests and integration test for various components
Type | Route | Access | Description |
---|---|---|---|
GET | /api/orders | Private | Returns a list of all the user has made. If the request is made by admin it returns all the orders |
GET | /api/products | Public | Returns all the products |
GET | /api/products/{id} | Public | Returns a specific product as per the id |
GET | /api/users/profile | Private | Returns the details of the currently logged in user |
POST | /api/key | Public | Returns the Public stripe key |
POST | /api/orders | Private | It stores the order details and makes a payment intent with stripe |
POST | /api/products/add | Private(Admin) | Adds a new product to the database |
POST | /api/products/reviews | Private | Adds a review for a product by a logged in user |
POST | /api/products/reviews/deletereviews | Private | Deletes the comment (if any) made by logged in user |
POST | /api/products/updateQty | Private | Updates the product stock when an order is palced |
POST | /api/products/delete | Private(Admin) | Delete the product from the database |
POST | /api/users/login | Public | Checks for credentials and send JWT token for further requests by the user |
POST | /api/users/register | Public | Validates the information and add new user to database |
PUT | /api/users/profile | Private | Updates the user details |
- UI works for now at least, although I want to make it more polished. Maybe work on UI a bit later (After getting my hands on Figma).
git clone https://github.com/Avash027/Nozama.git
cd project
To install all the dependencies
Run the command in the root directory and the client directory
npm install
Now create a .env file in the root directory
NODE_ENV = (production/deployment as per the use)
PORT = (Port of the server)
MONGO_URI = (Database URL provided by the MonogDB atlas)
SECRET_KEY = (For JWT Authentication)
STRIPE_SECRET_KEY = (Secret Key provided by stripe)
STRIPE_PUBLIC_KEY = (Public Key provided by stripe)
Check out .env.example
To run the project on the local machine
npm run dev