หนังสือสอน Spring Boot สำหรับมือใหม่ โดยใช้โปรเจกต์ Backend API เป็นแกนหลักในการเรียนรู้ตั้งแต่พื้นฐานจนถึง production-ready backend API
เนื้อหาหลัก:
- Spring Boot REST API
- Layered Architecture
- PostgreSQL + Spring Data JPA
- Validation, Exception Handling และ DTO
- Register/Login
- BCrypt password hashing
- JWT Authentication
- User และ Admin API
- Testing, Docker, Swagger และแนวทาง deploy
โปรเจกต์นี้อยู่ในสถานะ v1.0 Complete Book Draft และพร้อม deploy เป็นเว็บหนังสือด้วย GitHub Pages แล้ว
สิ่งที่มีแล้ว:
- เนื้อหาหนังสือครบ 40 บท
- ภาคผนวกสำหรับเปิดดูเร็ว
- โค้ดตัวอย่างรายบทใน
examples/ - โปรเจกต์รวมท้ายเล่มใน
examples/final-backend-api/ - Postman collection สำหรับ final project
- GitHub Actions workflow สำหรับ deploy ไป GitHub Pages
.
├── .github/workflows/deploy.yml
├── docs/internal/ # เอกสารควบคุมคุณภาพสำหรับพัฒนา/release หนังสือ
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ └── docs/ # เนื้อหาหนังสือแต่ละบท
│ └── content.config.ts
├── examples/ # โค้ดตัวอย่างประกอบหนังสือ
├── astro.config.mjs
├── package.json
└── tsconfig.json
เอกสารภายในสำหรับพัฒนา ตรวจ และ release หนังสืออยู่ที่ docs/internal และใช้ Book Documentation Standard v1 เหมือนหนังสือเล่มอื่น อ่านมาตรฐานได้ที่ docs/internal/README.md
docs/internal/
README.md
book-plan.md
api-contract.md
final-project-structure.md
manuscript-status.md
release-checklist.md
style-guide.md
teaching-principles.md
validation-report.md
decisions/
qa/
ก่อนแก้บทเรียนหรือ example project ให้อ่าน:
AGENTS.mdskills/tutorial-book-auditor/SKILL.mdskills/tutorial-book-auditor/references/teaching-principles.mddocs/internal/teaching-principles.mddocs/internal/style-guide.md
ก่อน release ให้อ่าน:
docs/internal/release-checklist.mddocs/internal/validation-report.mddocs/internal/qa/browser-test-plan.mddocs/internal/qa/accessibility-checklist.mddocs/internal/qa/security-review-checklist.md
npm install
npm run dev
npm run build
npm run previewคำสั่งที่ควรรันก่อน push:
npm run buildให้ใช้โฟลเดอร์ spring-boot-tutorial-book เป็น root ของ GitHub repository
ขั้นตอน:
- สร้าง GitHub repository ใหม่
- push โฟลเดอร์นี้ขึ้น branch
main - ไปที่
Settings→Pages - ใน
Build and deploymentเลือกSource: GitHub Actions - push หรือกด
Run workflowที่ workflow ชื่อDeploy to GitHub Pages
workflow จะตั้งค่า URL ให้อัตโนมัติ:
- repository ปกติ:
https://<username>.github.io/<repo-name>/ - repository แบบ user/organization site:
https://<username>.github.io/
ไฟล์สำคัญสำหรับ deploy:
.github/workflows/deploy.ymlastro.config.mjspublic/.nojekyll
astro.config.mjs อ่าน environment variables เหล่านี้:
SITE = https://<username>.github.io
BASE_PATH = /<repo-name>
ใน GitHub Actions ตั้งค่าให้อัตโนมัติแล้ว ปกติไม่ต้องแก้เอง
ถ้าใช้ custom domain ให้ปรับ SITE และเอา BASE_PATH ออกตามโดเมนจริง
- เขียนหรือแก้เนื้อหาใน
src/content/docs/ - เก็บโค้ดประกอบบทไว้ใน
examples/ - รัน
npm run devเพื่อ preview - รัน
npm run buildก่อน publish - push ขึ้น GitHub เพื่อ deploy ผ่าน GitHub Actions