Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Mini Shop

Starter Project สำหรับ Software Testing Prework (Topic 1, 2, 3, 5) เป็น Mini Shop แบบ Fullstack บางๆ (Frontend + Backend) มี API จริง, In-memory Store (ไม่ต่อ Database จริง), และไม่มีระบบชำระเงิน

ติดตั้ง

npm install

รันโปรเจกต์

รัน Backend และ Frontend พร้อมกัน (แนะนำ):

npm run dev

หรือรันแยกทีละส่วน:

npm run dev:server   # Express API เท่านั้น (port 4000)
npm run dev:client   # Vite dev server เท่านั้น (port 5173)

รัน Test

npx vitest run              # รัน Test ทั้งหมดครั้งเดียว
npx vitest                  # รันแบบ watch mode
npx vitest run --coverage   # รันพร้อมสร้าง Coverage Report

Coverage Report (HTML) จะถูกสร้างไว้ที่ coverage/index.html เปิดดูด้วย Browser ได้

โครงสร้างโปรเจกต์

src/            Backend (Express API)
  utils/        Pure function (ไม่มี dependency ภายนอก)
  services/     Business logic (บางตัวรับ dependency แบบ inject ได้)
  repositories/ ชั้นเข้าถึงข้อมูล (คุยกับ store โดยตรง)
  store/        In-memory store แทน Database
  routes/       HTTP route ของแต่ละ resource
  app.js        Express app (ไม่ .listen() ที่นี่ ใช้กับ supertest ได้ตรงๆ)
  server.js     จุดเริ่มรันจริง (.listen())
client/         Frontend (Vite + React + Tailwind)
tests/
  unit/         Unit Test
  integration/  Integration Test

Tech Stack

  • Node.js + Express
  • Vite + React + Tailwind CSS
  • Vitest + supertest + @vitest/coverage-v8

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages