{"id":26447794,"url":"https://github.com/ropubordee/table-reservation-backend-nodejs","last_synced_at":"2025-03-18T13:58:27.035Z","repository":{"id":222094332,"uuid":"750168514","full_name":"ropubordee/table-reservation-backend-nodejs","owner":"ropubordee","description":"ระบบจองโต๊ะ(หลังบ้าน)","archived":false,"fork":false,"pushed_at":"2025-01-08T17:05:02.000Z","size":3223,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T13:58:21.172Z","etag":null,"topics":["bycrypt","cloudinary","jwt-authentication","mysql","prisma","slipok"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ropubordee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-30T05:39:12.000Z","updated_at":"2025-02-17T13:15:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"af9ddca9-ec56-4edf-9387-cd0de243b268","html_url":"https://github.com/ropubordee/table-reservation-backend-nodejs","commit_stats":null,"previous_names":["boszza1357/project","ropubordee/project-table-reservation-backend-nodejs","ropubordee/table-reservation-backend-nodejs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropubordee%2Ftable-reservation-backend-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropubordee%2Ftable-reservation-backend-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropubordee%2Ftable-reservation-backend-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropubordee%2Ftable-reservation-backend-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ropubordee","download_url":"https://codeload.github.com/ropubordee/table-reservation-backend-nodejs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244236058,"owners_count":20420753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bycrypt","cloudinary","jwt-authentication","mysql","prisma","slipok"],"created_at":"2025-03-18T13:58:24.831Z","updated_at":"2025-03-18T13:58:27.018Z","avatar_url":"https://github.com/ropubordee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backend: โปรเจคระบบจองโต๊ะ\n\n## 🚀 ฟังก์ชั่นหลักของระบบ\n- 🔑 **ระบบสมัครสมาชิกและล็อกอิน**: สามารถสมัครสมาชิกและล็อกอินได้ โดยมีการตรวจสอบและ validate ข้อมูล\n- 🎟️ **ระบบการจองโต๊ะ**: \n    - กรอกข้อมูลวันที่และเวลาที่ต้องการจอง\n    - ดูรายละเอียดของโต๊ะและราคาจอง\n    - ค้นหาชื่อโต๊ะได้\n- 🛠️ **การแบ่ง Role**: ระบบจะมีการแบ่งผู้ใช้เป็น **user** และ **admin**\n- 💸 **จ่ายเงิน**: ผู้ใช้สามารถจ่ายเงินโดยการอัพโหลด **รูปสลิป** และตรวจสอบสลิปโอนเงินผ่าน [slipok](https://slipok.com/) \n\n## 🧰 Framework และเครื่องมือที่ใช้\n\n- **Node.js (Express)**: ใช้สำหรับการพัฒนา backend โดยแยกโฟลเดอร์ออกเป็น 5 ส่วน:\n  - `config`\n  - `utils`\n  - `router`\n  - `controller`\n  - `middlewares`\n  \n- **JWT Authentication**: ใช้ JWT ในการสร้างและจัดการ Token หลังจากผู้ใช้ล็อกอินเพื่อความปลอดภัย\n  - ค่าของ Token จะมีการกำหนดวันหมดอายุ\n  - ตัวอย่างการใช้งาน:\n\n    ```javascript\n    const token = jwt.sign(userData, secretKey, { expiresIn: '1h' });\n    ```\n\n- **Prisma ORM**: ใช้ Prisma ในการเชื่อมต่อฐานข้อมูล MySQL และจัดการกับ CRUD operation\n  - ตัวอย่างการสร้างฐานข้อมูล:\n\n    ```javascript\n    const user = await prisma.user.create({\n      data: {\n        name: 'John Doe',\n        email: 'john@example.com',\n      },\n    });\n    ```\n\n- **การอัพโหลดไฟล์รูป**: รองรับการอัพโหลดได้แค่เพียง **1 รูป** เพื่อเก็บในโฟลเดอร์ `uploads` แต่ไม่เก็บในฐานข้อมูล\n\n- 💸 **จ่ายเงินและตรวจสอบสลิปโอนเงิน**: \n  คุณสามารถตรวจสอบสลิปโอนเงินได้ผ่าน [slipok](https://slipok.com/) และเก็บ token ไว้ในไฟล์ `.env`\n\n## 💡 คำแนะนำเพิ่มเติม\n- 🔐 อย่าลืมตั้งค่าไฟล์ `.env` สำหรับการเก็บ **Token** และ **ข้อมูลลับ** ต่าง ๆ\n- ⚙️ ตรวจสอบให้แน่ใจว่า **Prisma Client** ได้ทำการ migrate ฐานข้อมูลเรียบร้อยแล้ว\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropubordee%2Ftable-reservation-backend-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fropubordee%2Ftable-reservation-backend-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropubordee%2Ftable-reservation-backend-nodejs/lists"}