Coder Social home page Coder Social logo

gp-pos's Introduction

Go POS API

นี่คือโปรเจกต์ API สำหรับระบบ Point of Sale (POS) ของร้านค้าที่เขียนด้วยภาษา Go ซึ่งสามารถใช้เช็ค stock สินค้า, ตัด stock, ขายสินค้า, ชำระเงิน, ออกใบเสร็จรับเงิน, แยกร้านค้าสาขา, แยกพนักงานแต่ละสาขา และสรุปยอดขายได้

การรันโปรเจกต์

ขั้นตอนที่ 1: การติดตั้ง Docker

โปรดติดตั้ง Docker บนเครื่องของคุณถ้ายังไม่ได้ทำ

ขั้นตอนที่ 2: การเริ่มต้น

  1. คล๊อนโปรเจกต์จาก GitHub:

    git clone https://github.com/yourusername/go-pos.git
  2. เข้าไปในไดเร็กทอรีของโปรเจกต์:

    cd go-pos
  3. สร้างไฟล์ .env และกำหนดค่า DSN ของฐานข้อมูล PostgreSQL ของคุณ:

    cp .env.example .env
  4. รันคำสั่ง docker-compose เพื่อสร้างและเริ่มต้นบริการ Docker:

    docker-compose up --build

ขั้นตอนที่ 3: การเข้าใช้งาน API

โปรเจกต์จะเริ่มต้น API ที่ http://localhost:8080

คุณสามารถใช้ Postman หรือเบราว์เซอร์เพื่อเข้าถึงเส้นทางต่างๆของ API ได้

การใช้งาน API

Products API

  • GET /api/v1/products: เรียกดูรายการสินค้าทั้งหมด
  • POST /api/v1/products: เพิ่มสินค้าใหม่
  • PUT /api/v1/products/:id: แก้ไขสินค้าตาม ID
  • DELETE /api/v1/products/:id: ลบสินค้าตาม ID

Orders API

  • POST /api/v1/orders: สร้างคำสั่งซื้อใหม่
  • GET /api/v1/orders/:id: เรียกดูรายละเอียดคำสั่งซื้อตาม ID
  • POST /api/v1/orders/:id/pay: ชำระเงินสำหรับคำสั่งซื้อตาม ID
  • GET /api/v1/sales-summary: สรุปยอดขายทั้งหมด

Authentication API

  • POST /api/v1/auth/register: ลงทะเบียนพนักงานใหม่
  • POST /api/v1/auth/login: เข้าสู่ระบบเพื่อรับ Token

หมายเหตุ

โปรดตรวจสอบไฟล์ .env เพื่อกำหนดค่าการเชื่อมต่อฐานข้อมูลของคุณอย่างถูกต้อง

gp-pos's People

Watchers

NoobToNinja avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.