Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [20.14]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

environment: 'E-Shop Production'
Expand All @@ -24,6 +24,5 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: echo $'DEV_APP_PORT=${{secrets.DEV_APP_PORT}}\nPRO_APP_PORT=${{secrets.PRO_APP_PORT}}\nDEV_DB_HOST=${{secrets.DEV_DB_HOST}}\nDEV_DB_NAME=${{secrets.DEV_DB_NAME}}\nPRO_DB_HOST=${{secrets.PRO_DB_HOST}}\nPRO_DB_PORT=${{secrets.PRO_DB_PORT}}\nPRO_DB_NAME=${{secrets.PRO_DB_NAME}}\nPRO_MONGODB_URL=${{secrets.PRO_MONGODB_URL}}\nTIMEOUT_REDIS=${{secrets.TIMEOUT_REDIS}}\nPORT_REDIS=${{secrets.PORT_REDIS}}\nUSERNAME_REDIS=${{secrets.USERNAME_REDIS}}\nPASSWORD_REDIS=${{secrets.PASSWORD_REDIS}}\nCLOUDINARY_CLOUD_NAME=${{secrets.CLOUDINARY_CLOUD_NAME}}\nCLOUDINARY_API_KEY=${{secrets.CLOUDINARY_API_KEY}}\nCLOUDINARY_API_SECRET=${{secrets.CLOUDINARY_API_SECRET}}'> .env
- run: npm ci
- run: pm2 restart server
50 changes: 41 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
# EShop_BE_NodeJS
# EShop Backend (Node.js)

EShop Backend NodeJS là một dự án backend cho một trang Web bán sản phẩm điện tử.
Trong dự án này có đầy đủ các tính năng cơ bản như CRUD user, product, cart, voucher, order...
Ngoài ra dự án còn được triển khai một số chức năng khác:
## Overview
**EShop Backend NodeJS** is a backend service for an e-commerce platform specializing in electronic products. This project provides a robust and scalable API for managing users, products, carts, vouchers, and orders. It is designed to handle high concurrent purchases efficiently and includes various essential functionalities to enhance the e-commerce experience.

- Xử lý lượng mua đồng thời cao(sử dụng mô hình khóa bi quan triển khai với redis).
- Tìm kiếm sản phẩm(dựa trên text index của MongoDB).
- Upload ảnh lên cloudinary.
- Hệ thống ghi log với winston.
## Features
- **CRUD Operations**: Manage users, products, carts, vouchers, and orders.
- **High Concurrent Purchase Handling**: Implements pessimistic locking using Redis to prevent conflicts in simultaneous purchases.
- **Product Search**: Utilizes MongoDB's text indexing for efficient product search.
- **Image Uploading**: Integrates with Cloudinary for image storage and management.
- **Logging System**: Implements Winston for structured logging and monitoring.

## Tech Stack
- **Backend Framework**: Express.js
- **Database**: MongoDB
- **Caching & Locking**: Redis
- **File Storage**: Cloudinary
- **Logging**: Winston

## API Documentation
Explore the full API documentation in Postman: [EShop API Documentation](https://documenter.getpostman.com/view/26918732/2sA3JGf3wq)

## Getting Started
### Clone the repository
```sh
git clone https://github.com/DuyDangCode/EShop_BE_NodeJS.git
```

### Install dependencies
```sh
npm install
```

### Start the server
```sh
npm run start
```

## License
This project is licensed under the MIT License.

## Contact
For any inquiries, please contact ndt.duy.dev@gmail.com.

Postman: https://documenter.getpostman.com/view/26918732/2sA3JGf3wq
Loading