Skip to content

shootle48/POS-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

149 Commits
 
 
 
 
 
 
 
 

Repository files navigation

POS

POS Frontend System

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.

Features

  • 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.
  1. Clone this repository:
git clone https://github.com/thanachok11/POS.git
cd POS-Frontend
  1. 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 
  1. Start the server:
npm start

POS Backend System

Welcome 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.

Features

  • 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.

Table of Contents

  1. Installation
  2. API Endpoints
  3. Usage
  4. Technologies Used
  5. License

Installation

Follow these steps to set up the backend system locally.

Prerequisites

Ensure that you have the following installed on your machine:

  • Node.js (>= 14.0)
  • MongoDB (or use a cloud database like MongoDB Atlas)

Steps

  1. Clone this repository:

    git clone https://github.com/thanachok11/POS.git
    cd POS-Backend
  2. 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
    
  3. Set up your environment variables: Create a .env file 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
  4. Start the server:

    npm run dev

The backend should now be running on http://localhost:5000.


API Endpoints

Get All Products

  • Endpoint: /api/products
  • Method: GET
  • Description: Fetch all products from the database.

Response

[
  {
    "_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"
  },
  ...
]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 77.8%
  • CSS 22.2%