Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

POS_VISNAM

Full-stack POS application gồm:

  • Backend: ASP.NET Core .NET 8 (REST API + SignalR)
  • Frontend: nằm tại FE/pos_visnam (React/JS)

1) Yêu cầu môi trường

Chạy local (không Docker)

Chạy bằng Docker (full stack)

  • Docker Desktop / Docker Engine

2) Chạy Backend (local)

Backend nằm trong thư mục: BE/POS_VISNAM

2.1 Restore & run

cd BE/POS_VISNAM
dotnet restore
dotnet run --project POS_VISNAM/POS_VISNAM.csproj

2.2 Swagger / API

Khi chạy ở môi trường Development, backend bật Swagger.

  • Swagger: https://localhost:<port>/swagger hoặc http://localhost:<port>/swagger
  • SignalR Hub: /orderHub

Ghi chú CORS: backend đang allow origin http://localhost:3000http://localhost:5173.


3) Chạy Frontend (local)

Frontend nằm trong: FE/pos_visnam

cd FE/pos_visnam
npm install
npm run dev

Hoặc nếu project dùng CRA thay vì Vite:

npm start

Nếu FE gọi API backend, hãy cấu hình base URL ở trong file apiService.js và signalRService.js trỏ tới backend local (ví dụ http://localhost:<backend-port>).


4) Chạy full stack bằng Docker (1 Dockerfile)

Mục tiêu: Build frontend -> copy static files vào backend -> backend serve FE.

4.1 Build image

Tại root repo:

docker build -t pos_visnam:latest .

4.2 Run container

docker run --rm -p 8080:8080 pos_visnam:latest

Mặc định Dockerfile bên dưới chạy Kestrel HTTP port 8080. Bạn có thể đổi port mapping theo nhu cầu.


5) Cấu trúc thư mục (tóm tắt)

  • BE/POS_VISNAM/ (solution)
  • FE/pos_visnam/ (frontend app)

6) Troubleshooting

FE build lỗi

  • Đảm bảo Node version phù hợp.
  • Xóa cache và cài lại:
    rm -rf node_modules package-lock.json
    npm install

BE không chạy được

  • Kiểm tra đang dùng đúng .NET SDK 8:
    dotnet --version

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages