Welcome to the POS (Point of Sale) Frontend System! This is a user interface (UI) for managing products and interacting with the backend system. It includes features like searching products by barcode and viewing detailed product information.
- Product List: View a list of all products including name, description, price, category, barcode, and stock.
- Barcode Lookup: Search for products using barcode input or image scanning.
- Responsive UI: Fully responsive design for mobile and desktop users.
- Add New Product: Form to add new products with details like name, price, description, category, barcode, and stock quantity.
- Add New Suppliers: From to add new suppliers for according to customer needs For example, customers want to sell shirts, there will be suppliers, which are various brands that customers have contracted with.
- Clone this repository:
git clone https://github.com/thanachok11/POS.git
cd POS-Frontend- Install the dependencies:
npm install @zxing/library
npm install jwt-decode@latest
npm install react-router-dom
npm install @fortawesome/react-fontawesome
npm install @fortawesome/free-solid-svg-icons
npm install chart.js react-chartjs-2
npm install @react-oauth/google
npm install @mui/material @emotion/react @emotion/styled
npm install promptpay-qr qrcode.react
npm install @zxing/browser @zxing/library
npm install react-datepicker @types/react-datepicker
npm install socket.io-client
npm install - Start the server:
npm startWelcome to the POS (Point of Sale) Backend System! This is a full-featured backend service for managing products, including functionality for barcode-based product lookups and inventory management.
- Product Management: Add, update, delete, and retrieve product details.
- Barcode Lookup: Search products by barcode.
- Product Details: View detailed product information including name, description, price, category, stock quantity, and barcode.
- Add New Suppliers: From to add new suppliers for according to customer needs For example, customers want to sell shirts, there will be suppliers, which are various brands that customers have contracted with.
Follow these steps to set up the backend system locally.
Ensure that you have the following installed on your machine:
-
Clone this repository:
git clone https://github.com/thanachok11/POS.git cd POS-Backend -
Install the dependencies:
npm install npm install multer npm install google-auth-library npm install @types/multer npm install cloudinary npm install express body-parser cors dotenv npm install --save-dev typescript @types/node @types/express ts-node nodemon npm install socket.io
-
Set up your environment variables: Create a
.envfile in the root directory and add the following:MONGODB_URI=your-mongodb-uri JWT_SECRET CLOUDINARY_CLOUD_NAME CLOUDINARY_API_KEY CLOUDINARY_API_SECRET PORT=5000
-
Start the server:
npm run dev
The backend should now be running on http://localhost:5000.
- Endpoint:
/api/products - Method:
GET - Description: Fetch all products from the database.
[
{
"_id": "productId",
"name": "Product Name",
"description": "Product Description",
"price": 29.99,
"category": "Category Name",
"image": "http://example.com/product-image.jpg",
"stock": 100,
"barcode": "1234567890123",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
},
...
]